summaryrefslogtreecommitdiff
path: root/Lisp/name-conversion.lisp
diff options
context:
space:
mode:
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)))