MacroPackage: ffToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

def-foreign-variable

Arguments: name-and-options &key type convention

This macro creates the specification which allows lisp to correctly reference non-lisp variable data. Like other defining forms, its macroexpansion clearly shows what will occur and at what eval-when times. The execution of the expanded form always returns the lisp name being defined. The definition that is installed is a symbol-macro that accesses the non-lisp value correctly.

name-and-options can either be a symbol or a list of a symbol and an external-name specification. The symbol represents the lisp-name for which the foreign-variable definition will be installed. The external name specification can be either a string specifying a literal external name, or it can be a symbol, which represents the name of a conversion function. That conversion function must take one required argument and at least the language keyword argument, and must be defined at the time the macro expansion is executed. At that time this conversion function will be called and will receive the lisp-name specified, as well as the arguments :language lang where lang is the value of the convention keyword.

type is the access type of the variable, and can be any of the valid access types for memref and memref-int. The default access type is :unsigned-long. Note the type is not a foreign type.

convention is used by the macro to properly translate the lisp name into a foreign name, and is given to the conversion function as its language keyword argument. The possible values are :c and :fortran.

See foreign-functions.htm for general information on foreign functions in Allegro CL. The def-foreign-variable section in that documents has more information and examples of def-foreign-variable.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version