Lisp syntax vs. Mathematica syntax




Jon Harrop wrote:
> Ulrich Hobelmann wrote:
> > Jon Harrop wrote:
> >> Joe Marshall wrote:
> >>> Infix macros are *hard*.
> >>
> >> Do you mean it is difficult to implement infix in Lisp?
> >
> > No, others mentioned that *there are* infix parsers (reader macros) for
> > Lisp. Most people don't use them I guess :D
>
> Then why are they "hard"? Perhaps I misunderstood Joe. I thought he meant it
> was difficult to implement infix operators in Lisp. Now I'm thinking maybe
> he meant it is easy to implement infix operators but it is then difficult
> to write macros that use infix syntax?
>
> Presumably that is a Lisp-specific problem because Mathematica has no
> problem using infix notation...

Mathematica takes a TOTALLY different approach to programming
abstraction. And I'd hardly consider the resulting dog's breakfast as
"no problem."

Look how much punctuation Mathematica introduces to keep "infix"
notation going.

// to use postfix notation
~ f ~ to use prefix functions as infix
double square brackets for indexing
/@ and //@
^=
:=
^:=
/: with = (TagSet)
/: with := (TagSetDelayed)
single, double, triple underscore prefixes and suffixes
-> vs. :>
Hold, HoldForm, Literal, Unevaluated
_h
x_h
x_:v
x_h:v
x:pattern
pattern ? test
pattern1 | pattern2 | pattern3 ...
pattern /; condition

one could go on and on. I haven't even mentioned Mathematica's notation
for anonymous functions yet. None of this punctuation is used in
conventional mathematics.

Blech.

.



Relevant Pages

  • Re: merits of Lisp vs Python
    ... So chemists will use an infix package, ... As already said any infix Lisp ... boy/girl and confront him/her his/her life with mostly prefix syntax. ... people does in math, science, enginnering, almost any programming ...
    (comp.lang.lisp)
  • Re: Very poor Lisp performance
    ... > Do you mean it is difficult to implement infix in Lisp? ... I mean that designing a *good* macro system for an infix language is ... >> operates on code needs to operate at the abstract syntax level, ...
    (comp.lang.lisp)
  • Re: Any macro for inserting math "normally"
    ... Greater general familiary with infix than with prefix ... whereas using LISP for math during his entire ... number of parentheses. ... Because expressions are complicated; finding them requires ...
    (comp.lang.lisp)
  • Re: Any macro for inserting math "normally"
    ... I'm not really concerned with whether Lisp is popular. ... algebraic/infix notation has as its key feature "brevity" ... obviously right that infix notation is best for all needs. ... the strategy seems to be for the large community to ...
    (comp.lang.lisp)
  • Re: Very poor Lisp performance
    ... >>> Do you mean it is difficult to implement infix in Lisp? ... > to write macros that use infix syntax? ... your language is infix it's harder to write macros because the macros ...
    (comp.lang.lisp)