diff options
-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) |