[mercury-users] constructor class syntax
Michael Day
mikeday at corplink.com.au
Wed Nov 3 17:28:47 AEDT 1999
> At this point NU-Prolog compatibility is not very important now, so I
> guess you could put that one down to "hysterical raisons". We could
> change the language definition to allow `=' instead of `==' in `type'
> definitions, I suppose.
It would be nice. Always better to change today rather than tomorrow.
> I think we will probably end up using `:' for field names.
> Simon Taylor's current implementation is using `::', but
> I think the main reason for that is that `:', which was
> Zoltan's original choice, didn't work because it clashed
> with the use of `:' as module qualifier.
> But I think in the long run we will use `.' as module
> qualifier and `:' as type qualifier, including the `<field_name> : <type>'
> syntax in records.
Ahh yes that would be much better.
> So either the compiler needs to recognize and allow that (ugh),
> or the user needs to use explicit parentheses every time (not
> very nice either). That's why we chose to use a different
> operator. We chose `::' because `:: <mode>' was already
> used in combined pred/mode declarations, e.g.
Oh I forgot that use of :: as I rarely write combined declarations. Sounds
like a good justification, and using :: for a namespace qualifier in C++
always felt quite unwieldy.
Thanks for the clarification, I can probably put my syntactical carping to
sleep again for the moment :)
Michael
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list