In this wonderful tutorial "Write Yourself a Scheme in 48 Hours", this line puzzles me for a while:
apply :: String -> [LispVal] -> LispVal
apply func args = maybe (Bool False) ($ args) $ lookup func primitives
What does ($ args)
really mean? Turns out it is called operator section, a special syntax which LYSH fails to mention. This thread did a great job on explaining it:
http://www.haskell.org/pipermail/beginners/2009-January/000776.html
And the definition of it is here:
http://www.haskell.org/onlinereport/exps.html#sections
and here:
http://www.haskell.org/haskellwiki/Section_of_an_infix_operator
Also be careful that -
operator cannot do a right section, use Prelude subtract
instead.