comparison man/lispref/hash-tables.texi @ 4820:e6dec75ded0e

Use keywords, not ordinary symbols, in the structure syntax for hash tables. lisp/ChangeLog addition: 2010-01-09 Aidan Kehoe <kehoea@parhasard.net> * descr-text.el (describe-char-unihan-field-descriptions): * cl-macs.el: Use keywords, not ordinary symbols, in the hash table read syntax, for compatibility with Common Lisp and recent GNU Emacs. man/ChangeLog addition: 2010-01-09 Aidan Kehoe <kehoea@parhasard.net> * lispref/objects.texi (Hash Table Type): * lispref/hash-tables.texi (Introduction to Hash Tables): Use keywords, not ordinary symbols, in the hash table read syntax; document that we do accept the ordinary symbols for the sake of backward-compatiblity. 2010-01-09 Aidan Kehoe <kehoea@parhasard.net> * elhash.c: (print_hash_table, print_hash_table_data) (hash_table_instantiate) (structure_type_create_hash_table_structure_name): (syms_of_elhash): Use keywords, not ordinary symbols, in the hash table read syntax, for compatibility with Common Lisp and recent GNU Emacs. Accept the non-keyword syntax, but don't allow mixing of the two styles.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 09 Jan 2010 17:28:51 +0000
parents abe6d1db359e
children 71ee43b8a74d
comparison
equal deleted inserted replaced
4818:1360b0c147c1 4820:e6dec75ded0e
63 specify a large rehash threshold, for example 0.8. 63 specify a large rehash threshold, for example 0.8.
64 64
65 Hash tables can also be created by the lisp reader using structure 65 Hash tables can also be created by the lisp reader using structure
66 syntax, for example: 66 syntax, for example:
67 @example 67 @example
68 #s(hash-table size 20 data (foo 1 bar 2)) 68 #s(hash-table :size 20 :data (foo 1 bar 2))
69 @end example 69 @end example
70 70
71 The structure syntax accepts the same keywords as @code{make-hash-table} 71 The structure syntax accepts the same keywords as
72 (without the @code{:} character), as well as the additional keyword 72 @code{make-hash-table}, as well as the additional keyword @code{data},
73 @code{data}, which specifies the initial hash table contents. 73 which specifies the initial hash table contents. Older versions of
74 XEmacs required that the keywords not have the initial ``:'' in the
75 structure syntax, and this version of XEmacs still supports that syntax,
76 but you cannot mix the two styles within one structure.
74 77
75 @defun make-hash-table &key @code{test} @code{size} @code{rehash-size} @code{rehash-threshold} @code{weakness} 78 @defun make-hash-table &key @code{test} @code{size} @code{rehash-size} @code{rehash-threshold} @code{weakness}
76 This function returns a new empty hash table object. 79 This function returns a new empty hash table object.
77 80
78 Keyword @code{:test} can be @code{eq}, @code{eql} (default) or @code{equal}. 81 Keyword @code{:test} can be @code{eq}, @code{eql} (default) or @code{equal}.