Next: , Previous: , Up: Functions   [Contents][Index]


translate-camelcase-name

translate-camelcase-name

Syntax

Function: translate-camelcase-name name &key upper-initial-p special-words ⇒ return-value

Arguments and Values

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.

Description

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

translate-name-from-foreign
translate-name-to-foreign
translate-underscore-separated-name