From 829e90949351cfe763b8eb87cacb605d440ae49b Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Thu, 6 Mar 2008 14:15:25 +0100 Subject: Implement INTERN-LISP-VALUE. darcs-hash:78901552fd2a363337b9d4742e0ddf80de731b3f --- Lisp/lisp-value-wrapping.lisp | 13 +++++++------ 1 file 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) -- cgit v1.2.3