[mercury-users] Re: lisp macros

Milan Zamazal pdm at zamazal.org
Thu Jun 6 19:22:14 AEST 2002


>>>>> "RB" == Ralph Becket <rafe at cs.mu.OZ.AU> writes:

    RB> I prefer infix notation.  It often allows for more concise code.

I think this belongs to the area of personal preference.  I don't
believe your argument about more concise code, but that doesn't matter,
there's no real problem with it.

    RB> Things that could do with improvement/adding (roughly in order):

[...]

I guess at least some of them could be done easily with an extensible
syntax.

    RB> I would have thought a Lisp -> Prolog syntax translation would
    RB> be trivial.

Maybe, but the main problem is not the translation itself (especially
thanks to availability of macros!), the problem consists primarily of
practical matters like:

- Another fellow Mercury developer should be able to use the source
  code.

- Good source <-> compiler interaction, e.g. getting compiler messages
  in the source syntax.

- How the Mercury-In-Lisp syntax should look so that it's a real
  improvement, not counting the macro availability.

    RB> I believe the reason Lisp's macro facility has had such success
    RB> is that to a first order approximation Lisp has no syntax to
    RB> speak of.

Sure.

    RB> If we are to preserve a more structured syntax then the macro
    RB> facility would be correspondingly more complex, unless you want
    RB> to write these things at the level of raw term to term
    RB> transformations.

Unfortunately you're probably right.

Well, we Lisp lovers shouldn't complain about Mercury syntax when we can
use Lisp to solve our problems in the straightest way.  I tried to
rewrite the sort.m file from Mercury examples to a Lisp syntax, see the
following mail.

Milan Zamazal

-- 
"Having GNU Emacs is like having a dragon's cave of treasures."
                                                Robert J. Chassell
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list