keithlisp/doc/stdlib_misc.md

33 lines
758 B
Markdown
Raw Normal View History

2021-09-23 13:51:39 +00:00
# Miscellaneous Functions
## `type-of`
```
(type-of value)
```
`type-of` returns an atom indicating the type of `value`, or nil if
`value` is nil.
## `addr-of`
```
(addr-of value)
```
`addr-of` returns the raw immediate value of its argument as an int. For
conses, strings, and funptrs, this is their memory address (hence the
name). For ints, floats, and atoms, this returns their raw bytes
interpreted as a signed 2's-complement integer.
## `set`
```
(set atom value)
```
2021-09-23 16:57:26 +00:00
`set` changes the value associated with `atom` in the syms-alist, or
creates the association if it does not already exist. It then returns
`value`.
2021-09-23 13:51:39 +00:00
## `fun`
```
(fun atom)
```
2021-09-23 16:57:26 +00:00
`fun` returns the function associated with `atom` in the funs-alist, or
nil if no such function exists.