[mercury-users] Proposed change to char literal syntax

Michael Day mikeday at yeslogic.com
Thu Oct 5 13:58:04 AEST 2006


Hi Nicholas,

> ' ' is a horrible name for anything.  See Ralph's message.

While I definitely agree that ' ' is a horrible name for *anything*, it 
does seem like a reasonable name for a space character :)

>> If integer literals were customisable as well then Mercury could 
>> support BigInteger literals and other number types transparently. 
>> Defining the semantics of literal values in the library seems more 
>> elegant than hard-wiring them.
> 
> I disagree.

May I ask why? I understand that this particular char case may be 
sub-optimal, but in general, doesn't Mercury tend to define things in 
the standard library which other languages might hardwire?

As it stands, foo(13) will compile if the int module is not imported, 
but if X > 13 will not, as > is just a regular function defined in the 
int module, as it should be.

Incidentally, note that I'm not even suggesting user-configurable syntax 
(like the :- op proposal), as literal syntax would still be statically 
defined by the language. But the semantics of how a literal should be 
processed would be nice to override. (Why should only one string module 
lay claim to the string literal syntax?)

Cheers,

Michael

-- 
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
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