summaryrefslogtreecommitdiff
path: root/Lisp/name-conversion.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-04 19:19:37 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-04 19:19:37 +0100
commitb4517249b210065bcbf398c0b2c11097dd5b5d58 (patch)
tree48f3034e9719fab8c3fb9f0711778ed2a1bfc509 /Lisp/name-conversion.lisp
parentd1b78ba4ce1d6da0873be4d16a95397660f578ad (diff)
Add preliminary support for Objective-C slots.
darcs-hash:7da372a879d14800683cb79a262e86a8037245fc
Diffstat (limited to 'Lisp/name-conversion.lisp')
-rw-r--r--Lisp/name-conversion.lisp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Lisp/name-conversion.lisp b/Lisp/name-conversion.lisp
index 4ff637c..0c294fb 100644
--- a/Lisp/name-conversion.lisp
+++ b/Lisp/name-conversion.lisp
@@ -114,3 +114,20 @@
(concatenate 'string
"%"
(symbol-name (objc-class-name->symbol meta-class-name)))))))
+
+
+(defun slot-name->foreign-slot-name (slot-name)
+ (let* ((string (symbol-name slot-name))
+ (case-converted-slot-name
+ (ecase (readtable-case *readtable*)
+ (:preserve string)
+ (:invert (cond ((notany #'lower-case-p string)
+ (string-downcase string))
+ ((notany #'upper-case-p string)
+ (string-upcase string))
+ (t string)))
+ (:upcase (if (notany #'lower-case-p string)
+ (string-downcase string)
+ string))
+ (:downcase string))))
+ (substitute #\_ #\- case-converted-slot-name)))