diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-06 14:15:25 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-03-06 14:15:25 +0100 |
commit | 829e90949351cfe763b8eb87cacb605d440ae49b (patch) | |
tree | c8a2e77658b26ca564710bd3042b4518dfd30a53 /Lisp | |
parent | b9e7d47e24d862f4c80604cfa4e1b6dddf48d607 (diff) |
Implement INTERN-LISP-VALUE.
darcs-hash:78901552fd2a363337b9d4742e0ddf80de731b3f
Diffstat (limited to 'Lisp')
-rw-r--r-- | Lisp/lisp-value-wrapping.lisp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Lisp/lisp-value-wrapping.lisp b/Lisp/lisp-value-wrapping.lisp index b0a7794..3236d99 100644 --- a/Lisp/lisp-value-wrapping.lisp +++ b/Lisp/lisp-value-wrapping.lisp @@ -44,16 +44,15 @@ (intern-lisp-value x)) (defcoercion id ((x string)) - ;; FIXME: Implement INTERN-LISP-VALUE. - (primitive-invoke (find-objc-class 'ns-string) - "stringWithUTF8String:" - 'id - x)) + (intern-lisp-value x)) (defcoercion id ((x t)) (intern-lisp-value x)) +(defvar *lisp-value-wrappers* (make-weak-value-hash-table)) + + (defun intern-lisp-value (value) ;; We need this function in order to preserve object identity on the ;; Objective-C side. As we want [(intern-lisp-value 10) self] to @@ -65,7 +64,9 @@ ;; ;; will evaluate to true unless we generally intern Lisp value ;; wrappers. - (error "FIXME")) + (or (weak-gethash value *lisp-value-wrappers* nil) + (setf (weak-gethash value *lisp-value-wrappers*) + (make-lisp-value value)))) (defun make-lisp-value (value) |