Previous Chapter Next Section Table of Contents Glossary Index

Chapter 14. The Objective-C Bridge

14.1. Changes in 1.2

Version 1.2 of Clozure CL exports most of the useful symbols described in this chapter; in previous releases, most of them were private in the CCL package.

There are several new reader macros that make it much more convenient than before to refer to several classes of symbols used with the Objective-C bridge. For a full description of these reader-macros, see the Foreign-Function-Interface Dictionary, especially the entries at the beginning, describing reader macros.

As in previous releases, 32-bit versions of Clozure CL use 32-bit floats and integers in data structures that describe geometry, font sizes and metrics, and so on. 64-bit versions of Clozure CL use 64-bit values where appropriate.

The Objective-C bridge defines the type NS:CGFLOAT as the Lisp type of the preferred floating-point type on the current platform, and defines the constant NS:+CGFLOAT+. On DarwinPPC32, the foreign types :cgfloat, :<NSUI>nteger, and :<NSI>nteger are defined by the Objective-C bridge (as 32-bit float, 32-bit unsigned integer, and 32-bit signed integer, respectively); these types are defined as 64-bit variants in the 64-bit interfaces.

Every Objective-C class is now properly named, either with a name exported from the NS package (in the case of a predefined class declared in the interface files) or with the name provided in the DEFCLASS form (with :METACLASS NS:+NS-OBJECT) which defines the class from Lisp. The class's Lisp name is now proclaimed to be a "static" variable (as if by DEFSTATIC, as described in the "Static Variables" section) and given the class object as its value. In other words:

(send (find-class 'ns:ns-application) 'shared-application)


(send ns:ns-application 'shared-application)

are equivalent. (Since it's not legal to bind a "static" variable, it may be necessary to rename some things so that unrelated variables whose names coincidentally conflict with Objective-C class names don't do so.)

Previous Chapter Next Section Table of Contents Glossary Index