3 ms·
A list can be defined using square-brackets, '[' and ']'. I thought it was funny to do this in Lisp and not represent lists with parens, but I guess it's only
by evanrmurphy 17y ago
A list can be defined using square-brackets, '[' and ']'.
I thought it was funny to do this in Lisp and not represent lists with parens, but I guess it's only syntatic sugar anyway.
- mike_organon 17y agoA list is represented with parens. [] is a vector. There are behavior and performance differences between lists and vectors.
- evanrmurphy 17y agoI don't quite follow, but I'm also new to mini-Kanren. They're called lists in the article and said "to group values or variables so that the collection may referred to as a unit", which sounds like a generic list to me. He compares them to Lisp lists just a couple paragraphs lower. Could you elaborate please?
- chousuke 17y agoMost likely it's a "list" in the DSL, but implemented using Clojure's vectors, which are represented with square brackets and have convenient evaluation semantics (items are evaluated, but it's not a function call), so that it's much more common to use vectors in clojure where one would often type (list foo bar) in CL or perhaps Scheme. Often vectors are used in Clojure DSLs to differentiate from the "operator syntax" which uses actual lists. There are some exceptions in even clojure.core macros, but often you can assume that any unquoted list is evaluated as a function or macro call, even if it is a macro parameter.