OpenMCL usage notes

Initial value of *PACKAGE*

*PACKAGE* is set to the CCL package; the CCL:*WARN-IF-REDEFINE* and CCL:*WARN-IF-REDEFINE-KERNEL* variables are both set to NIL. The good news is that this environment makes it more convenient to muck around inside the implementation; that's also the bad news.

Calling foreign functions

The primary way of calling a foreign function (imported from some shared ibrary) is via the CCL::EXTERNAL-CALL macro:

(CCL::EXTERNAL-CALL entry-name {arg-spec arg-val}* result-spec)
entry-name
a (case-sensitive) string which names the external function
arg-spec
a keyword: one of :ADDRESS, :SIGNED-DOUBLEWORD, :UNSIGNED-DOUBLEWORD, :SIGNED-FULLWORD, :UNSIGNED-FULLWORD, :SIGNED-HALFWORD, :UNSIGNED-HALFWORD, :SIGNED-BYTE, :UNSIGNED-BYTE, :SINGLE-FLOAT, or :DOUBLE-FLOAT
arg-val
a lisp expression whose value is coerced to the foreign type denoted by the corresponding arg-spec
result-spec
indicates the foreign type of the result and can be any of the keywords used as an arg-spec or :VOID or NIL to indicate that the EXTERNAL-CALL should return NIL.

Note that under Darwin, the entry-name of any symbol visible to C has an underscore prepended; the C function read would therefore be referenced as "_read".