[Openmcl-devel] foreign type name escaping

John Wiseman jjwiseman at yahoo.com
Thu Nov 18 02:28:50 UTC 2004


 > So, we'd have:
 >
 > a) if the lisp name contains angle brackets, they're used as they
 >    are currently.
 >
 > b) Otherwise, if the lisp name is mixed case, the foreign name is
 >    the same as the lisp name (with case preserved)
 >
 > c) Otherwise, the foreign name is the same as the lisp name with all
 >    upppercase characters downcased.
 >
 > Currently, we skip rule (b).
 >
 > Does that seem reasonable ?

That seems reasonable to me.

Though I did think of another encoding scheme that seems related: the
Cocoa bridge allows you to say "ns-run-loop" for "NSRunLoop".  I
understand that Cocoa classes are a special case of foreign types, and
the context is a little different, but it seems like we should at
least consider whether it should be ok to write
"cf-run-loop-timer-ref" for "CFRunLoopTimerRef".

Actually, I guess there is yet another place in which users specify
foreign names, and which uses yet another scheme: The #_ and #? reader
macros, which preserve case ("#_CFRunLoopTimerCreate").

It would probably be foolish to try to settle on a single foreign type
naming scheme that could be used in all contexts and is also
convenient, but it might be OK to try to achieve a little more
consistency.

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).


John




More information about the Openmcl-devel mailing list