Package: cffi

Generic Function translate-camelcase-name

Lambda List

translate-camelcase-name (name &key upper-initial-p special-words)

Arguments

name -- Either a symbol or a string.
upper-initial-p -- A generalized boolean.
special words -- A list of strings.

Return Value

If name is a symbol, this is a string, and vice versa.

Details

translate-camelcase-name is a helper function for specializations of translate-name-from-foreign and translate-name-to-foreign. It handles the common case of converting between foreign camelCase names and lisp names. upper-initial-p indicates whether the first letter of the foreign name should be uppercase. special-words is a list of strings that should be treated atomically in translation. This list is case-sensitive.

Examples

  CFFI> (translate-camelcase-name some-xml-function)
  => "someXmlFunction"
  CFFI> (translate-camelcase-name some-xml-function :upper-initial-p t)
  => "SomeXmlFunction"
  CFFI> (translate-camelcase-name some-xml-function :special-words '("XML"))
  => "someXMLFunction"
  CFFI> (translate-camelcase-name "someXMLFunction")
  => SOME-X-M-L-FUNCTION
  CFFI> (translate-camelcase-name "someXMLFunction" :special-words '("XML"))
  => SOME-XML-FUNCTION  
 

See also