All Manuals > LispWorks Foreign Language Interface User Guide and Reference Manual > 9 The Foreign Parser

NextPrevUpTopContentsIndex

9.4 Using the LispWorks Editor

The LispWorks Editor's C Mode offers a convenient alternative to using foreign-parser:process-foreign-file directly as above. It also allows you to generate and load a C object file.

To use this, you should be familiar with the LispWorks Editor as described in the LispWorks IDE User Guide and the LispWorks Editor User Guide .

9.4.1 Processing Foreign Code with the Editor

  1. Open the file test.h in the LispWorks Editor. Note that the buffer is in C Mode, indicated by "(C)" in the mode line.
  2. Use the menu command Buffer > Evaluate, or equivalently run Meta+X Evaluate Buffer.
  3. A new buffer named test.h (C->LISP) is created. It contains the prototype FLI definition forms generated by foreign-parser:process-foreign-file.
  4. You can now edit the Lisp forms if necessary (note that your new buffer is in Lisp mode) and save them to file. Follow the previous example from Step This edited version passes a string using :ef-mb-string:.

9.4.2 Compiling and Loading Foreign Code with the Editor

  1. Open the file test.c in the LispWorks Editor. Note that the buffer is in C Mode, indicated by "(C)" in the mode line.
  2. Use the menu command Buffer > Compile, or equivalently run Meta+X Compile Buffer.
  3. Your C file is compiled with the same options as lw:compile-system would use, and the object file is loaded. The object file name is printed in the Output tab. It is written in your temporary directory (usually that given by the value of the environment variable TEMP) and deleted after register-module is called on it.

LispWorks Foreign Language Interface User Guide and Reference Manual - 16 Feb 2015

NextPrevUpTopContentsIndex