[m-dev.] class syntax (brief note)

Michael Day mikeday at corplink.com.au
Tue Nov 2 21:09:31 AEDT 1999


Something I forgot to mention, is that it's unfortunate really that all
declarations have to start with :-, as it feels like it could be used
quite naturally in several circumstances. For instance:

:- typeclass stringable(T) :-
	[
		func to_string(T) = string
	].

okay so that uses :- twice, but ignoring the first one it seems to read
fairly well... "T satisfies stringable *if* it has this list of methods".
Ah well. There is no doubt an obvious semantic reason for not doing things
this way that I haven't considered, but to me at least it doesn't seem any
worse than using "where".

(repeat above diatribe regarding :- instance in a similar manner :)

Michael



--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list