Re: something to chat about, lisp and Mathematica for list processing.
- From: rjf <fateman@xxxxxxxxx>
- Date: Sun, 24 Jun 2007 15:16:50 -0000
On Jun 23, 6:05 pm, Jon Harrop <j...@xxxxxxxxxxxxxxxxx> wrote:
rjf wrote:
I found that searching with google on mathematica macro got
557,000 hits...
Thinking about it some more, this is never going to work reliably because
macro is a homonym even in this specific context (e.g. C macro, Lisp macro
and OCaml macro all mean significantly different things).
I apologize to other readers for taking Jon's troll too seriously.
My objection was primarily to your statement that Lisp manipulates ASTs
whereas Mathematica manipulates text. I still don't think that statement
had any merit, although perhaps you were referring to Lisp's unconventional
lack of pretty printing and parsing of ASTs?
If so, you can rewrite programs using only FullForm in Mathematica, of
course...
--
Dr Jon D Harrop, Flying Frog Consultancy
The OCaml Journalhttp://www.ffconsultancy.com/products/ocaml_journal/?usenet
Sorry, again, Jon, (and readers too). I never said "Mathematica
manipulates text".
I said " In Mma, programs are viewed as fixed entities defined
solely by
explicit text (or notebooks) in files. "
In the most common situation, Mathematica's represents programs, once
they are read in from text files, as trees.
So does Lisp. Mathematica trees are built up of nodes of various
sizes, each of which is an array, mostly populated with pointers to
other arrays, symbols, constants. Lisp trees are built up of nodes of
fixed size, and atoms.
The fact is that Lisp macros are important tools for intermediate and
advanced Lisp programmers who use macros to facilitate the alteration
of the programs qua trees into other programs. It is used, for
example, to aid in abstraction, information hiding, building or
extending languages on top of Lisp, and other purposes, some not so
great (e.g. premature optimizations). I have not seen this done in
Mathematica. I can imagine people trying to do such things, by
defining programs by f[x_]= .... rather than f[x_]:= ..... But I
have not seen this. And even if it were done, it would not mean rules
are like macros.
You say
" although perhaps you were referring to Lisp's unconventional
lack of pretty printing and parsing of ASTs?"
I think you meant Lisp->Mathematica in that statement.
I have found Mathematica's on-line reformatting of program texts to
be less readable than my own formatting, which is too bad. In Lisp I
can depend on Lisp (or emacs) to reveal certain kinds of errors by
noticing anomalies in the automatic indentation. It seems to me that
Mathematica's support for the programmer, including debugging, has
been unsatisfactory for a long time. Rules make this hard, I suspect.
There is no reason to believe that a good "prettyprinter" cannot be
created for Mathematica. Maybe there is one already. It would not be
difficult to write one in Lisp, where there are packages to help do
this. The language is still overly complex both syntactically and
semantically, regardless of its formatting.
.
- Follow-Ups:
- References:
- something to chat about, lisp and Mathematica for list processing.
- From: Nasser Abbasi
- Re: something to chat about, lisp and Mathematica for list processing.
- From: rjf
- Re: something to chat about, lisp and Mathematica for list processing.
- From: Jon Harrop
- Re: something to chat about, lisp and Mathematica for list processing.
- From: rjf
- Re: something to chat about, lisp and Mathematica for list processing.
- From: Jon Harrop
- Re: something to chat about, lisp and Mathematica for list processing.
- From: rjf
- Re: something to chat about, lisp and Mathematica for list processing.
- From: Jon Harrop
- Re: something to chat about, lisp and Mathematica for list processing.
- From: rjf
- Re: something to chat about, lisp and Mathematica for list processing.
- From: Jon Harrop
- Re: something to chat about, lisp and Mathematica for list processing.
- From: rjf
- Re: something to chat about, lisp and Mathematica for list processing.
- From: Jon Harrop
- Re: something to chat about, lisp and Mathematica for list processing.
- From: rjf
- Re: something to chat about, lisp and Mathematica for list processing.
- From: Jon Harrop
- something to chat about, lisp and Mathematica for list processing.
- Prev by Date: an example in Boros & Moll [Re: Yet another ...]
- Next by Date: Riddle me a number
- Previous by thread: Re: something to chat about, lisp and Mathematica for list processing.
- Next by thread: Re: something to chat about, lisp and Mathematica for list processing.
- Index(es):
Relevant Pages
|
|