Re: Lisp syntax vs. Mathematica syntax
- From: "josephoswaldgg@xxxxxxxxxxx" <josephoswald@xxxxxxxxx>
- Date: 20 Aug 2005 06:27:39 -0700
Jon Harrop wrote:
> josephoswaldgg@xxxxxxxxxxx wrote:
> > Mathematica takes a TOTALLY different approach to programming
> > abstraction. And I'd hardly consider the resulting dog's breakfast as
> > "no problem."
>
> You can write a term-level interpreter for Mathematica just as you can write
> an interpreter for any other language. You can write programs in
> Mathematica as you would in other languages. It is, after all, evaluated in
> basically the same way.
For sufficiently complicated definitions of "basic", perhaps. The
Mathematica programs will have all sorts of little traps that you might
not find.
My personal "favorite" is Apply, where I had not defined a function
"g". Check out Mathematica's documentation
Apply[Plus, g[a,b]] --> a+b
WTF! Hey, what happened to my function g? And, amazingly enough, at
least some folks at Wolfram think this is what Lisp does, and they'll
start explaining to you about the "head" of an expression....
You can also write a Mathematica-like syntax parser in Lisp. Look up
Fateman's "mma" If you want to.
> Just to clarify, many of the symbols that you've listed are simply infix
> functions. You've also omitted a lot of Mathematica's syntax (which is
> unusually complicated).
And some of those "functions" affect the pattern *transformations* of
the expressions they define. That's not what Lisp folks mean when they
talk about functional programming.
> Mathematica can also be very concise. For example, the following squares
> each element in a list "l":
>
> #^2&/@l
Yes, because Mathematica has the "feature" that it automatically
distributes functions over lists.
What you are doing is not the same as other programming environments.
> The OCaml equivalent is:
....
irrelevant. You seem to be seriously mixing up surface syntax with
evaluation semantics.
Yes, you can write programs in Mathematica very easily in a huge number
of various approaches. But will they come when you call them? Can you
really be sure what they do? That you can avoid name capture? That
things don't depend on the exact structure of the expressions you pass
in? That you really made the right choice between Hold and Unevaluated?
.
- Follow-Ups:
- Re: Lisp syntax vs. Mathematica syntax
- From: Jon Harrop
- Re: Lisp syntax vs. Mathematica syntax
- References:
- Re: Very poor Lisp performance
- From: Förster vom Silberwald
- Re: Very poor Lisp performance
- From: Michael Sullivan
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Hartmann Schaffer
- Re: Very poor Lisp performance
- From: Jamie Border
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Christophe Rhodes
- Re: Very poor Lisp performance
- From: Joe Marshall
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Tayssir John Gabbour
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Joe Marshall
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Ulrich Hobelmann
- Re: Very poor Lisp performance
- From: Jon Harrop
- Lisp syntax vs. Mathematica syntax
- From: josephoswaldgg@xxxxxxxxxxx
- Re: Lisp syntax vs. Mathematica syntax
- From: Jon Harrop
- Re: Very poor Lisp performance
- Prev by Date: Re: Lisp syntax vs. Mathematica syntax
- Next by Date: Re: CLISP and wxcl
- Previous by thread: Re: Lisp syntax vs. Mathematica syntax
- Next by thread: Re: Lisp syntax vs. Mathematica syntax
- Index(es):
Relevant Pages
|