summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-03-14 06:53:16 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-03-14 06:53:16 -0700
commit96f072cfdb5d1eac3e32dbdb15704b0a32258a37 (patch)
treeb25990f165c0485db4f990a4e721191b4b8380d5 /txr.1
parent7f0f22c4e455f457d37ddf542b36c49db20d16af (diff)
downloadtxr-96f072cfdb5d1eac3e32dbdb15704b0a32258a37.tar.gz
txr-96f072cfdb5d1eac3e32dbdb15704b0a32258a37.tar.bz2
txr-96f072cfdb5d1eac3e32dbdb15704b0a32258a37.zip
Implementing #H((...) ...) read/print syntax for hash tables.
* hash.c (print_key_val, hash_print_op): New static functions. (hash_ops): hash_print_op wired in in place of cobj_print_op. * parser.l (HASH_H): New token recognized. * parser.y (HASH_H): New terminal symbol. (hash): New nonterminal symbol. (expr): Acquires hash as a constituent. (hash_from_notation): New static function. * txr.1: Hash syntax described. * txr.vim: Updated.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.114
1 files changed, 13 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index b51813d2..45718727 100644
--- a/txr.1
+++ b/txr.1
@@ -4476,6 +4476,7 @@ list, which terminates nonempty lists.
Function and variable bindings are dynamically scoped in TXR Lisp. However,
closures do capture variables.
+
.SS Additional Syntax
Much of the TXR Lisp syntax has been introduced in the previous sections of the
@@ -4542,11 +4543,22 @@ and not a quasiquote.
.SS Vectors
-.IP #(...)
+.IP "#(...)"
A hash token followed by a list denotes a vector. For example #(1 2 a)
is a three-element vector containing the numbers 1 and 2, and the symbol a.
+.SS Hashes
+
+.IP "#H((<hash-argument>*) (<key> <value>)*)"
+
+The notation #H followed by a nested list syntax denotes a hash table literal.
+The first item in the syntax is a list of keywords. These are the same
+keywords as are used when calling the function hash to construct
+a hash table. Allowed keywords are: :equal-based, :weak-keys, :weak-values.
+An empty list can be specified as nil or (), which defaults to a
+hash table basd on the eq function, with no weak semantics.
+
.SS Nested Quotes
Quotes can be nested. What if it is necessary to unquote something in the