Export lisp-name as a generic function

Bug #622272 reported by Luís Oliveira
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CFFI
Fix Released
Wishlist
Greg Pfeil

Bug Description

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 <email address hidden>
 * 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).

Revision history for this message
Luís Oliveira (luismbo) wrote :
Changed in cffi:
importance: Undecided → Wishlist
status: New → Triaged
description: updated
Revision history for this message
Luís Oliveira (luismbo) wrote :
Changed in cffi:
assignee: nobody → Greg Pfeil (greg-technomadic)
Revision history for this message
Greg Pfeil (greg-technomadic) wrote :

Updated with docs & tests, also rather than replacing the existing LISP-NAME and FOREIGN-NAME, created new functions called TRANSLATE-NAME-FROM-FOREIGN and TRANSLATE-NAME-TO-FOREIGN that are called by the original functions.

Changed in cffi:
status: Triaged → In Progress
Revision history for this message
Luís Oliveira (luismbo) wrote :

Reviewed and commited to github.com/luismbo/cffi (cl.net currently undergoing migration)

Changed in cffi:
status: In Progress → Fix Committed
Luís Oliveira (luismbo)
Changed in cffi:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.