X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhash-table.lisp;h=0641ca821280e975682e6b6e40f42d9930ecb5fb;hb=a2bb848e0037e127287781e99528bc4e93ccc2fb;hp=8125e9ef7827c275eb5466f7842528ed4681adfa;hpb=f9d87f161987d9bbbb1c70d7c833e72823eda584;p=jscl.git diff --git a/src/hash-table.lisp b/src/hash-table.lisp index 8125e9e..0641ca8 100644 --- a/src/hash-table.lisp +++ b/src/hash-table.lisp @@ -13,21 +13,20 @@ ;; You should have received a copy of the GNU General Public License ;; along with JSCL. If not, see . -;;; Javascript dictionaries are the natural way to implement Common +;;; Plain Javascript objects are the natural way to implement Common ;;; Lisp hash tables. However, there is a big differences betweent -;;; them which we need to work around. Javascript dictionaries require -;;; the keys to be strings. To solve that, we map Lisp objects to -;;; strings such that "equivalent" values map to the same string, -;;; regarding the equality predicate used (one of `eq', `eql', `equal' -;;; and `equalp'). +;;; them which we need to work around. Javascript objects require the +;;; keys to be strings. To solve that, we map Lisp objects to strings +;;; such that "equivalent" values map to the same string, regarding +;;; the equality predicate used (one of `eq', `eql', `equal' and +;;; `equalp'). ;;; ;;; If a hash table has `eq' as test, we need to generate unique ;;; strings for each Lisp object. To do this, we tag the objects with -;;; a `$$jscl_id' property. As a special case, numbers are not -;;; objects, but they can be used for indexin a Javascript dictionary, -;;; we do not need to tag them. +;;; a `$$jscl_id' property. As a special case, numbers do not need to +;;; be tagged, as they can be used to index Javascript objects. (defvar *eq-hash-counter* 0) (defun eq-hash (x) (cond