[mercury-users] lisp macros

Michael Day mikeday at bigpond.net.au
Wed May 29 16:18:56 AEST 2002


> One could imagine some sort of Mercury pre-processing library in which
> Mercury pre-processors could be written.  For example, a preprocessor
> compiled for a rule like
> 
> :- macro pred_lambda (test(X) :- Body)
> 	==	(pred(X::in) is semidet :- Body).

Would it be powerful enough to express a parser generator like moose?  
(Which would require reading all the :- rule declarations in a module to
build a number of global tables).

> [I suppose there's no need for a separate pre-processor - this could be
> integrated into the compiler, but if you want to allow some kind of
> processing in producing the expansions then things might get
> trickier...  On the other hand, if pre-processor A produces macros
> expanded by pre-processor B and vice versa, then it isn't clear what the
> policy should be.  Perhaps this sort of thing should be forbidden.]

Ordering of pre-processing steps also needs to be specified, presumably. 
Or it just runs each one and repeats until no further expansions are 
produced?

> I'm not making any claims that this would be a great thing, however.
> I'm undecided.  Part of me is thinking that light-weight higher-order
> syntax and support for monadic style would go a long way.

Light weight higher order syntax would certainly be nice if it's possible.

Michael

--------------------------------------------------------------------------
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