comparison lisp/cl-macs.el @ 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 6ee5e50a8772
children 6772ce4d982b
comparison
equal deleted inserted replaced
4818:1360b0c147c1 4820:e6dec75ded0e
2596 ;; be sensible for gethash, symbol-value and so on; currently we just hard-code 2596 ;; be sensible for gethash, symbol-value and so on; currently we just hard-code
2597 ;; symbol-value, symbol-function and values (the latter is XEmacs work that 2597 ;; symbol-value, symbol-function and values (the latter is XEmacs work that
2598 ;; I've just done) in the body of this function, and the following gives the 2598 ;; I've just done) in the body of this function, and the following gives the
2599 ;; wrong behaviour for gethash: 2599 ;; wrong behaviour for gethash:
2600 ;; 2600 ;;
2601 ;; (setq my-hash-table #s(hash-table test equal data ()) 2601 ;; (setq my-hash-table #s(hash-table :test equal :data ())
2602 ;; print-gensym t) 2602 ;; print-gensym t)
2603 ;; => t 2603 ;; => t
2604 ;; (gethash "my-key" my-hash-table (gensym)) 2604 ;; (gethash "my-key" my-hash-table (gensym))
2605 ;; => #:G68010 2605 ;; => #:G68010
2606 ;; (letf (((gethash "my-key" my-hash-table) 4000)) 2606 ;; (letf (((gethash "my-key" my-hash-table) 4000))