You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/reference/lisps.adoc
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -16,33 +16,33 @@ This information is provided for programmers familiar with Common Lisp or Scheme
16
16
17
17
* Clojure is case sensitive
18
18
* Clojure is a Lisp-1
19
-
* () is not the same as nil
19
+
* `()` is not the same as nil
20
20
* The reader is side-effect free
21
21
* Keywords are not Symbols
22
22
* Symbols are not storage locations (see Var)
23
-
* _**nil**_ is not a Symbol
24
-
* t is not syntax, use _**true**_
25
-
* The read table is currently not accessible to user programs
26
-
* _**let**_ binds sequentially
27
-
* _**do**_ is not a looping construct
28
-
* There is no tail-call optimization, use _**recur**_.
29
-
* syntax-quote does symbol resolution, so `x is not the same as 'x.
30
-
* ` has auto-gensyms.
31
-
* ~ is unquote ',' is whitespace
23
+
* `nil` is not a Symbol
24
+
* `t` is not syntax, use `true`
25
+
* The read table is not accessible to user programs
26
+
* `let` binds sequentially
27
+
* `do` is not a looping construct
28
+
* There is no tail-call optimization, use `recur`.
29
+
* syntax-quote does symbol resolution, so `pass:[`x]` is not the same as `'x`.
30
+
* `pass:[`]` has auto-gensyms.
31
+
* `~` is unquote `,` is whitespace
32
32
* There is reader syntax for maps, vectors, and sets
33
-
* _**cons**_, _**first**_ and _**rest**_ manipulate sequence abstractions, not concrete cons cells
33
+
* `cons`, `first` and `rest` manipulate sequence abstractions, not concrete cons cells
34
34
* Most data structures are immutable
35
-
* lambda is _**fn**_, and supports overloading by arity
36
-
* _**pass:[=]**_ is the equality predicate
35
+
* lambda is `fn`, and supports overloading by arity
36
+
* `pass:[=]` is the equality predicate
37
37
* Global Vars can be dynamically rebound (if declared dynamic) without interfering with lexical local bindings. No special declarations are necessary to distinguish between dynamic and lexical bindings. Since Clojure is a Lisp-1, (global) functions can be dynamically rebound (if they are marked as dynamic).
38
-
* No letrec, labels or flet - use (fn name [args]...) for self-reference, https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/letfn[letfn] for mutual reference.
39
-
* In Clojure _**nil**_ means 'nothing'. It signifies the absence of a value, of any type, and is not specific to lists or sequences.
40
-
* Empty collections are distinct from _**nil**_. Clojure does not equate _**nil**_ and '().
41
-
* _**false**_ means one of the two possible boolean values, the other being _**true**_
42
-
* There is more to collections than lists. You can have instances of empty collections, some of which have literal support ([], {}, and ()). Thus there can be no sentinel empty collection value.
43
-
* Coming from Scheme, _**nil**_ may map most closely to your notion of #f.
44
-
* A big difference in Clojure, is sequences. Sequences are not specific collections, esp. they are not necessarily concrete lists. When you ask an empty collection for a sequence of its elements (by calling *seq*) it returns _**nil**_, saying "I can't produce one". When you ask a sequence on its last element for the _**rest**_ it returns _**another logical sequence.**_ You can only tell if that sequence is empty by calling *seq* on it in turn. This enables sequences and the sequence protocol to be _lazy_.
45
-
* Some of the sequence functions correspond to functions from Scheme and CL that there manipulated only pairs/conses ('lists') and returned sentinel values ('() and nil) that represented 'empty' lists. The Clojure return values differ in not returning specific empty collections, but rather another logical sequence. Some of the sequence functions have no counterpart in Scheme/CL, and map to Haskell/ML-like functions. Some of those functions return infinite or calculated sequences, where the analogy to concrete data-structures like Scheme/CL lists is tenuous at best.
38
+
* No `letrec`, `labels` or `flet` - use `(fn name [args]...)` for self-reference, https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/letfn[letfn] for mutual reference.
39
+
* In Clojure `nil` means 'nothing'. It signifies the absence of a value, of any type, and is not specific to lists or sequences.
40
+
* Empty collections are distinct from `nil`. Clojure does not equate `nil` and `'()`.
41
+
* `false` means one of the two possible boolean values, the other being `true`
42
+
* There is more to collections than lists. You can have instances of empty collections, some of which have literal support (`[]`, `{}`, and `()`). Thus there can be no sentinel empty collection value.
43
+
* Coming from Scheme, `nil` may map most closely to your notion of `#f`.
44
+
* A big difference in Clojure, is sequences. Sequences are not specific collections, esp. they are not necessarily concrete lists. When you ask an empty collection for a sequence of its elements (by calling `seq`) it returns `nil`, saying "I can't produce one". When you ask a sequence on its last element for the `rest` it returns _**another logical sequence**_. You can only tell if that sequence is empty by calling `seq` on it in turn. This enables sequences and the sequence protocol to be _lazy_.
45
+
* Some of the sequence functions correspond to functions from Scheme and CL that there manipulated only pairs/conses ('lists') and returned sentinel values (`'()` and `nil`) that represented 'empty' lists. The Clojure return values differ in not returning specific empty collections, but rather another logical sequence. Some of the sequence functions have no counterpart in Scheme/CL, and map to Haskell/ML-like functions. Some of those functions return infinite or calculated sequences, where the analogy to concrete data-structures like Scheme/CL lists is tenuous at best.
46
46
* It helps to distinguish collections/data-structures and seqs/iteration. In both CL and Scheme they are conflated, in Clojure they are separate.
0 commit comments