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

📄 refw.html

📁 A very small LISP implementation with several packages and demo programs.
💻 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>W</title><link rel="stylesheet" href="doc.css" type="text/css"></head><body><h1>W</h1><dl><dt><a name="wait"><code>(wait ['cnt] . prg) -> any</code></a><dd>Waits for a condition. While the result of the execution of <code>prg</code>returns non-<code>NIL</code>, a <code>select</code> system call is executed forall file descriptors and timers in the <code>VAL</code> of the global variable<code><a href="refR.html#*Run">*Run</a></code>. When <code>cnt</code> isnon-<code>NIL</code>, the waiting time is limited to <code>cnt</code>milliseconds. See also <code><a href="refK.html#key">key</a></code> and <code><ahref="refS.html#sync">sync</a></code>.<p><pre><code>: (wait 2000)                                # Wait 2 seconds-> NIL: (prog   (zero *Cnt)   (setq *Run                                # Install background loop      '((-2000 0 (println (inc '*Cnt)))) )   # Increment '*Cnt' every 2 sec   (wait NIL (> *Cnt 6))                     # Wait until > 6   (off *Run) )1                                            # Waiting ..234567-> NIL</code></pre><dt><a name="week"><code>(week 'dat) -> num</code></a><dd>Returns the number of the week for a given <code><ahref="refD.html#date">date</a></code> <code>dat</code>. See also <code><ahref="refD.html#day">day</a></code>, <code><ahref="refU.html#ultimo">ultimo</a></code>, <code><ahref="refD.html#datStr">datStr</a></code> and <code><ahref="refS.html#strDat">strDat</a></code>.<p><pre><code>: (datStr (date))-> "2007-06-01": (week (date))-> 22</code></pre><dt><a name="when"><code>(when 'any . prg) -> any</code></a><dd>Conditional execution: When the condition <code>any</code> evaluates tonon-<code>NIL</code>, <code>prg</code> is executed and the result is returned.Otherwise <code>NIL</code> is returned. See also <code><ahref="refU.html#unless">unless</a></code>.<p><pre><code>: (when (> 4 3) (println 'Ok) (println 'Good))OkGood-> Good</code></pre><dt><a name="while"><code>(while 'any . prg) -> any</code></a><dd>Conditional loop: While the condition <code>any</code> evaluates tonon-<code>NIL</code>, <code>prg</code> is repeatedly executed. If<code>prg</code> is never executed, <code>NIL</code> is returned. Otherwise theresult of <code>prg</code> is returned. See also <code><ahref="refU.html#until">until</a></code>.<p><pre><code>: (while (read)   (println 'got: @) )abcgot: abc1234got: 1234NIL-> 1234</code></pre><dt><a name="wipe"><code>(wipe 'sym|lst) -> sym|lst</code></a><dd>Clears the <code>VAL</code> and the property list of <code>sym</code>, or ofall symbols in the list <code>lst</code>. When a symbol is an external symbol,its state is also set to "not loaded". Does nothing when <code>sym</code> is anexternal symbol that has been modified or deleted ("dirty").<p><pre><code>: (setq A (1 2 3 4))-> (1 2 3 4): (put 'A 'a 1)-> 1: (put 'A 'b 2)-> 2: (show 'A)A (1 2 3 4)   b 2   a 1-> A: (wipe 'A)-> A: (show 'A)A NIL-> A</code></pre><dt><a name="with"><code>(with 'sym . prg) -> any</code></a><dd>Saves the current object <code>This</code> and sets it to the new value<code>sym</code>. Then <code>prg</code> is executed, and <code>This</code> isrestored to its previous value. The return value is the result of<code>prg</code>. Used typically to access the local data of <code>sym</code> inthe same manner as inside a method body. <code>prg</code> is not executed (and<code>NIL</code> is returned) when <code>sym</code> is <code>NIL</code>.<code>(with 'X . prg)</code> is equivalent to <code>(let? This 'X . prg)</code>.<p><pre><code>: (put 'X 'a 1)-> 1: (put 'X 'b 2)-> 2: (with 'X (list (: a) (: b)))-> (1 2)</code></pre><dt><a name="wr"><code>(wr 'num ..) -> num</code></a><dd>Writes all <code>num</code> arguments as raw bytes to the current outputchannel. See also <code><a href="refR.html#rd">rd</a></code> and <code><ahref="refP.html#pr">pr</a></code>.<p><pre><code>: (out "x" (wr 1 255 257))                   # Write to "x"-> 257: (hd "x")00000000  01 FF 01                                         ...-> NIL</code></pre><dt><a name="wrap"><code>(wrap 'cnt 'lst) -> sym</code></a><dd>Returns a transient symbol with all characters in <code>lst</code> <code><ahref="refP.html#pack">pack</a></code>ed in lines with a maximal length of<code>cnt</code>. See also <code><a href="refT.html#tab">tab</a></code>,<code><a href="refA.html#align">align</a></code> and <code><ahref="refC.html#center">center</a></code>.<p><pre><code>: (wrap 20 (chop "The quick brown fox jumps over the lazy dog"))-> "The quick brown fox^Jjumps over the lazy^Jdog": (wrap 8 (chop "The quick brown fox jumps over the lazy dog"))-> "The^Jquick^Jbrown^Jfox^Jjumps^Jover the^Jlazy dog"</code></pre></dl></body></html>

⌨️ 快捷键说明

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