[m-dev.] State variable syntax - last call for opinions
Peter Schachte
schachte at cs.mu.OZ.AU
Thu Jan 31 12:26:17 AEDT 2002
On Wed, Jan 30, 2002 at 05:57:15PM +1100, Ralph Becket wrote:
> Peter Schachte, Wednesday, 30 January 2002:
> > So how about a 4th proposal:
> >
> > !X means the current value of thread X
> > !:X means the next value of thread X
> > !!X means !X, !:X in an atom
>
> Personally I don't find this any more attractive than the other options
> (3 would be my choice.) The drawback is that !!X is going to be the
> common case while !X and !:X will be used only occasionally.
Actually, I deliberately made the operator to be used in goals and
clause heads visually denser to make it stand out more. I'm concerned
that in a goal like
foobar(Something, big_term(1,2,3), Anothervar, !Thread, Output)
the single ! is hard to see, and it would be easy to see that as a
call to foobar/5. I don't even think !! is enough.
Also, a few nitty detail questions. In any clause containing !Foo,
would an unadorned Foo be an error? I think it should. Permitting it
would be not only giving users enough rope to hang themselves, it
would be wrapping it around their necks and tying it to the rafters as
well.
(Using my notation above) is referring to !X before the first !:X an
error? Again, I think it should be.
For a clause without !:X (or !!X) in the head, if the last atom
mentioning X has !:X in it, does this give a singleton warning? I
believe it should, since your binding a variable not used elsewhere in
the clause.
Is it an error to have multiple !:X in the same atom? I think it
probably should be. You could give it a sensible meaning, but I think
it would be too confusing to use.
--
Peter Schachte The greatest dangers to liberty lurk in
schachte at cs.mu.OZ.AU insidious encroachment by men of zeal,
www.cs.mu.oz.au/~schachte/ well-meaning but without understanding.
Phone: +61 3 8344 9166 -- Justice Louis D. Brandeis
--------------------------------------------------------------------------
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