[m-dev.] pragma to affect type representation?

Peter Wang novalazy at gmail.com
Tue Aug 24 12:41:08 AEST 2010


The use of generics in the Java classes for Mercury types makes some
hand-written code very verbose, largely because Java does not support
type aliases.  It would be nice to tell the compiler not to use generics
in the class definitions for some types, for which you would trade off
manual type casts in places.  We could have a pragma like:

    :- pragma type_representation(foo/3, [java_no_generics]).

or maybe target-language specific:

    :- pragma type_representation("Java", foo/3, [no_generics]).

I'm assuming the pragma might be useful for other attributes in the
future.  Pragmas would need to follow type definitions into interface files.

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



More information about the developers mailing list