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

NextPrevUpTopContentsIndex

with-local-foreign-block

Macro
Summary

Allocates a foreign block, executes code and frees the block, in LispWorks for Macintosh.

Package

fli

Signature

with-local-foreign-block (foreign-block-var type function &rest extra-args) &body body => results

Arguments

foreign-block-var

A symbol.

type

A symbol naming a foreign block type defined using define-foreign-block-callable-type.

extra-args

Arguments.

Values

results

The results of body.

Description

The macro with-local-foreign-block allocates a foreign block using type, function and extra-args in the same way as allocate-foreign-block, but with dynamic extent. It then binds foreign-block-var to the foreign block and executes the code of body.

with-local-foreign-block can be used only if the code in body can be guaranteed not to invoke the block or a copy of it either outside the scope of with-local-foreign-block or in another thread. Unless you can be sure of that, you need to use with-foreign-block.

with-local-foreign-block returns the results of body.

with-local-foreign-block can be a little faster than with-foreign-block.

Notes

with-local-foreign-block is implemented in LispWorks for Macintosh only.

See also

allocate-foreign-block
free-foreign-block
with-foreign-block
Block objects in C (foreign blocks)


LispWorks Foreign Language Interface User Guide and Reference Manual - 29 Sep 2017

NextPrevUpTopContentsIndex