Re: Lisp's QUOTE and Mathematica's "Hold"



Jon Harrop <usenet@xxxxxxxxxxxxxx> writes:

> Richard Fateman wrote:

>> Mathematica doesn't need or use macros, and neither does a computer
>> algebra system written in Lisp, simulating Mathematica.
>
> Not macros, functions mapping ASTs to ASTs. They are the core of
> Mathematica and a language that provided this functionality clearly
> and efficiently would be of great use in this kind of work.

Then you should check out Lisp. Macros are interesting in this context
insofar as they are an *example* of a part of Lisp that depends on the
ability to write code in Lisp that does AST->AST transformations.[1]

But ultimately macros are for producing Lisp code. If you just want
to manipulate arbitrary ASTs and/or if you ultimately want to produce
some other form of output (such as code in another language or machine
code or typeset math) then these Lisp features are what you should be
looking at:

- The built-in symbol data type and packages.

- The reader.

- The printer.

- DESTRUCTURING-BIND.

- The many built-in functions for manipulating trees built out of
cons cells.

and ... wait for it ...

- QUOTE.

-Peter

--
Peter Seibel * peter@xxxxxxxxxxxxxxx
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
.



Relevant Pages

  • Re: something to chat about, lisp and Mathematica for list processing.
    ... If Lisp macros count then Mathematica replacement rules should count. ... kind of a read-applyrules-print loop. ...
    (sci.math.symbolic)
  • Re: New book about Common Lisp: Let Over Lambda
    ... I have read every lisp book I've been able to get my hands on ... Lisp macros are not given nearly enough ... I personally consider Let Over Lambda to be an unofficial sequel ... integral parts of the language. ...
    (comp.lang.lisp)
  • Re: Lisps QUOTE and Mathematicas "Hold"
    ... > mathematica does, and therefore that is how lisp does ... I was not trying to infer how Lisp evaluates ... So macros are the only remaining point of interest. ... functions mapping ASTs to ASTs. ...
    (comp.lang.lisp)
  • Re: LISPPA
    ... > which describes the unification algorithm in Scheme. ... But let's get back to why I think lisp is superior ... optimization macros or reader ... cases where a running program cannot continue running, ...
    (comp.lang.lisp)
  • Re: Macro functionality at runtime?
    ... we don't know what the subtree is yet. ... "Returns a list of tokens matched to subtree. ... > be optimized out by the lisp compiler. ... >> If we have first class macros, ...
    (comp.lang.lisp)