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

📄 reft.html

📁 A very small LISP implementation with several packages and demo programs.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
-> "10:57:56"</code></pre><dt><a name="timeout"><code>(timeout ['num])</code></a><dd>Sets or refreshes a timeout value in the <code><ahref="refR.html#*Run">*Run</a></code> global, so that the current processexecutes <code><a href="refB.html#bye">bye</a></code> after the given period. Ifcalled without arguments, the timeout is removed. See also <code><ahref="refT.html#task">task</a></code>.<p><pre><code>: (timeout 3600000)           # Timeout after one hour-> (-1 3600000 (bye)): *Run                        # Look after a few seconds-> ((-1 3574516 (bye)))</code></pre><dt><a name="throw"><code>(throw 'sym 'any)</code></a><dd>Non-local jump into a previous <code><ahref="refC.html#catch">catch</a></code> environment with the jump label<code>sym</code> (or <code>T</code> as a catch-all). Any pending <code><ahref="refF.html#finally">finally</a></code> expressions are executed, localsymbol bindings are restored, open files are closed and internal data structuresare reset appropriately, as the environment was at the time when thecorresponding <code>catch</code> was called. Then <code>any</code> is returnedfrom that <code>catch</code>.<p><pre><code>: (de foo (N)   (println N)   (throw 'Ok) )-> foo: (let N 1  (catch 'Ok (foo 7))  (println N))71-> 1</code></pre><dt><a name="tick"><code>(tick (cnt1 . cnt2) . prg) -> any</code></a><dd>Executes <code>prg</code>, then (destructively) adds the number of elapseduser ticks to the <code>cnt1</code> parameter, and the number of elapsed systemticks to the <code>cnt2</code> parameter. Thus, <code>cnt1</code> and<code>cnt2</code> will finally contain the total number of user and system timeticks spent in <code>prg</code> and all functions called (this works also forrecursive functions). For execution profiling, <code>tick</code> is usuallyinserted into words with <code>prof</code>, and removed with<code>unprof</code>. See also <code><a href="refU.html#usec">usec</a></code>.<p><pre><code>: (de foo ()                        # Define function with empty loop   (tick (0 . 0) (do 100000000)) )-> foo: (foo)                             # Execute it-> NIL: (pp 'foo)(de foo NIL   (tick (97 . 0) (do 100000000)) ) # 'tick' incremented 'cnt1' by 97-> foo</code></pre><dt><a name="till"><code>(till 'any ['flg]) -> lst|sym</code></a><dd>Reads from the current input channel till a character contained in<code>any</code> is found (or until end of file if <code>any</code> is<code>NIL</code>). If <code>flg</code> is <code>NIL</code>, a list ofsingle-character transient symbols is returned. Otherwise, a single string isreturned. See also <code><a href="refF.html#from">from</a></code> and <code><ahref="refL.html#line">line</a></code>.<p><pre><code>: (till ":")abc:def-> ("a" "b" "c"): (till ":" T)abc:def-> "abc"</code></pre><dt><a name="time"><code>(time ['T]) -> tim<br>(time 'tim) -> (h m s)<br>(time 'h 'm ['s]) -> tim | NIL<br>(time '(h m [s])) -> tim | NIL</code></a><dd>Calculates the time of day, represented as the number of seconds sincemidnight. When called without arguments, the current local time is returned.When called with a <code>T</code> argument, the current Coordinated UniversalTime (UTC) is returned. When called with a single number <code>tim</code>, it istaken as a time value and a list with the corresponding hour, minute and secondis returned. When called with two or three numbers (or a list of two or threenumbers) for the hour, minute (and optionally the second), the correspondingtime value is returned (or <code>NIL</code> if they do not represent a legaltime). See also <code><a href="refD.html#date">date</a></code>, <code><ahref="refU.html#usec">usec</a></code>, <code><ahref="refT.html#tim$">tim$</a></code> and <code><ahref="ref_.html#$tim">$tim</a></code>.<p><pre><code>: (time)                         # Now-> 32334: (time 32334)                   # Now-> (8 58 54): (time 25 30)                   # Illegal time-> NIL</code></pre><dt><a name="tmp"><code>(tmp ['any ..]) -> sym</code></a><dd>Returns the path name to the <code><ahref="refP.html#pack">pack</a></code>ed <code>any</code> arguments in aprocess-local temporary directory. The directory name consists of "tmp/"followed by the current process id <code><ahref="refP.html#*Pid">*Pid</a></code>. This directory is automatically createdif necessary, and removed upon termination of the process (<code><ahref="refB.html#bye">bye</a></code>). See also <code><ahref="refT.html#*Tmp">*Tmp</a></code> and <code><ahref="refB.html#*Bye">*Bye</a></code> .<p><pre><code>: *Bye-> ((saveHistory) (and *Tmp (call 'rm "-r" *Tmp))): *Pid-> 27140: (tmp "foo" 123)-> "tmp/27140/foo123": (dir "tmp/")-> ("27140"): (out (tmp "foo" 123) (println 'Ok))-> Ok: (dir (tmp))-> ("foo123"): (in (tmp "foo" 123) (read))-> Ok</code></pre><dt><a name="touch"><code>(touch 'sym) -> sym</code></a><dd>When <code>sym</code> is an external symbol, it is marked as "modified" sothat upon a later <code><a href="refC.html#commit">commit</a></code> it will bewritten to the database file. An explicit call of <code>touch</code> is onlynecessary when the value or properties of <code>sym</code> are indirectlymodified.<p><pre><code>: (get '{2} 'lst)-> (1 2 3 4 5): (set (cdr (get (touch '{2}) 'lst)) 999)    # Only read-access, need 'touch'-> 999: (get '{2} 'lst)                            # Modified second list element-> (1 999 3 4 5)</code></pre><dt><a name="trace"><code>(trace 'sym) -> sym<br>(trace 'sym 'cls) -> sym<br>(trace '(sym . cls)) -> sym</code></a><dd>Inserts <code><a href="ref_.html#$">$</a></code> trace function call at thebeginning of the function or method body of <code>sym</code>, so that traceinformation will be printed before and after execution. Built-in functions(C-function pointer) are automatically converted to Lisp expressions (see<code><a href="refE.html#expr">expr</a></code>). See also <code><ahref="refD.html#*Dbg">*Dbg</a></code>, <code><ahref="refD.html#debug">debug</a></code> and <code><ahref="refL.html#lint">lint</a></code>.<p><pre><code>: (trace '+)-> +: (+ 3 4) + : 3 4 + = 7-> 7</code></pre><dt><a name="tree"><code>(tree 'var 'cls ['hook]) -> tree</code></a><dd>Returns a data structure specifying a database index tree. <code>var</code>and <code>cls</code> determine the relation, with an optional <code>hook</code>object. See also <code><a href="refR.html#root">root</a></code>, <code><ahref="refF.html#fetch">fetch</a></code>, <code><ahref="refS.html#store">store</a></code>, <code><ahref="refC.html#count">count</a></code>, <code><ahref="refL.html#leaf">leaf</a></code>, <code><ahref="refM.html#minKey">minKey</a></code>, <code><ahref="refM.html#maxKey">maxKey</a></code>, <code><ahref="refI.html#init">init</a></code>, <code><ahref="refS.html#step">step</a></code>, <code><ahref="refS.html#scan">scan</a></code>, <code><ahref="refI.html#iter">iter</a></code>, <code><ahref="refP.html#prune">prune</a></code>, <code><ahref="refZ.html#zapTree">zapTree</a></code> and <code><ahref="refC.html#chkTree">chkTree</a></code>.<p><pre><code>: (tree 'nm '+Item)-> (nm . +Item)</code></pre><dt><a name="trim"><code>(trim 'lst) -> lst</code></a><dd>Returns a copy of <code>lst</code> with all trailing white space charactersor <code>NIL</code> elements removed. See also <code><ahref="refC.html#clip">clip</a></code>.<p><pre><code>: (trim (1 NIL 2 NIL NIL))-> (1 NIL 2): (trim '(a b " " " "))-> (a b)</code></pre><dt><a name="try"><code>(try 'msg 'obj ['any ..]) -> any</code></a><dd>Tries to send the message <code>msg</code> to the object <code>obj</code>,optionally with arguments <code>any</code>. If <code>any</code> is not anobject, or if the message cannot be located in <code>obj</code>, its classes andsuperclasses, <code>NIL</code> is returned. See also <code><ahref="ref.html#oop">OO Concepts</a></code>, <code><ahref="refS.html#send">send</a></code>, <code><ahref="refM.html#method">method</a></code>, <code><ahref="refM.html#meth">meth</a></code>, <code><ahref="refS.html#super">super</a></code> and <code><ahref="refE.html#extra">extra</a></code>.<p><pre><code>: (try 'msg> 123)-> NIL: (try 'html> 'a)-> NIL</code></pre><dt><a name="type"><code>(type 'any) -> lst</code></a><dd>Return the type (list of classes) of the object <code>sym</code>. See also<code><a href="ref.html#oop">OO Concepts</a></code>, <code><ahref="refI.html#isa">isa</a></code>, <code><ahref="refC.html#class">class</a></code>, <code><ahref="refN.html#new">new</a></code> and <code><ahref="refO.html#object">object</a></code>.<p><pre><code>: (type '{1A;3})(+Address): (type '+DnButton)-> (+Tiny +Rid +JS +Able +Button)</code></pre></dl></body></html>

⌨️ 快捷键说明

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