- (gc ['cnt [cnt2]]) -> cnt | NIL
- Forces a garbage collection. When cntis given, so many
megabytes of free cells are reserved, increasing the heap size if necessary. Ifcntis zero, all currently unused heap blocks are purged,
decreasing the heap size if possible. Ifcnt2is given, the reserve
size (defaults to 1 megabyte) is set to that value. See alsoheap.
: (gc)
-> NIL
: (heap)
-> 2
: (gc 4)
-> 4
: (heap)
-> 5
 
- (ge0 'any) -> num | NIL
- Returns numwhen the argument is a number and greater or equal
zero, otherwiseNIL. See alsolt0,le0,gt0,=0andn0.
: (ge0 -2)
-> NIL
: (ge0 3)
-> 3
: (ge0 0)
-> 0
 
- (genKey 'sym 'cls ['hook ['num1 ['num2]]]) -> num
- Generates a key for a database tree. If a minimal key num1and/or a maximal keynum2is given, the next free number in that
range is returned. Otherwise, the current maximal key plus one is returned. See
alsouseKey,genStrKeyandmaxKey.
: (maxKey (tree 'nr '+Item))
-> 8
: (genKey 'nr '+Item)
-> 9
 
- (genStrKey 'sym 'sym 'cls ['hook]) -> sym
- Generates a unique string for a database tree, by prepending as many "# "
sequences as necessary. See also genKey.
: (genStrKey "ben" 'nm '+User)
-> "# ben"
 
- (get 'sym1|lst ['sym2|cnt ..]) -> any
- Fetches a value anyfrom the properties of a symbol, or from a
list. From the first argumentsym1|lst, values are retrieved in
successive steps by either extracting the value (if the next argument is zero)
or a property from a symbol, the CDR of anasoqed element (if the next argument is a
symbol), the n'th element (if the next argument is a positive number) or the
n'th CDR (if the next argument is a negative number) from a list. See alsoput,;,:andnth.
: (put 'X 'a 1)
-> 1
: (get 'X 'a)
-> 1
: (put 'Y 'link 'X)
-> X
: (get 'Y 'link)
-> X
: (get 'Y 'link 'a)
-> 1
: (get '((a (b . 1) (c . 2)) (d (e . 3) (f . 4))) 'a 'b)
-> 1
: (get '((a (b . 1) (c . 2)) (d (e . 3) (f . 4))) 'd 'f)
-> 4
: (get '(X Y Z) 2)
-> Y
: (get '(X Y Z) 2 'link 'a)
-> 1
 
- (getd 'any) -> fun | NIL
- Returns funifanyis a symbol that has a function
definition, otherwiseNIL. See alsofun?.
: (getd '+)
-> 67327232
: (getd 'script)
-> ((File . @) (load File))
: (getd 1)
-> NIL
: ht:Fmt             # Initially undefined
-> NIL
: (getd 'ht:Fmt)     # Check shared library
-> 8790207171188
: ht:Fmt             # Now defined
-> 8790207171188
 
- (getl 'sym1|lst1 ['sym2|cnt ..]) -> lst
- Fetches the complete property list lstfrom a symbol. That
symbol issym1(if no other arguments are given), or a symbol found
by applying thegetalgorithm tosym1|lst1and the following arguments. See alsoputlandmaps.
: (put 'X 'a 1)
-> 1
: (put 'X 'b 2)
-> 2
: (put 'X 'flg T)
-> T
: (getl 'X)
-> (flg (2 . b) (1 . a))
 
- (glue 'any 'lst) -> sym
- Builds a new transient symbol (string) by packing theanyargument between
the individual elements oflst. See alsotext.
: (glue "," '(a b c d))
-> "a,b,c,d"
 
- (goal '([pat 'any ..] . lst) ['sym 'any ..]) -> lst
- Constructs a Pilog query list from the list of
clauses lst. The head of the argument list may consist of a
sequence of pattern symbols (Pilog variables) and expressions, which are used
together with the optionalsymandanyarguments to
form an initial environment. See alsoproveandfail.
: (goal '((likes John @X)))
-> (((1 (0) NIL ((likes John @X)) NIL T)))
: (goal '(@X 'John (likes @X @Y)))
-> (((1 (0) NIL ((likes @X @Y)) NIL ((0 . @X) 1 . John) T)))
 
- (group 'lst) -> lst
- Builds a list of lists, by grouping all elements of lstwith
the same CAR into a common sublist. See also Comparing,by,sortanduniq.
: (group '((1 . a) (1 . b) (1 . c) (2 . d) (2 . e) (2 . f)))
-> ((1 a b c) (2 d e f))
: (by name group '("x" "x" "y" "z" "x" "z"))
-> (("x" "x" "x") ("y") ("z" "z"))
: (by length group '(123 (1 2) "abcd" "xyz" (1 2 3 4) "XY"))
-> ((123 "xyz") ((1 2) "XY") ("abcd" (1 2 3 4))
 
- (gt0 'any) -> num | NIL
- Returns numwhen the argument is a number and greater than
zero, otherwiseNIL. See alsolt0,le0,ge0,=0andn0.
: (gt0 -2)
-> NIL
: (gt0 3)
-> 3