Re: something to chat about, lisp and Mathematica for list processing.



On Jun 18, 9:49 am, Jon Harrop <j...@xxxxxxxxxxxxxxxxx> wrote:
All good points but...

rjf wrote:
Manipulating Mathematica programs is presumably possible, but I do not
know of anyone doing so.

If Lisp macros count then Mathematica replacement rules should count. These
are ubiquitous, of course.

--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientistshttp://www.ffconsultancy.com/products/ocaml_for_scientists/?usenet

No, I don't see that mathematica rules are similar to macros in lisp.
Mathematica rules are part of a rewriting system at the center of
mathematica, kind of a read-applyrules-print loop. In lisp there is
a read-eval-print loop.
The eval step sometimes requires "expand macros, then eval".

A macro system as usually used in Lisp is via a function that defines
functions. A macro system for mathematica would, I suppose, enable a
programmer to do something like produce and install in the system a
whole bunch of distinct rules by using a single rule repeatedly with
different arguments.

I agree that mathematica rules are ubiquitous. they are usually
confused by the casual user with programs, e.g. f[x_]:=x+1 seems to
act like (defun f(x)(+ x 1)) in lisp. But the mathematica notion
is rather different in general. but this specific example works almost
the same.

A rule-driven system written in Lisp is easy to define, and is done in
any number of books on Lisp, e.g. where prolog is defined in Lisp.

Macros are, however, something else. And they are not like rules in
mathematica.

RJF

.



Relevant Pages

  • Re: Lisp and Scheme with fewer parentheses / Mathematica??
    ... Any dummy, at our level, knew that Mathematica and lisp have different ... programer, even with say 10 years of programing experience, chances ... functional language and one of the oldest 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: Very poor Lisp performance
    ... >> are similar in power to Lisp's macros. ... >> have to learn something about Common Lisp macros. ... > So given that you can programmatically manipulate Mathematica symbolic ... > it from evaluating in the future. ...
    (comp.lang.lisp)
  • Re: Lisps QUOTE and Mathematicas "Hold"
    ... >> algebra system written in Lisp, simulating Mathematica. ... > Not macros, functions mapping ASTs to ASTs. ... Then you should check out Lisp. ...
    (comp.lang.lisp)
  • Re: Lisp syntax vs. Mathematica syntax
    ... Let's trying writing a Lisp macro equivalent to Mathematica's Apply. ... In Mathematica, ... That's not what Lisp folks mean when they ... > What you are doing is not the same as other programming environments. ...
    (comp.lang.lisp)