2010-08-22 15:12:16 |
Luís Oliveira |
description |
Sun Nov 15 10:18:33 EST 2009 Greg Pfeil <greg@technomadic.org>
* more flexible name translations
FOREIGN-/LISP-NAME are now exported and take a package argument. This allows users to override the name translations on a package-by-package basis. EG,
(defmethod cffi:lisp-name
((spec string) (package (eql (find-package :llvm))) &optional varp)
"LLVMUpperCamelCase -> 'llvm:upper-camel-case"
(intern (format nil (if varp "*~a*" "~a")
(translate-camelcase-name (subseq spec 4)
:upper-initial-p t
:special-words special-words))))
The functions TRANSLATE-UNDERSCORE-SEPARATED-NAME and TRANSLATE-CAMELCASE-NAME have also been added and are exported. They cover common foreign name translations (TRANSLATE-UNDERSCORE-SEPARATED-NAME is the default, and you can see TRANSLATE-CAMELCASE-NAME in the example above).
The patch needs to be reviewed, tests and documentation need to be written. LISP-NAME is probably too generic a name to be exported from CFFI. |
This patch needs to be reviewed. Tests and documentation need to be written. LISP-NAME is probably too generic a name to be exported from CFFI.
Sun Nov 15 10:18:33 EST 2009 Greg Pfeil <greg@technomadic.org>
* more flexible name translations
FOREIGN-/LISP-NAME are now exported and take a package argument. This allows users to override the name translations on a package-by-package basis. EG,
(defmethod cffi:lisp-name
((spec string) (package (eql (find-package :llvm))) &optional varp)
"LLVMUpperCamelCase -> 'llvm:upper-camel-case"
(intern (format nil (if varp "*~a*" "~a")
(translate-camelcase-name (subseq spec 4)
:upper-initial-p t
:special-words special-words))))
The functions TRANSLATE-UNDERSCORE-SEPARATED-NAME and TRANSLATE-CAMELCASE-NAME have also been added and are exported. They cover common foreign name translations (TRANSLATE-UNDERSCORE-SEPARATED-NAME is the default, and you can see TRANSLATE-CAMELCASE-NAME in the example above).
|
|