1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg">
- <head>
- <title>Parameterized Types</title>
- <link rel="stylesheet" type="text/css" href="docbook-epub.css"/>
- <link rel="stylesheet" type="text/css" href="kawa.css"/>
- <script src="kawa-ebook.js" type="text/javascript"/>
- <meta name="generator" content="DocBook XSL-NS Stylesheets V1.79.1"/>
- <link rel="prev" href="Types.xhtml" title="Types"/>
- <link rel="next" href="Type-tests-and-conversions.xhtml" title="Type tests and conversions"/>
- </head>
- <body>
- <header/>
- <section class="sect1" title="Parameterized Types" epub:type="subchapter" id="Parameterized-Types">
- <div class="titlepage">
- <div>
- <div>
- <h2 class="title" style="clear: both">Parameterized Types</h2>
- </div>
- </div>
- </div>
- <p>Kawa has some basic support for parameterized (generic) types.
- The syntax:
- </p>
- <pre class="screen">Type[Arg1 Arg2 ... ArgN]
- </pre>
- <p>is more-or-less equivalent to Java’s:
- </p>
- <pre class="screen">Type<Arg1, Arg2, ..., ArgN>
- </pre>
- <p>This is a work-in-progress. You can use this syntax with
- fully-qualified class names, and also type aliases:
- </p>
- <pre class="screen">(define v1 ::gnu.lists.FVector[gnu.math.IntNum] [4 5 6])
- (define-alias fv gnu.lists.FVector)
- (define v2 ::fv[integer] [5 6 7])
- (define-alias fvi fv[integer])
- (define v3 ::fvi [6 7 8])
- </pre>
- </section>
- <footer>
- <div class="navfooter">
- <p>
- Up: <a accesskey="u" href="Types.xhtml">Types</a></p>
- <p>
- Previous: <a accesskey="p" href="Standard-Types.xhtml">Standard Types</a></p>
- <p>
- Next: <a accesskey="n" href="Type-tests-and-conversions.xhtml">Type tests and conversions</a></p>
- </div>
- </footer>
- </body>
- </html>
|