⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 refd.html

📁 A very small LISP implementation with several packages and demo programs.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
   (3 (+Ord nr dat cus) (+Pos itm)) )           # (8 . 512): *Dbs-> (1 2 1 0 2 3 3 3): (get '+Item 'dbf)-> (3 . 128): (get '+Item 'nr 'dbf)-> (7 . 512)</code></pre><dt><a name="dbs+"><code>(dbs+ 'num . lst)</code></a><dd>Extends the list of database sizes stored in <code><ahref="refD.html#*Dbs">*Dbs</a></code>. <code>num</code> is the initial offsetinto the list. See also <code><a href="refD.html#dbs">dbs</a></code>.<p><pre><code>(dbs+ 9   (1 +NewCls)                                  # (9 . 128)   (3 (+NewCls nr nm)) )                        # (10 . 512)</code></pre><dt><a name="de"><code>(de sym . any) -> sym</code></a><dd>Assigns a definition to the <code>sym</code> argument, by setting its<code>VAL</code> to the <code>any</code> argument. If the symbol has alreadyanother value, a "redefined" message is issued. When the value of the globalvariable <a href="refD.html#*Dbg">*Dbg</a> is non-<code>NIL</code>, the currentline number and file name (if any) are stored in the <code>*Dbg</code> propertyof <code>sym</code>. <code>de</code> is the standard way to define a function.See also <code><a href="refD.html#def">def</a></code>, <code><ahref="refD.html#dm">dm</a></code> and <code><ahref="refU.html#undef">undef</a></code>.<p><pre><code>: (de foo (X Y) (* X (+ X Y)))  # Define a function-> foo: (foo 3 4)-> 21: (de *Var . 123)  # Define a variable value: *Var-> 123</code></pre><dt><a name="debug"><code>(debug 'sym) -> T<br>(debug 'sym 'cls) -> T<br>(debug '(sym . cls)) -> T</code></a><dd>Inserts a <code><a href="ref_.html#!">!</a></code> breakpoint function callat the beginning and all top-level expressions of the function or method body of<code>sym</code>, to allow a stepwise execution. Typing <code>(d)</code> at abreakpoint will also debug the current subexpression, and <code>(<ahref="refE.html#e">e</a>)</code> will evaluate the current subexpression. Thecurrent subexpression is stored in the global variable <code><ahref="ref_.html#^">^</a></code>. See also <code><ahref="refD.html#*Dbg">*Dbg</a></code>, <code><ahref="refT.html#trace">trace</a></code> and <code><ahref="refL.html#lint">lint</a></code>.<p><pre><code>: (de tst (N)                    # Define tst   (println (+ 3 N)) )-> tst: (debug 'tst)                   # Set breakpoints-> T: (pp 'tst)(de tst (N)   (! println (+ 3 N)) )         # Breakpoint '!'-> tst: (tst 7)                        # Execute(println (+ 3 N))                # Stopped at beginning of 'tst'! (d)                            # Debug subexpression-> T!                                # Continue(+ 3 N)                          # Stopped in subexpression! N                              # Inspect variable 'N'-> 7!                                # Continue10                               # Output of print statement-> 10                            # Done: (unbug 'tst)-> T: (pp 'tst)                      # Restore to original(de tst (N)   (println (+ 3 N)) )-> tst</code></pre><dt><a name="dec"><code>(dec 'num) -> num<br>(dec 'var ['num]) -> num</code></a><dd>The first form returns the value of <code>num</code> decremented by 1. Thesecond form decrements the <code>VAL</code> of <code>var</code> by 1, or by<code>num</code>. <code>(dec 'num)</code> is equivalent to <code>(- 'num1)</code> and <code>(dec 'var)</code> is equivalent to <code>(set 'var (- var1))</code>.<p><pre><code>: (dec -1)-> -2: (dec 7)-> 6: (setq N 7)-> 7: (dec 'N)-> 6: (dec 'N 3)-> 3</code></pre><dt><a name="def"><code>(def 'sym 'any) -> sym<br>(def 'sym1 'sym2 'any) -> sym1</code></a><dd>The first form assigns a definition to the first <code>sym</code> argument,by setting its <code>VAL</code>'s to <code>any</code>. The second form defines aproperty value <code>any</code> for the first argument's <code>sym2</code> key.If any of these values existed and was changed in the process, a "redefined"message is issued. When the value of the global variable <ahref="refD.html#*Dbg">*Dbg</a> is non-<code>NIL</code>, the current line numberand file name (if any) are stored in the <code>*Dbg</code> property of<code>sym</code>. See also <code><a href="refD.html#de">de</a></code> and<code><a href="refD.html#dm">dm</a></code>.<p><pre><code>: (def 'b '((X Y) (* X (+ X Y))))-> b: (def 'b 999)# b redefined-> b</code></pre><dt><a name="default"><code>(default sym 'any ..) -> any</code></a><dd>Stores new values <code>any</code> in the <code>sym</code> arguments only iftheir current values are <code>NIL</code>. Otherwise, their values are leftunchanged. <code>default</code> is used typically in functions to initializeoptional arguments.<p><pre><code>: (de foo (A B)               # Function with two optional arguments   (default  A 1  B 2)        # The default values are 1 and 2   (list A B) )-> foo: (foo 333 444)               # Called with two arguments-> (333 444): (foo 333)                   # Called with one arguments-> (333 2): (foo)                       # Called without arguments-> (1 2)</code></pre><dt><a name="del"><code>(del 'any 'var) -> any</code></a><dd>Deletes <code>any</code> from the list in the value of <code>var</code>.<code>(del 'any 'var)</code> is equivalent to <code>(set 'var (delete 'anyvar))</code>. See also <code><a href="refD.html#delete">delete</a></code>,<code><a href="refC.html#cut">cut</a></code> and <code><ahref="refP.html#pop">pop</a></code>.<p><pre><code>: (setq S '((a b c) (d e f)))-> ((a b c) (d e f)): (del '(d e f) 'S)-> ((a b c)): (del 'b S)-> (a c)</code></pre><dt><a name="delete"><code>(delete 'any 'lst) -> lst</code></a><dd>Deletes <code>any</code> from <code>lst</code>. If <code>any</code> iscontained more than once in <code>lst</code>, only the first occurrence isdeleted. See also <code><a href="refD.html#delq">delq</a></code>, <code><ahref="refR.html#remove">remove</a></code> and <code><ahref="refI.html#insert">insert</a></code>.<p><pre><code>: (delete 2 (1 2 3))-> (1 3): (delete (3 4) '((1 2) (3 4) (5 6) (3 4)))-> ((1 2) (5 6) (3 4))</code></pre><dt><a name="delq"><code>(delq 'any 'lst) -> lst</code></a><dd>Deletes <code>any</code> from <code>lst</code>. If <code>any</code> iscontained more than once in <code>lst</code>, only the first occurrence isdeleted. <code><a href="ref_.html#==">==</a></code> is used for comparison(pointer equality). See also <code><a href="refD.html#delete">delete</a></code>,<code><a href="refA.html#asoq">asoq</a></code>, <code><ahref="refM.html#memq">memq</a></code> and <code><ahref="refM.html#mmeq">mmeq</a></code>.<p><pre><code>: (delq 'b '(a b c))-> (a c): (delq (2) (1 (2) 3))-> (1 (2) 3)</code></pre><dt><a name="diff"><code>(diff 'lst 'lst) -> lst</code></a><dd>Returns the difference of the <code>lst</code> arguments. See also <code><ahref="refS.html#sect">sect</a></code>.<p><pre><code>: (diff (1 2 3 4 5) (2 4))-> (1 3 5): (diff (1 2 3) (1 2 3))-> NIL</code></pre><dt><a name="dir"><code>(dir ['any]) -> lst</code></a><dd>Returns a list of all filenames in the directory <code>any</code>. Namesstarting with a dot '<code>.</code>' are ignored. See also <code><ahref="refC.html#cd">cd</a></code> and <code><ahref="refI.html#info">info</a></code>.<p><pre><code>: (filter '((F) (tail '(. c) (chop F))) (dir "src/"))-> ("main.c" "subr.c" "gc.c" "io.c" "big.c" "sym.c" "tab.c" "flow.c" ..</code></pre><dt><a name="dirname"><code>(dirname 'any) -> sym</code></a><dd>Returns the directory part of a path name <code>any</code>.See also <code><a href="refP.html#path">path</a></code>.<p><pre><code>: (dirname "a/b/c/d")-> "a/b/c"</code></pre><dt><a name="dm"><code>(dm sym . fun) -> sym<br>(dm (sym . cls) . fun) -> sym<br>(dm (sym sym [. cls]) . fun) -> sym</code></a><dd>Defines a method for the message <code>sym</code> in the current class,implicitly given by the value of the global variable <code><ahref="refC.html#*Class">*Class</a></code>, or - in the second form - for theexplicitly given class <code>cls</code>. In the third form, the class object isobtained by <code><a href="refG.html#get">get</a></code>ing <code>sym</code>from <code><a href="refC.html#*Class">*Class</a></code> (or <code>cls</code> ifgiven). If any of these methods existed and was changed in the process, a"redefined" message is issued. When the value of the global variable <ahref="refD.html#*Dbg">*Dbg</a> is non-<code>NIL</code>, the current line numberand file name (if any) are stored in the <code>*Dbg</code> property of<code>sym</code>. See also <code><a href="ref.html#oop">OO Concepts</a></code>,<code><a href="refD.html#de">de</a></code>, <code><ahref="refU.html#undef">undef</a></code>, <a href="refC.html#class">class</a>, <ahref="refR.html#rel">rel</a>, <a href="refV.html#var">var</a>, <ahref="refM.html#method">method</a>, <a href="refS.html#send">send</a> and <ahref="refT.html#try">try</a>.<p><pre><code>: (dm start> ()   (super)   (mapc 'start> (: fields))   (mapc 'start> (: arrays)) )</code></pre><dt><a name="do"><code>(do 'flg|num ['any | (NIL 'any . prg) | (T 'any . prg) ..]) -> any</code></a><dd>Counted loop with multiple conditional exits: The body is executed at most<code>num</code> times (or never (if the first argument is <code>NIL</code>), oran infinite number of times (if the first argument is <code>T</code>)). If aclause has <code>NIL</code> or <code>T</code> as its <code>CAR</code>, theclause's second element is evaluated as a condition and - if the result is<code>NIL</code> or non-<code>NIL</code>, respectively - the <code>prg</code> isexecuted and the result returned. Otherwise (if count drops to zero), the resultof the last expression is returned. See also <code><ahref="refL.html#loop">loop</a></code> and <code><ahref="refF.html#for">for</a></code>.<p><pre><code>: (do 4 (printsp 'Ok))Ok Ok Ok Ok -> Ok: (do 4 (printsp 'Ok) (T (= 3 3) (printsp 'done)))Ok done -> done</code></pre></dl></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -