Re: [Vala] Hi All. Question about Generics?



Wow! I'm an idiot. I just found the documentation for this in the Vala
Tutorial. I don't know how I missed it the first time I read it.

Please ignore my rather silly question.

Thanks.

On Wed, 2010-02-10 at 23:44 -0500, Gerald Edward Butler wrote:

Hello All,

New to Vala. Looks interesting. Is there any documentation or
discussion (mailing list logs, etc) that detail the how generics are
implemented in Vala? In particular, how do you handle the issue of
multiple template instantiation that many early C++ compilers had?

That is, if I create a template/generic class such as:

public class MyFoo : Foo<T> {

    ...
}

And I instantiate an instance of it:

var my_foo_tv = new MyFoo( Television );

And I do the same instantiation later in another module?

Is the generics implementation entirely run-time based? Or, does it
compile a class specific for the type much like C++? If like C++, how
does it handle definition of the same template instance in multiple
modules? How does it resolve the linkage across compiled modules?

Thanks in advance,

Gerald E Butler
gerald edward butler gmail com   

http://goldmark.org/jeff/stupid-disclaimers/



Gerald E Butler
gerald edward butler gmail com   

http://goldmark.org/jeff/stupid-disclaimers/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]