[m-dev.] for review: improvements for record syntax
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Dec 7 02:04:11 AEDT 2000
On 07-Dec-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
>
> Fergus wrote:
> > Richard O'Keefe's guidelines about argument ordering, which are
> > explained in his book The Craft of Prolog, say that collection types
> > such as array should precede indexes. The reason for this is to be
> > consistent with the suggested ordering for in/out mode arguments,
> > namely that in mode arguments should precede out mode arguments.
> > The point here is that you might want to define a mode of `elem'
> > that nondeterministically produces all the elements of the
> > array:
> > ...
>
> This doesn't matter so much if the non-standard ordering
> is not visible in calls to the function.
True, but the non-standard ordering is still visible in the
declaration and definition of the function.
Actually it would be nice to allow record syntax in function
definitions too. For example:
[H|_] ^ head = H.
[_|T] ^ tail = T.
([_|T] ^ head := H) = [H|T].
([H|_] ^ tail := T) = [H|T].
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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