[mercury-users] Support for C# generics in polymorphic types?

Peter Wang novalazy at gmail.com
Fri Jan 27 10:01:34 AEDT 2012

On Wed, 25 Jan 2012 20:15:56 -0800, Jeff Thompson <jeff at thefirst.org> wrote:
> This requires to convert to and from object and requires extra run time 
> type checking.  Are there any plans for the compiler to use C# generics 
> like the following?

At this stage the C# backend is likely to see improvements only as a
side-effect of improvements to other backends, namely the high-level C

The Java backend does use generics shallowly, but relies on the
backwards compatibility wart of being able to cast Foo<T> to Foo and
back.  I believe C# does not allow this so would require more extensive
changes in the compiler.

mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list