📄 refg.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>G</title><link rel="stylesheet" href="doc.css" type="text/css"></head><body><h1>G</h1><dl><dt><a name="gc"><code>(gc ['cnt]) -> cnt | NIL</code></a><dd>Forces a garbage collection. When <code>cnt</code> is given, so manymegabytes of free cells are reserved, increasing the heap size if necessary. If<code>cnt</code> is zero, all currently unused heap blocks are purged,decreasing the heap size if possible. See also <code><ahref="refH.html#heap">heap</a></code>.<p><pre><code>: (gc)-> NIL: (heap)-> 2: (gc 4)-> 4: (heap)-> 5</code></pre><dt><a name="ge0"><code>(ge0 'any) -> num | NIL</code></a><dd>Returns <code>num</code> when the argument is a number and greater or equalzero, otherwise <code>NIL</code>. See also <code><ahref="refG.html#gt0">gt0</a></code>, <code><ahref="refL.html#lt0">lt0</a></code>, <code><a href="ref_.html#=0">=0</a></code>and <code><a href="refN.html#n0">n0</a></code>.<p><pre><code>: (ge0 -2)-> NIL: (ge0 3)-> 3: (ge0 0)-> 0</code></pre><dt><a name="genKey"><code>(genKey 'var 'cls ['hook ['num1 ['num2]]]) -> num</code></a><dd>Generates a key for a database tree. If a minimal key <code>num1</code>and/or a maximal key <code>num2</code> is given, the next free number in thatrange is returned. Otherwise, the current maximal key plus one is returned. Seealso <code><a href="refU.html#useKey">useKey</a></code> and <code><ahref="refM.html#maxKey">maxKey</a></code>.<p><pre><code>: (maxKey (tree 'nr '+Item))-> 8: (genKey 'nr '+Item)-> 9</code></pre><dt><a name="get"><code>(get 'sym1|lst ['sym2|cnt ..]) -> any</code></a><dd>Fetches a value <code>any</code> from the properties of a symbol, or from alist. From the first argument <code>sym1|lst</code>, values are retrieved insuccessive steps by either extracting the value (if the next argument is zero)or a property (if the next argument is a symbol) from a symbol, the <code><ahref="refA.html#asoq">asoq</a></code>ed element (if the next argument is asymbol), the n'th element (if the next argument is a positive number) or then'th <code>CDR</code> (if the next argument is a negative number) from a list.See also <code><a href="refP.html#put">put</a></code> and <code><ahref="ref_.html#:">:</a></code>.<p><pre><code>: (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</code></pre><dt><a name="getd"><code>(getd 'any) -> fun | NIL</code></a><dd>Returns <code>fun</code> if <code>any</code> is a symbol that has a functiondefinition, otherwise <code>NIL</code>. See also <code><ahref="refF.html#fun?">fun?</a></code>.<p><pre><code>: (getd '+)-> 67327232: (getd 'getd)-> (("X") (and (sym? "X") (fun? (val "X")) (val "X"))): (getd 1)-> NIL</code></pre><dt><a name="getl"><code>(getl 'sym1|lst1 ['sym2|cnt ..]) -> lst</code></a><dd>Fetches the complete property list <code>lst</code> from a symbol. Thatsymbol is <code>sym1</code> (if no other arguments are given), or a symbol foundby applying the <code><a href="refG.html#get">get</a></code> algorithm to<code>sym1|lst1</code> and the following arguments. See also <code><ahref="refP.html#putl">putl</a></code> and <code><ahref="refM.html#maps">maps</a></code>.<p><pre><code>: (put 'X 'a 1)-> 1: (put 'X 'b 2)-> 2: (put 'X 'flg T)-> T: (getl 'X)-> (flg (2 . b) (1 . a))</code></pre><dt><a name="glue"><code>(glue 'any 'lst) -> sym</code></a><dd>Builds a new transient symbol (string) by <code><ahref="refP.html#pack">pack</a></code>ing the <code>any</code> argument betweenthe individual elements of <code>lst</code>. See also <code><ahref="refT.html#text">text</a></code>.<p><pre><code>: (glue "," '(a b c d))-> "a,b,c,d"</code></pre><dt><a name="goal"><code>(goal '([sym 'any ..] . lst) ['sym 'any ..]) -> lst</code></a><dd>Constructs a <a href="ref.html#pilog">Pilog</a> query list from the list ofclauses <code>lst</code>. The head of the argument list may consist of asequence of symbols and expressions, which are used together with the optional<code>sym</code> and <code>any</code> arguments to form an initial environment.See also <code><a href="refP.html#prove">prove</a></code>.<p><pre><code>: (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)))</code></pre><dt><a name="group"><code>(group 'lst) -> lst</code></a><dd>Builds a list of lists, by grouping all elements of <code>lst</code> withthe same CAR into a common sublist. See also <ahref="ref.html#cmp">Comparing</a>, <code><ahref="refS.html#sort">sort</a></code> and <code><ahref="refU.html#uniq">uniq</a></code>.<p><pre><code>: (group '((1 . a) (1 . b) (1 . c) (2 . d) (2 . e) (2 . f)))-> ((1 a b c) (2 d e f))</code></pre><dt><a name="gt0"><code>(gt0 'any) -> num | NIL</code></a><dd>Returns <code>num</code> when the argument is a number and greater thanzero, otherwise <code>NIL</code>. See also <code><ahref="refG.html#ge0">ge0</a></code>, <code><ahref="refL.html#lt0">lt0</a></code>, <code><a href="ref_.html#=0">=0</a></code>and <code><a href="refN.html#n0">n0</a></code>.<p><pre><code>: (gt0 -2)-> NIL: (gt0 3)-> 3</code></pre></dl></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -