Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Surprise, Macsyma, which is written in Lisp has that syntax. Macsyma is the earlier computer algebra system, which Kent Pitman mentioned in that post. He also mentions that Wolfram knew Macsyma.

Example:

    applysymmetry(exp,opdum,symtype):=block(
      [getdum:get(opdum,symtype),piece,inflag:true,partswitch:true],
      if getdum=false then return(exp),
      subst(lambda([[arglist]],
                   apply('aplsym1,append(getdum,[arglist,opdum]))),
            opdum,exp))$

If you know Lisp, you will recognize typical constructs like IF, RETURN, SUBST, LAMBDA, APPLY, APPEND, ...


And this is an entirely normal usage of lisp: define a domain specific language (DSL) on top of the lisp, to manipulate the natural objects of the domain in a natural way.

I've always thought Mathematica would have been a better system build on top of a "real" lisp, and would have got there faster. I've never heard any of Wolframs statements about the parallels that have made me question that, but I could be missing something.


This still seems more limited than the Mathematica syntax, which includes postfix operators, for example. I also appreciate that parentheses are used only for grouping, not for function calling and such. I'm not saying this couldn't have been done with Macsyma or on top of Lisp more generally (indeed, that would be nice), or that Mathematica wasn't influenced by Macsyma; I'm saying that purely for syntax, I think Mathematica ended up with a better, more extensive, and easier-to-use system than pretty much any other language.


Macsyma also has postfix operators.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: