All Manuals > Foreign Language Interface User Guide and Reference Manual > 7 Function, Macro and Variable Reference

define-foreign-block-invoker Macro

Summary

Defines an invoker of a foreign block, in LispWorks for Macintosh.

Package

fli

Signature

define-foreign-block-invoker the-name args &key lambda-list documentation result-type language no-check calling-convention

Arguments
the-name
A symbol.
args
A lambda list.
lambda-list
The lambda list to be used for the defined Lisp function.
documentation
A string.
result-type
A foreign type.
language
The language in which the foreign source code is written. The default is :ansi-c.
no-check
A boolean.
calling-convention
Specifies the calling convention used.
Description

The macro define-foreign-block-invoker defines an invoker of a foreign block.

It defines the-name to be a function that can be used to invoke foreign blocks which takes arguments that match args. The block is then invoked by simply calling the function the-name with the block and arguments:

(the-name block arg1 arg2 ...)

The block argument is of type foreign-block-pointer.

define-foreign-block-invoker is very similar to define-foreign-funcallable and define-foreign-function, which specify how documentation, result-type, language, no-check and calling-convention are used.

Notes

The lambda list of the invoker is (block . args). When lambda-list is supplied, define-foreign-block-invoker inserts in front of the supplied lambda-list an additional argument for the block. Therefore a supplied lambda-list must not include an argument for the block. Similarly a supplied lambda-list in define-foreign-funcallable should not include an argument for the function.

define-foreign-block-invoker returns the-name.

define-foreign-block-invoker is implemented in LispWorks for Macintosh only.

Examples
(example-edit-file "fli/foreign-blocks")
(example-edit-file "fli/invoke-foreign-block")
See also

define-foreign-funcallable
define-foreign-function
foreign-block-pointer
5.7 Block objects in C (foreign blocks)


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58