Re:Introducing Spider 0.1
by sebastianconcpt on Friday November 28, 2014 @03:41PM
(#8672090)
If you want we remove the Haskell reference as invalid example, be my guest. The idea that I'm bringing in is not any less true because of that.
Why isn't a list an expression?
Re:Introducing Spider 0.1
by sebastianconcpt on Friday November 28, 2014 @03:03PM
(#8672000)
Yes, in LISP everything is an expression
The case in Haskell is obvious: 2, "foo", (Data.Set.singleton 3); none of these are functions. Functional programming isn't about "everything is a function", it's about (among other things) making functions first-class, and using higher-order functions to build powerful abstractions. (There are also a lot of other things associated with FP, incl. but not limited to: immutability, purity, powerful static type systems, focus on "plain old data" over OO hierarchies, laziness, etc). If you want a language in which everything is a function, you want the untyped lambda calculus.
The case in Lisp is a little less obvious; I've been meaning to write a blog post about this. But consider:
Is `((x 0))` an expression? No. It's a list of binding-pairs.