Next Previous Up Top Contents Index

11 The LINK-LOAD Package

process-foreign-code

Macro

Package

link-load

Syntax

process-foreign-code c-string &key language control =>

Arguments

c-string

A string.

language

One of:c,:c++ or:ansi-c.

control

One of:fasl,:object, or:source.

Description

This macro allows C or C++ code to be included in a Lisp fasl file.process-foreign-code is emitted byprocess-foreign-file when parsing C++ header files.
c-string is a string containing C or C++ source code.
language is either:C,:C++ or:ansi-C, and is:C++ by default.
control is either:fasl,:object or:source. It is:fasl by default. If:fasl, the foreign code is compiled at compile time into a temporary.o file. The resulting object module is stored in the fasl file. If:object, the foreign code is compiled at compile time into a .o file with the same name as the lisp file, and loaded into the image when the fasl file is loaded. If:source, compilation and loading of the foreign code is done when the fasl file is loaded.
Example

(process-foreign-code "int sum (int a, int b) 
                      { return a+b; } "
        :control :source)
; When the lisp file containing this statement is 
; loaded, the c-code is compiled and also loaded into 
; the image. 

See Also

process-foreign-file


LispWorks Reference Manual - 15 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker