Npt documentation.
Reference: ANSI Common Lisp npt
The following function specifications are described in lisp.h
.
int lisp_character_(addr x, unicode value);
void lisp_fixnum(addr x, fixnum value);
int lisp_float_(addr x, float value);
int lisp_double_(addr x, double value);
int lisp_long_double_(addr x, long double value);
int lisp_zero_p(addr value);
int lisp_plus_p(addr value);
int lisp_minus_p(addr value);
void lisp_get_character(addr pos, unicode *ret);
void lisp_get_fixnum(addr pos, fixnum *ret);
int lisp_get_float_(addr pos, float *ret);
int lisp_get_double_(addr pos, double *ret);
int lisp_get_long_double_(addr pos, long double *ret);
int lisp_package_(addr x, addr pos);
int lisp_package8_(addr x, const void *str);
int lisp_package16_(addr x, const void *str);
int lisp_package32_(addr x, const void *str);
int lisp_intern_(addr x, addr package, addr name);
int lisp_intern8_(addr x, const void *package, const void *name);
int lisp_intern16_(addr x, const void *package, const void *name);
int lisp_intern32_(addr x, const void *package, const void *name);
int lisp_reader_(addr x, addr str);
int lisp_reader8_(addr x, const void *str);
int lisp_reader16_(addr x, const void *str);
int lisp_reader32_(addr x, const void *str);
int lisp_pathname_(addr x, addr name);
int lisp_pathname8_(addr x, const void *str);
int lisp_pathname16_(addr x, const void *str);
int lisp_pathname32_(addr x, const void *str);
int lisp_namestring_(addr x, addr path);
Function of the creating object.
int lisp_character_(addr x, unicode value);
void lisp_fixnum(addr x, fixnum value);
int lisp_float_(addr x, float value);
int lisp_double_(addr x, double value);
int lisp_long_double_(addr x, long double value);
lisp_character_
int lisp_character_(addr x, unicode value);
: value, unicode
Input: x, hold variable
Output: Non-zero when escaping. Return
value
is a Unicode value and generates an object of character type.
If value
is a code reserved for a surrogate pair, or is beyond the range of Unicode, an error occurs.
lisp_fixnum
void lisp_fixnum(addr x, fixnum value);
: value, integer
Input: x, hold variable Output
Create an integer object of type fixnum
.
lisp_float_
int lisp_float_(addr x, float value);
: value, floating-point number
Input: x, hold variable
Output: Non-zero when escaping. Return
Creates a single-float
type floating-point object.
If value
is inf
or nan
, it is an error.
lisp_double_
int lisp_double_(addr x, double value);
: value, floating-point number
Input: x, hold variable
Output: Non-zero when escaping. Return
Creates a double-float
type floating-point object.
If value
is inf
or nan
, it is an error.
lisp_long_double_
int lisp_long_double_(addr x, long double value);
: value, floating-point number
Input: x, hold variable
Output: Non-zero when escaping. Return
Creates a long-float
type floating-point object.
If value
is inf
or nan
, it is an error.
Function of the getting value.
int lisp_zero_p(addr value);
int lisp_plus_p(addr value);
int lisp_minus_p(addr value);
void lisp_get_character(addr pos, unicode *ret);
void lisp_get_fixnum(addr pos, fixnum *ret);
int lisp_get_float_(addr pos, float *ret);
int lisp_get_double_(addr pos, double *ret);
int lisp_get_long_double_(addr pos, long double *ret);
lisp_zero_p
int lisp_zero_p(addr value);
: value, Object
Input: boolean Return
If value
is a hold variable, its contents are used.
If value
is a real number and equal to 0
, non-zero is returned.
lisp_plus_p
int lisp_plus_p(addr value);
: value, Object
Input: boolean Return
If value
is a hold variable, its contents are used.
If value
is real and greater than 0
, non-zero is returned.
The 0
is not included.
lisp_minus_p
int lisp_minus_p(addr value);
: value, Object
Input: boolean Return
If value
is a hold variable, its contents are used.
If value
is real and less than 0
, non-zero is returned.
The 0
is not included.
lisp_get_character
void lisp_get_character(addr pos, unicode *ret);
: pos, character object
Input: ret, unicode value Output
If pos
is a hold variable, its contents are used.
Return the character type code to ret
.
lisp_get_fixnum
void lisp_get_fixnum(addr pos, fixnum *ret);
: pos, fixnum object
Input: ret, fixnum value Output
If pos
is a hold variable, its contents are used.
Return the value of an object of type LISPTYPE_FIXNUM
to ret
.
lisp_get_float_
int lisp_get_float_(addr pos, float *ret);
: pos, real object
Input: ret, float value
Output: Non-zero when escaping. Return
If pos
is a hold variable, its contents are used.
If pos
is of single-float
type, the value is returned as ret
.
In the case of other real types, the value is cast to single-float
.
lisp_get_double_
int lisp_get_double_(addr pos, double *ret);
: pos, real object
Input: ret, double value
Output: Non-zero when escaping. Return
If pos
is a hold variable, its contents are used.
If pos
is of double-float
type, the value is returned as ret
.
In the case of other real types, the value is cast to double-float
.
lisp_get_long_double_
int lisp_get_long_double_(addr pos, long double *ret);
: pos, real object
Input: ret, long double value
Output: Non-zero when escaping. Return
If pos
is a hold variable, its contents are used.
If pos
is of long-float
type, the value is returned as ret
.
In the case of other real types, the value is cast to long-float
.
Function of the package.
int lisp_package_(addr x, addr pos);
int lisp_package8_(addr x, const void *str);
int lisp_package16_(addr x, const void *str);
int lisp_package32_(addr x, const void *str);
lisp_package_
int lisp_package_(addr x, addr pos);
: pos, package-designator
Input: x, hold variable
Output: Non-zero when escaping. Return
If pos
is a hold variable, its contents are used.
Returns the package represented by pos
.
lisp_package8_
int lisp_package8_(addr x, const void *str);
int lisp_package16_(addr x, const void *str);
int lisp_package32_(addr x, const void *str);
: str, Unicode strings
Input: x, hold variable
Output: Non-zero when escaping. Return
Return the package represented by str
.
See the lisp_string8_
function for details on Unicode strings.
lisp_package16_
See lisp_package8_
.
lisp_package32_
See lisp_package8_
.
Function of the intern.
int lisp_intern_(addr x, addr package, addr name);
int lisp_intern8_(addr x, const void *package, const void *name);
int lisp_intern16_(addr x, const void *package, const void *name);
int lisp_intern32_(addr x, const void *package, const void *name);
lisp_intern_
int lisp_intern_(addr x, addr package, addr name);
: package, package-designator or nil
Input: name, string object
Input: x, hold variable
Output: Non-zero when escaping. Return
Intern the package
with the symbol represented by the name
. If package
is nil
or NULL
, the value of *package*
is used.
If package
, name
is a hold variable, its contents are used.
lisp_intern8_
int lisp_intern8_(addr x, const void *package, const void *name);
int lisp_intern16_(addr x, const void *package, const void *name);
int lisp_intern32_(addr x, const void *package, const void *name);
: package, Unicode strings or NULL
Input: name, Unicode strings
Input: x, hold variable
Output: Non-zero when escaping. Return
Intern the package
with the symbol represented by the name
. If package
is nil
or NULL
, the value of *package*
is used.
See the lisp_string8_
function for details on Unicode strings.
lisp_intern16_
See lisp_intern8_
.
lisp_intern32_
See lisp_intern8_
.
Function of the reader.
int lisp_reader_(addr x, addr str);
int lisp_reader8_(addr x, const void *str);
int lisp_reader16_(addr x, const void *str);
int lisp_reader32_(addr x, const void *str);
lisp_reader_
int lisp_reader_(addr x, addr str);
: str, string object
Input: x, hold variable
Output: Non-zero when escaping. Return
Reads the string str
in the reader.
This is equivalent to the read-from-string
function.
If nothing can be read, NULL
is returned.
The function lisp_null_p
can be used to check whether the value is null or not.
If str
is a hold variable, the contents are used.
lisp_reader8_
int lisp_reader8_(addr x, const void *str);
int lisp_reader16_(addr x, const void *str);
int lisp_reader32_(addr x, const void *str);
: str, unicode strings
Input: x, hold variable
Output: Non-zero when escaping. Return
Reads the string str
in the reader.
This is equivalent to the read-from-string
function.
If nothing can be read, NULL
is returned.
The function lisp_null_p
can be used to check whether the value is null or not.
See the lisp_string8_
function for details on Unicode strings.
lisp_reader16_
See lisp_reader8_
.
lisp_reader32_
See lisp_reader8_
.
Function of the pathname.
int lisp_pathname_(addr x, addr name);
int lisp_pathname8_(addr x, const void *str);
int lisp_pathname16_(addr x, const void *str);
int lisp_pathname32_(addr x, const void *str);
int lisp_namestring_(addr x, addr path);
lisp_pathname_
int lisp_pathname_(addr x, addr name);
: name, pathname-designator
Input: x, hold variable
Output: Non-zero when escaping. Return
Converts the string name
to a pathname.
This is equivalent to the parse-namestring
function.
If name
is a hold variable, the contents are used.
lisp_pathname8_
int lisp_pathname8_(addr x, const void *str);
int lisp_pathname16_(addr x, const void *str);
int lisp_pathname32_(addr x, const void *str);
: str, unicode strings
Input: x, hold variable
Output: Non-zero when escaping. Return
Converts the string name
to a pathname.
This is equivalent to the parse-namestring
function.
See the lisp_string8_
function for details on Unicode strings.
lisp_pathname16_
See lisp_pathname8_
.
lisp_pathname32_
See lisp_pathname8_
.
lisp_namestring_
int lisp_namestring_(addr x, addr path);
: path, pathname-designator
Input: x, hold variable
Output: Non-zero when escaping. Return
Convert the pathname object path
to a string.
This is equivalent to the namestring
function.
If name
is a hold variable, the contents are used.