gb at clozure.com
Wed Dec 18 10:04:07 PST 2002
On Wed, 18 Dec 2002, nik gaffney wrote:
> > This makes it possible to use #$ to reference GL-related
> > constants (via #$) and makes GL-related types and data
> > structures available. It makes the signature of GL-related
> > foreign functions available (via #_).
> im not sure i understand how to access constants this way, could you explain
> it further?
The interface database contain parsed versions of (among other things)
constant definitions from header files. (For a constant, the type
and value are encoded in a database file.) The translation process
can do some C expression evaluation, so it (usually) understands things
#define A 1
#define B 2
#define C (A+B)
and understands enumerations. (The translation process actually
operates on an intermediate representation, so it doesn't have
to know too much about C lexical or syntactic conventions.)
The #$ reader macro basically reads a token (a case-sensitive
string, more or less) and then tries to find a "constants.cdb"
file in some "interface directory" that defines a constant
with a matching name.
If we use an "interface directory" that contains database files produced
by parsing the header file fragment above, we can say things like:
? (= #$C (+ #$A #$B))
and (of course) that's true in this case.
I have the feeling that this stuff could be better documented than it
Openmcl-devel mailing list
Openmcl-devel at clozure.com
More information about the Openmcl-devel