Npt documentation.
Reference: ANSI Common Lisp npt
The following function specifications are described in lisp.h
.
void lisp_get_function(addr x, addr symbol);
void lisp_get_setf(addr x, addr symbol);
int lisp_get_function_(addr x, addr value);
int lisp_get_function8_(addr x, const void *str);
int lisp_get_function16_(addr x, const void *str);
int lisp_get_function32_(addr x, const void *str);
int lisp_get_setf_(addr x, addr value);
int lisp_get_setf8_(addr x, const void *str);
int lisp_get_setf16_(addr x, const void *str);
int lisp_get_setf32_(addr x, const void *str);
void lisp_compiled_dynamic(int index, lisp_calltype_dynamic call);
void lisp_compiled_rest(int index, lisp_calltype_rest call);
void lisp_compiled_empty(int index, lisp_calltype_empty call);
void lisp_compiled_var1(int index, lisp_calltype_var1 call);
void lisp_compiled_var2(int index, lisp_calltype_var2 call);
void lisp_compiled_var3(int index, lisp_calltype_var3 call);
int lisp_compiled_function_(addr x, int index, addr symbol);
int lisp_compiled_function8_(addr x, int index, const void *str);
int lisp_compiled_function16_(addr x, int index, const void *str);
int lisp_compiled_function32_(addr x, int index, const void *str);
int lisp_compiled_defun_(int index, addr symbol);
int lisp_compiled_defun8_(int index, const void *str);
int lisp_compiled_defun16_(int index, const void *str);
int lisp_compiled_defun32_(int index, const void *str);
int lisp_compiled_defun_setf_(int index, addr symbol);
int lisp_compiled_defun_setf8_(int index, const void *str);
int lisp_compiled_defun_setf16_(int index, const void *str);
int lisp_compiled_defun_setf32_(int index, const void *str);
void lisp_compiled_setvalue(addr pos, addr value);
void lisp_compiled_getvalue(addr *ret);
Function to get a function object from symbol.
void lisp_get_function(addr x, addr symbol);
void lisp_get_setf(addr x, addr symbol);
int lisp_get_function_(addr x, addr value);
int lisp_get_function8_(addr x, const void *str);
int lisp_get_function16_(addr x, const void *str);
int lisp_get_function32_(addr x, const void *str);
int lisp_get_setf_(addr x, addr value);
int lisp_get_setf8_(addr x, const void *str);
int lisp_get_setf16_(addr x, const void *str);
int lisp_get_setf32_(addr x, const void *str);
lisp_get_function
void lisp_get_function(addr x, addr symbol);
: symbol, symbol object.
Input: x, hold variable.[ Output
Get a function object from symbol.
This is the same as symbol-function
in Common Lisp.
If value
is a hold variable, the content is used.
If the function is unbound
, NULL
will be returned.
If the argument is not a symbol type, LISP ABORT
.
lisp_get_setf
void lisp_get_setf(addr x, addr symbol);
: symbol, symbol object.
Input: x, hold variable.[ Output
Get a setf
function object from symbol.
This is the same as (fdefinition (list 'setf symbol))
in Common Lisp.
If value
is a hold variable, the content is used.
If the function is unbound
, NULL
will be returned.
If the argument is not a symbol type, LISP ABORT
.
lisp_get_function_
int lisp_get_function_(addr x, addr value);
: value, object.
Input: x, hold variable.
Output: Non-zero when escaping. Return
If value
is a symbol, get the function.
If value
is a function type, the value is returned as is.
If value
is a hold variable, the content is used.
If the function is unbound
, NULL
is returned.
lisp_get_function8_
int lisp_get_function8_(addr x, const void *str);
int lisp_get_function16_(addr x, const void *str);
int lisp_get_function32_(addr x, const void *str);
: str, unicode string.
input: x, hold variable.
Output: Non-zero when escaping. Return
Get a function with str
as the symbol name.
If the function is unbound
, NULL
is returned.
See the lisp_string8_
function for details on Unicode strings.
lisp_get_function16_
See lisp_get_function8_
.
lisp_get_function32_
See lisp_get_function8_
.
lisp_get_setf_
int lisp_get_setf_(addr x, addr value);
: value, object.
Input: x, hold variable.
Output: Non-zero when escaping. Return
If value
is a symbol, get the setf
function.
If value
is a function type, the value is returned as is.
If value
is a hold variable, the content is used.
If the function is unbound
, NULL
is returned.
lisp_get_setf8_
int lisp_get_setf8_(addr x, const void *str);
int lisp_get_setf16_(addr x, const void *str);
int lisp_get_setf32_(addr x, const void *str);
: str, unicode string.
input: x, hold variable.
Output: Non-zero when escaping. Return
Get a setf
function with str
as the symbol name.
If the function is unbound
, NULL
is returned.
See the lisp_string8_
function for details on Unicode strings.
lisp_get_setf16_
See lisp_get_setf8_
.
lisp_get_setf32_
See lisp_get_setf8_
.
Function for creating a function.
void lisp_compiled_dynamic(int index, lisp_calltype_dynamic call);
void lisp_compiled_rest(int index, lisp_calltype_rest call);
void lisp_compiled_empty(int index, lisp_calltype_empty call);
void lisp_compiled_var1(int index, lisp_calltype_var1 call);
void lisp_compiled_var2(int index, lisp_calltype_var2 call);
void lisp_compiled_var3(int index, lisp_calltype_var3 call);
int lisp_compiled_function_(addr x, int index, addr symbol);
int lisp_compiled_function8_(addr x, int index, const void *str);
int lisp_compiled_function16_(addr x, int index, const void *str);
int lisp_compiled_function32_(addr x, int index, const void *str);
int lisp_compiled_defun_(int index, addr symbol);
int lisp_compiled_defun8_(int index, const void *str);
int lisp_compiled_defun16_(int index, const void *str);
int lisp_compiled_defun32_(int index, const void *str);
int lisp_compiled_defun_setf_(int index, addr symbol);
int lisp_compiled_defun_setf8_(int index, const void *str);
int lisp_compiled_defun_setf16_(int index, const void *str);
int lisp_compiled_defun_setf32_(int index, const void *str);
void lisp_compiled_setvalue(addr pos, addr value);
void lisp_compiled_getvalue(addr *ret);
lisp_compiled_dynamic
void lisp_compiled_dynamic(int index, lisp_calltype_dynamic call);
: index, function number.
Input: call, function pointer, int (*call)(addr) Input
Registers a function pointer call
to the index
th.
index
is a value between 0 and 31, and the upper limit of 31 can be set with the define value LISP_POINTER_EXTEND
.
When called from Lisp, the arguments are passed as a list as the first argument, like the &rest
specification.
Unlike rest
, the list is allocated with dynamic-extent
, so it cannot be set as the return value of the function.
A function like the following declaration will be created.
defun name (&rest args)
(declare (dynamic-extent args)
( ...)
lisp_compiled_rest
void lisp_compiled_rest(int index, lisp_calltype_rest call);
: index, function number.
Input: call, function pointer, int (*call)(addr) Input
Registers a function pointer call
to the index
th.
index
is a value between 0 and 31, and the upper limit of 31 can be set with the define value LISP_POINTER_EXTEND
.
When called from Lisp, the arguments are passed as a list as the first argument, like the &rest
specification.
Unlike dynamic
, the list is allocated in the heap area, so it can be set to the value returned by the function.
A function like the following declaration will be created.
defun name (&rest args)
( ...)
lisp_compiled_empty
void lisp_compiled_empty(int index, lisp_calltype_empty call);
: index, function number.
Input: call, function pointer, int (*call)(void) Input
Registers a function pointer call
to the index
th.
index
is a value between 0 and 31, and the upper limit of 31 can be set with the define value LISP_POINTER_EXTEND
.
It is called from Lisp with no arguments.
If there is an argument, it is an error.
A function like the following declaration will be created.
defun name ()
( ...)
lisp_compiled_var1
void lisp_compiled_var1(int index, lisp_calltype_var1 call);
: index, function number.
Input: call, function pointer, int (*call)(addr) Input
Registers a function pointer call
to the index
th.
index
is a value between 0 and 31, and the upper limit of 31 can be set with the define value LISP_POINTER_EXTEND
.
It is called from Lisp with a single argument.
It is an error if there is not a single argument.
A function like the following declaration will be created.
defun name (x)
( ...)
lisp_compiled_var2
void lisp_compiled_var2(int index, lisp_calltype_var2 call);
: index, function number.
Input: call, function pointer, int (*call)(addr, addr) Input
Registers a function pointer call
to the index
th.
index
is a value between 0 and 31, and the upper limit of 31 can be set with the define value LISP_POINTER_EXTEND
.
It is called from Lisp with two arguments.
If there are not two arguments, an error occurs.
A function like the following declaration will be created.
defun name (x y)
( ...)
lisp_compiled_var3
void lisp_compiled_var3(int index, lisp_calltype_var3 call);
: index, function number.
Input: call, function pointer, int (*call)(addr, addr, addr) Input
Registers a function pointer call
to the index
th.
index
is a value between 0 and 31, and the upper limit of 31 can be set with the define value LISP_POINTER_EXTEND
.
It is called from Lisp with three arguments.
If there are not three arguments, an error occurs.
A function like the following declaration will be created.
defun name (x y z)
( ...)
lisp_compiled_function_
int lisp_compiled_function_(addr x, int index, addr symbol);
: index, function number.
Input: symbol, symbol object or NULL.
Input: Non-zero when escaping. Return
Creates a function object.
The name to be held inside the function is specified as symbol
.
If symbol
is null, NIL
is used.
If symbol
is a hold variable, the content is used.
When the object is called, the function pointer registered in the function number will be executed.
lisp_compiled_function8_
int lisp_compiled_function8_(addr x, int index, const void *str);
int lisp_compiled_function16_(addr x, int index, const void *str);
int lisp_compiled_function32_(addr x, int index, const void *str);
: index, function number.
Input: str, Unicode string.
Input: Non-zero when escaping. Return
Creates a function object.
The name to be held inside the function is specified as str
.
When the object is called, the function pointer registered in the function number will be executed. See the lisp_string8_
function for details on Unicode strings.
lisp_compiled_function16_
See lisp_compiled_function8_
.
lisp_compiled_function32_
See lisp_compiled_function8_
.
lisp_compiled_defun_
int lisp_compiled_defun_(int index, addr symbol);
: index, function number.
Input: symbol, symbol object.
Input: Non-zero when escaping. Return
Register a function.
Create an object and register it with symbol-function
.
If symbol
is a hold variable, the content is used.
When the generated function is called, the function pointer registered in the function number will be executed.
lisp_compiled_defun8_
int lisp_compiled_defun8_(int index, const void *str);
int lisp_compiled_defun16_(int index, const void *str);
int lisp_compiled_defun32_(int index, const void *str);
: index, function number.
Input: str, Unicode string.
Input: Non-zero when escaping. Return
Register a function.
Create an object and register it with symbol-function
.
When the generated function is called, the function pointer registered in the function number will be executed. See the lisp_string8_
function for details on Unicode strings.
lisp_compiled_defun16_
See lisp_compiled_defun8_
.
lisp_compiled_defun32_
See lisp_compiled_defun8_
.
lisp_compiled_defun_setf_
int lisp_compiled_defun_setf_(int index, addr symbol);
: index, function number.
Input: symbol, symbol object.
Input: Non-zero when escaping. Return
Register a setf
function.
If symbol
is a hold variable, the content is used.
When the generated function is called, the function pointer registered in the function number will be executed.
lisp_compiled_defun_setf8_
int lisp_compiled_defun_setf8_(int index, const void *str);
int lisp_compiled_defun_setf16_(int index, const void *str);
int lisp_compiled_defun_setf32_(int index, const void *str);
: index, function number.
Input: str, Unicode string.
Input: Non-zero when escaping. Return
Register a setf
function.
When the generated function is called, the function pointer registered in the function number will be executed. See the lisp_string8_
function for details on Unicode strings.
lisp_compiled_defun_setf16_
See lisp_compiled_defun_setf8_
.
lisp_compiled_defun_setf32_
See lisp_compiled_defun_setf8_
.
lisp_compiled_getvalue
void lisp_compiled_getvalue(addr *ret);
: ret, object. Output
Get the value of the closure.
The value will be retrieved from the stack frame, so do not use lisp_push_control
before retrieving it.
lisp_compiled_setvalue
void lisp_compiled_setvalue(addr pos, addr value);
: pos, function object.
Input: value, object or NULL. Input
Set the closure of a function object to a value.
If value
is null, NIL
will be used.
If value
is a hold variable, the content will be used.