3 ms·
I am sure this has been discussed to death somewhere else (point me there?) but what is the advantage of adding [ ] for defining arguments to a proc/lambda? I a
by shaunxcode 18y ago
I am sure this has been discussed to death somewhere else (point me there?) but what is the advantage of adding [ ] for defining arguments to a proc/lambda? I assume it is to help it stand out a little more? What I love about lisp/scheme is the symmetry and simplicity in syntax - though it does clearly state in the scheme spec that [ ] are reserved for future language revisions.
- jefffoster 18y agoClojure extends the syntax of Lisp to include first class support for data structures other than lists (vectors, sets and maps). Vectors are the [ ] structure you see. You can use ( ) to specify a number of function bodies which differ on arity e.g: (defn foo ([x] x) ([+ x y]) So it's not to stand out more, rather it's extending the Lisp syntax to make items other than lists "first-class" whilst retaining the homoiconic properties of Lisp.