[haXe] function name<T>():Void;
Marcus Bergstrom
marcus at quickform.net
Mon Jan 22 18:00:29 CET 2007
Thanks, one more thingy...
What about this one then? (which doesn't restrict the return)
static function getSuperClass<T>(c : Class<T>) : Class<Dynamic>
Marcus.
On Jan 22, 2007, at 5:49 PM, Nicolas Cannasse wrote:
>>
>> You need to explain something to me. I understand Class parameters
>> (class Array<T>) and stuff, but I am not quite clear on how it
>> works for
>> methods. If we take the Type class as an example, it has no Class
>> parameters, but you can find several of these:
>>
>> static function createInstance<T>(cl : Class<T>, args :
>> Array<Dynamic>) : T
>>
>> What does the "T" in createInstance<T> actually do.
>> What is the difference between that and class parameters.
>> Can someone please clarify this?
>
> It means that the function works for every T, but that the return type
> is bounded to the argument type. This is a more strictly typed form
> compared to :
>
> createInstance(cl : Class<Dynamic>, args : Array<Dynamic>) : Dynamic
>
> Since in the later case, both "Dynamic" are independant.
>
> Nicolas
>
> --
> haXe - an open source web programming language
> http://haxe.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20070122/38f26379/attachment.htm
More information about the Haxe
mailing list