[Openmcl-devel] Foreign Types in OpenMCL

Gary Byers gb at clozure.com
Wed Jun 30 06:27:24 UTC 2004



On Wed, 30 Jun 2004, Pascal J.Bourguignon wrote:

> David Steuber writes:
> > Hi list,
> >
> > I'm getting my feet wet with Carbon programming in OpenMCL.  Some
> > working code I have has this form in it:
> >
> > (rlet ((nib-ref :<IBN>ib<R>ef))...
> >
> > I'm wondering why this can't be the more readable and easier to type
> > (IMO) ANSI like form:
> >
> > (rlet ((nib-ref :|IBNibRef|))...
> >
> > Also:
> >
> > CL-USER> (symbol-name :|Foo|)
> > "Foo"
> >
> > Anyway, it's just a thought.
>
> Or even:
>
> (SETF (READTABLE-CASE *READTABLE*) :PRESERVE)
> (RLET ((NIB-REF :IBNibRef)) ... )
> (SYMBOL-NAME :Foo) --> "Foo"
>
> --
> __Pascal Bourguignon__                     http://www.informatimago.com/
>

When this was done, one of the ideas was to avoid having to use lisp
escaping conventions to refer to foreign names that were entirely
lowercase (e.g., most standard Unix/POSIX stuff:

(#_read fd buf n)

(rlet ((foo :stat))
  (#_fstat fd foo))

... and so on.)  Being able to not have to do:

(#_|read| fd buf n)

(rlet ((foo :|stat|))
  (#_|fstat| fd foo))

seemed (and still seems) desirable.

StudlyCase is certainly more common than pure upper case is, so the
current conventions could be extended: if a lisp symbol's pname
contains lowercase characters, map it verbatim to a foreign name,
otherwise, fall back to the current conventions (assume lowercase and
use <> to delimit exceptions to that assumption.)

You'd still need to say :<BOOL> to refer to  the Cocoa boolean type,
which may or may not be the same thing as :bool or :<B>ool or :|Bool| ...

Personally, I don't find either :<IBN>ib<R>ef or :|IBNibRef| very
readable or easy to type, but that's all in the eye of the beholder.






More information about the Openmcl-devel mailing list