Version: 4.2.1
3 Syntactic Forms
(tell result-type obj-expr method-id) |
(tell result-type obj-expr arg ...) |
|
result-type | | = | | | | | | | | #:type ctype-expr | | | | | | arg | | = | | method-id expr | | | | | | #:type ctype-expr method-id arg |
|
Sends a message to the Objective-C object produced by
obj-expr. When a type is omitted for either the result or an
argument, the type is assumed to be
_id, otherwise it must
be specified as an FFI C type (see
Type Constructors).
If a single method-id is provided with no arguments, then
method-id must not end with :; otherwise, each
method-id must end with :.
Examples: |
> (tell NSString alloc) |
#<cpointer:id> |
|
#<cpointer:id> |
(tellv obj-expr method-id) |
(tellv obj-expr arg ...) |
Defines each
class-id to the class (a value with FFI type
_Class) that is registered with the string form of
class-id. The registered class is obtained via
objc_lookUpClass.
|
|
method | | = | | (mode result-ctype-expr (method-id) body ...+) | | | | | | (mode result-ctype-expr (arg ...+) body ...+) | | | | | | mode | | = | | + | | | | | | - | | | | | | +a | | | | | | -a | | | | | | arg | | = | | method-id [ctype-expr arg-id] |
|
Defines
class-id as a new, registered Objective-C class (of
FFI type
_Class). The
superclass-expr should
produce an Objective-C class or
#f for the superclass.
Each field-id is an instance field that holds a Scheme value
and that is initialized to #f when the object is
allocated. The field-ids can be referenced and set!
directly when the method bodys. Outside the object, they can
be referenced and set with get-ivar and set-ivar!.
Each method adds or overrides a method to the class (when
mode is - or -a) to be called on instances,
or it adds a method to the meta-class (when mode is
+ or +a) to be called on the class itself. All
result and argument types must be declared using FFI C types
(see Type Constructors). When mode is +a or -a, the
method is called in atomic mode (see _cprocedure).
If a method is declared with a single method-id and
no arguments, then method-id must not end with
:. Otherwise, each method-id must end with
:.
If the special method dealloc is declared for mode
-, it must not call the superclass method, because a
(super-tell dealloc) is added to the end of the method
automatically. In addition, before (super-tell dealloc),
space for each field-id within the instance is deallocated.
When used within the body of a
define-objc-class method,
calls a superclass method. The
result-type and
arg
sub-forms have the same syntax as in
tell. This form cannot
be used outside of a
define-objc-class method.
Returns a selector (of FFI type
_SEL) for the string form of
method-id.