Next: , Previous: , Up: Types   [Contents][Index]

18.2 Parameterized Types

Kawa has some basic support for parameterized (generic) types. The syntax:

Type[Arg1 Arg2 ... ArgN]

is more-or-less equivalent to Java’s:

Type<Arg1, Arg2, ..., ArgN>

This is a work-in-progress. You can use this syntax with fully-qualified class names, and also type aliases:

(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])