This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rough support for parameterized types in Kawa


Parameterized Types works with android kawa. eg. this works.
android.widget.ArrayAdapter[String]
Thanks.

On Thu, Jun 30, 2011 at 6:58 AM, Per Bothner <per@bothner.com> wrote:
>
> I just checked in some support for parameterized types in Kawa.
>
> The syntax is (as discussed before):
> ?Type[Arg1 Arg2 ... ArgN]
> which is more-or-less equivalent to Java's:
> ?Type<Arg1, Arg2, ..., ArgN>
>
> There are a number of limitations and no-doubt bugs:
> - For now Type has to be a native Java class/interface-name
> (like gnu.lists.FVector) and cannot be a Kawa type-alias (like vector).
> - No support for wildcards - I haven't figured those out yet.
> - No way to declare parameterized classes or methods - only usage.
> - No support for parameterized methods - only classes.
> - No doubt other bugs or other things that doesn't work as it should.
>
> However, it's not completely shabby. ?For example Kawa can figure out that
> the return type of this function is java.lang.Integer:
>
> (define (get-from-vector x::gnu.lists.FVector[java.lang.Integer] i::int)
> ?(x i))
>
> Kawa can figure out parameterized types and type-variables of existing
> class and methods (using reflection).
>
> Kawa can also write out "Signature" attributes that let the JVM and compilers
> (including javac) re-create the correct signatures.
>
> This is another step in my nefarious plan to provide better performance
> and compile-time type-checking to Kawa.
> --
> ? ? ? ?--Per Bothner
> per@bothner.com ? http://per.bothner.com/



--
http://about.me/santosh.rajan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]