Skip to content

Commit 4f35f50

Browse files
committed
formatting
1 parent 2ee5238 commit 4f35f50

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

content/reference/lisps.adoc

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,33 @@ This information is provided for programmers familiar with Common Lisp or Scheme
1616

1717
* Clojure is case sensitive
1818
* Clojure is a Lisp-1
19-
* () is not the same as nil
19+
* `()` is not the same as nil
2020
* The reader is side-effect free
2121
* Keywords are not Symbols
2222
* 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
3232
* 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
3434
* 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
3737
* 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.
4646
* It helps to distinguish collections/data-structures and seqs/iteration. In both CL and Scheme they are conflated, in Clojure they are separate.
4747
4848
[cols="<*", options="header", role="table"]

0 commit comments

Comments
 (0)