[Openmcl-devel] foreign type name escaping

Gary Byers gb at clozure.com
Wed Nov 17 21:01:39 PST 2004



On Wed, 17 Nov 2004, John Wiseman wrote:
> How hard would it be to try to use hyphenated names like
> "cf-run-loop-timer-create" in as many contexts as it made sense, with
> a backup method of specifying exact case when the heuristics don't
> work?  Foreign classes, foreign function calls, argument types, record
> types, maybe even foreign constants and variables (though these last two
> would probably be most conveniently specified with the current #$
> syntax).
>

Cocoa has (and mostly seems to follow)
rulesForUsingStudlyCaseInMethodsAndClassNames.  Core Foundation's rules
for type names seem to follow conventions that're similar to (if not
identical to) Cocoa's class name conventions, with CF replacing NS
on standard system types/classes.

After that ... I think that it starts to get a lot less regular quickly
(and the differences -usually- seem to revolve around whether the first
"word" in a multi-word token is capitalized and/or whether there's a
standard prefix on built-in things.  The lisp symbol :MULTI-WORD-TOKEN
could map to either "multiWordToken" or "MultiWordToken"; I'm sure that
you could pick one of these and make it the default, but it's not clear
that there are simple, easily remembered and intuitive rules that work
with (e.g.) arbitrary legacy things in Carbon or arbitrary 3rd-party
things.

(IIRC, Randy found it necessary to define exceptions to the general
lisp<->Cocoa class name translation rules - to keep things like
NSURLHandler from lispifiying as NS-U-R-L-HANDLER.  I think that this
problem is harder than it may seem at first glance.)





More information about the Openmcl-devel mailing list