[mercury-users] Proposed change to char literal syntax
Michael Day
mikeday at yeslogic.com
Thu Oct 5 11:33:00 AEST 2006
Hi Ralph,
> I agree. In my experience, I usually start off thinking of using tricks
> like this (although nothing as adventurous as this example), but
> inevitably end up using longer, more meaningful names, such as
> unicode_space. It makes things much less confusing and error prone in
> the long run; the extra typing is more than compensated for by the
> reduced debugging effort.
Well, I see it as similar to the way in which the standard library has a
bunch of different functions all called init: one returns a map, one
returns a bimap, one returns a bag... and yet if you use the wrong one,
the compiler will let you know.
More specifically, I was trying to point out that if character literals
were actually just function calls, then there would not need to be any
special new syntax, as 'a' would still just be a quoted one letter
symbol, that would resolve to :- func char.a = char assuming that you
had imported the char module.
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