Arc Forumnew | comments | leaders | submitlogin
1 point by dreeves 6166 days ago | link | parent

That's what mathematica does:

(#1 - #2 - #3)&[3,2,1]

with # equivalent to #1.

(By the way, mathematica is all s-expressions (or rather, equivalently, McCarthy's m-expressions) underneath. You can call FullForm on any expression to strip away the syntactic sugar, eg, FullForm[a+b] => Plus[a,b]. Note the f[a,b] instead of (f a b). A nice thing about the commas is that you can throw in infix wherever it's convenient, like If[x>2+2, B, b] instead of If[Greater[x,Plus[2,2]], B, b]. The best lisp solution I've seen for that is curly sweet-expressions: http://www.dwheeler.com/readable/ )