Re: Lisp syntax vs. Mathematica syntax
- From: "josephoswaldgg@xxxxxxxxxxx" <josephoswald@xxxxxxxxx>
- Date: 20 Aug 2005 09:13:44 -0700
Jon Harrop wrote:
> josephoswaldgg@xxxxxxxxxxx wrote:
> > 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,
>
> Let's trying writing a Lisp macro equivalent to Mathematica's Apply.
You miss the point entirely. A wolf in sheep's clothing doesn't eat
grass.
Lisp has apply already, it is an ordinary function, and it takes as
arguments a function and a list (in the simplest case), and returns the
result of the function taking each element of the list as an argument.
It's extremely useful, and basic to the Lisp philosophy.
Mathematica has an "Apply" that specifies transformation rules that
take a symbol and an expression-tree and do surgery on the expression
tree to stick the symbol in. That ain't function application in my
dictionary. I'm guessing it doesn't get used much in Mathematica
applications, but was stuck in because someone had a fuzzy memory of
Lisp or Scheme, and thought it might be nice to have.
You seem not to distinguish between "functions" and "symbols
Mathematica uses to name functions, but also have various attributes
which determine their pattern-matching semantics." That is symptomatic
of your confusion between ordinary programming semantics,
pattern-matching, and Lisp macro manipulations. Until you learn to keep
them distinct, comparing Lisp, OCaml, and Mathematica will be very
confusing.
I've used Mathematica for a reasonable amount of work as well, but
"getting work done" in Mathematica is very different from "programming"
in Lisp. It has a totally different design philosophy.
.
- Follow-Ups:
- Re: Lisp syntax vs. Mathematica syntax
- From: Jon Harrop
- Re: Lisp syntax vs. Mathematica syntax
- References:
- 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: 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/Unix impedance [a programming challenge]
- Next by Date: Re: Very poor Lisp performance / about Mathematica
- Previous by thread: Re: Lisp syntax vs. Mathematica syntax
- Next by thread: Re: Lisp syntax vs. Mathematica syntax
- Index(es):
Relevant Pages
|