[m-dev.] for review: record syntax [2]
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Jan 24 13:09:08 AEDT 2000
On 24-Jan-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> >
> > On 04-Jan-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > > +++ reference_manual.texi 2000/01/04 05:27:34
> > ...
> > > + at item @var{Term} := ^ @var{Field1} ^ ... ^ @var{FieldN}
> > > +Unifies @var{Term} with the field of the implicit DCG argument
> > > +labelled by @var{Field}.
> > > + at var{Term} must be a valid data-term.
> > > + at var{Field1} @dots{} @var{FieldN} must be valid field names.
> > > + at xref{Record syntax}.
> >
> > What's the rationale for using the symbol `:=' here?
> > Normally `:=' is used for destructive assignment.
> > But there is nothing in this construct that resembles
> > destructive assignment. I think it would be much
> > better to use some other symbol.
> > For example, instead of using `:= ^', we could use (a) `=^'
> > or (b) `= ^'.
> >
> > Another alternative would be (c) to use a reserved symbol,
> > e.g. `THIS', to indicate the implicit DCG argument.
> >
> > Of these, I think I prefer alternative (b).
>
> I find it slightly clearer to use an asymmetric symbol --
> with alternative (b) should `^ field1 = Value' be allowed?
>
> I think it might be a bit confusing to use the unification symbol
> because with unification you might expect to be able to replace
> `X = ^ field1, { Y = functor(Field1) }' with `{ Y = functor(^ field1) }'.
>
> I prefer alternative (a).
OK, you've convinced me.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- 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