[m-rev.] trivial diff: fix promise_semipure

Tyson Dowd trd at cs.mu.OZ.AU
Fri May 3 19:40:51 AEST 2002


On 03-May-2002, David Jeffery <dgj at missioncriticalit.com> wrote:
> > IMHO this bug shows why we should allow some kind of useable syntax that
> > allows you to do pattern matching without deconstruction and
> > reconstruction.  If you only have to type a name once, you only have to
> > get it right once.
> 
> That's such a good idea that (IIRC) Simon implemented it last year. ;-)
> See 'Unification Expressions' in the reference manual.
> 
> Unification expressions are represented by '@'.
> 
> e.g. rather than
> 
> p(promise_semipure(A, B), promise_semipure(A, B)).
> 
> you can write:
> 
> p(X  @ promise_semipure(_, _), X).
> 
> ...which is what you were looking for, I think.

Ah yeah I knew it was being worked on but didn't know it had made it in. 
I mean I'd seen it on the web site and all, but forgotten to try it out.

Is there any reason why we can't use them or is simply a matter of
having to update the code?

I change my comment then:

I now argue we should change our coding standards to make this the
standard syntax we use in the compiler in new code and significant
updates to the existing code (that is, that reviewers should point out
opportunities to use this feature).

(I just checked that this hasn't already happened -- I can only find a very
small number of uses of this in the compiler).

Tyson.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list