Previous Section Next Section Table of Contents Glossary Index

Chapter 13. The Foreign-Function Interface

13.8. Case-sensitivity of foreign names in CCL

13.8.1. Overview

As of release 0.11, CCL addresses the fact that foreign type, constant, record, field, and function nams are case-sensitive and provides mechanisms to refer to these names via lisp symbols.

Previous versions of CCL have tried to ignore that fact, under the belief that case conflicts were rare and that many users (and implementors) would prefer not to deal with case-related issues. The fact that some information in the interface databases was incomplete or inaccessible because of this policy made it clearer that the policy was untenable. I can't claim that the approach described here is aesthetically pleasing, but I can honestly say that it's less unpleasant than other approaches that I'd thought of. I'd be interested to hear alternate proposals.

The issues described here have to do with how lisp symbols are used to denote foreign functions, constants, types, records, and fields. It doesn't affect how other lisp objects are sometimes used to denote foreign objects. For instance, the first argument to the EXTERNAL-CALL macros is now and has always been a case-sensitive string.

13.8.2. Foreign constant and function names

The primary way of referring to foreign constant and function names in CCL is via the #$ and #_ reader macros. These reader macro functions each read a symbol into the "OS" package, look up its constant or function definition in the interface database, and assign the value of the constant to the symbol or install a macroexpansion function on the symbol.



        ; not exist ...
        #$o_rdonly ; Probably doesn't exist
        #$O_RDONLY ; Exists on most platforms

13.8.3. Foreign type, record, and field names






There may be many ways of "escaping" (with angle brackets) sequences of upper-case and non-lower-case characters in a symbol used to denote a foreign name. When translating in the other direction, CCL always escapes the longest sequence that starts with an upper-case character and doesn't contain a lower-case character.



Older POSIX code tends to use lower-case exclusively for type, record, and field names; there are only a few cases in the CCL sources where mixed-case names need to be escaped.

13.8.4. Examples

        ;;; Allocate a record of type "window".
        ;;;  different type
        ;;; This is equivalent to the last example

Previous Section Next Section Table of Contents Glossary Index