All Manuals > LispWorks Objective-C and Cocoa Interface User Guide and Reference Manual > 2 Objective-C Reference

define-objc-struct Macro

Summary

Defines a foreign structure for use with Objective-C.

Package

objc

Signature

define-objc-struct (name {option}*) {slot}*

option ::= (:foreign-name foreign-name) | (:typedef-name typedef-name)

slot ::= (slot-name slot-type)

Arguments
name
A symbol naming the foreign structure type.
foreign-name
A string giving the foreign structure name.
typedef-name
A symbol naming a foreign structure type alias.
slot-name
A symbol naming the foreign slot.
slot-type
An FLI type descriptor for the foreign slot.
Description

The macro define-objc-struct defines a foreign structure type named name with the slots specified by each slot-name and slot-type. In addition, (:struct name) becomes an Objective-C type that can be used with invoke, invoke-into and define-objc-method or define-objc-class-method.

foreign-name must be specified to allow the Objective-C runtime system to identify the type.

If typedef-name is specified,it allows that symbol to be used in place of (:struct name) when using the type in a define-objc-method or define-objc-class-method form.

See also

invoke-into
define-objc-method
define-objc-class-method


LispWorks Objective-C and Cocoa Interface User Guide and Reference Manual - 01 Dec 2021 19:38:32