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

📄 refu.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>U</title><link rel="stylesheet" href="doc.css" type="text/css"></head><body><h1>U</h1><dl><dt><a name="*Uni"><code>*Uni</code></a><dd>A global variable holding all unique data that were collected with the comma(<code>,</code>) read-macro. Typically used for localization. See also <code><ahref="ref.html#macro-io">Read-Macros</a></code> and <code><ahref="refL.html#locale">locale</a></code>.<p><pre><code>: (off *Uni)            # Clear-> NIL: ,"abc"                # Collect a transient symbol-> "abc": ,(1 2 3)              # Collect a list-> (1 2 3): *Uni-> ((1 2 3) "abc")</code></pre><dt><a name="udp"><code>(udp 'any1 'cnt 'any2) -> any<br>(udp 'cnt) -> any</code></a><dd>Simple unidirectional sending/receiving of UDP packets. In the first form,<code>any2</code> is sent to a UDP server listening at host <code>any1</code>,port <code>cnt</code>. In the second form, one item is received from a UDPsocket <code>cnt</code>, established with <code><ahref="refP.html#port">port</a></code>. See also <code><ahref="refC.html#connect">connect</a></code>.<p><pre><code># First session: (port T 6666)-> 3: (udp 3)  # Receive a datagram# Second session (on the same machine): (udp "localhost" 6666 '(a b c))-> (a b c)# First session-> (a b c)</code></pre><dt><a name="ultimo"><code>(ultimo 'y 'm) -> cnt</code></a><dd>Returns the <code><a href="refD.html#date">date</a></code> of the last dayof the month <code>m</code> in the year <code>y</code>. See also <code><ahref="refD.html#day">day</a></code> and <code><ahref="refW.html#week">week</a></code>.<p><pre><code>: (date (ultimo 2007 1))-> (2007 1 31): (date (ultimo 2007 2))-> (2007 2 28): (date (ultimo 2004 2))-> (2004 2 29): (date (ultimo 2000 2))-> (2000 2 29): (date (ultimo 1900 2))-> (1900 2 28)</code></pre><dt><a name="undef"><code>(undef 'sym) -> fun<br>(undef 'sym 'cls) -> fun<br>(undef '(sym . cls)) -> fun</code></a><dd>Undefines the function or method <code>sym</code>. Returns the previousdefinition. See also <code><a href="refD.html#de">de</a></code>, <code><ahref="refD.html#dm">dm</a></code>, <code><a href="refD.html#def">def</a></code>and <code><a href="refR.html#redef">redef</a></code>.<p><pre><code>: (de hello () "Hello world!")-> hello: hello-> (NIL "Hello world!"): (undef 'hello)-> (NIL "Hello world!"): hello-> NIL</code></pre><dt><a name="unify"><code>(unify 'any) -> lst</code></a><dd>Unifies <code>any</code> with the current <a href="ref.html#pilog">Pilog</a>environment at the current level and with a value of <code>NIL</code>, andreturns the new environment or <code>NIL</code> if not successful. See also<code><a href="refP.html#prove">prove</a></code> and <code><ahref="ref_.html#->">-&gt</a></code>.<p><pre><code>: (? (@A unify '(@B @C))) @A=(((NIL . @C) 0 . @C) ((NIL . @B) 0 . @B) T)</code></pre><dt><a name="uniq"><code>(uniq 'lst) -> lst</code></a><dd>Returns a unique list, by eleminating all duplicate elements from<code>lst</code>. See also <a href="ref.html#cmp">Comparing</a>, <code><ahref="refS.html#sort">sort</a></code> and <code><ahref="refG.html#group">group</a></code>.<p><pre><code>: (uniq (2 4 6 1 2 3 4 5 6 1 3 5))-> (2 4 6 1 3 5)</code></pre><dt><a name="unless"><code>(unless 'any . prg) -> any</code></a><dd>Conditional execution: When the condition <code>any</code> evaluates tonon-<code>NIL</code>, <code>NIL</code> is returned. Otherwise <code>prg</code>is executed and the result returned. See also <code><ahref="refW.html#when">when</a></code>.<p><pre><code>: (unless (= 3 3) (println 'Strange 'result))-> NIL: (unless (= 3 4) (println 'Strange 'result))Strange result-> result</code></pre><dt><a name="until"><code>(until 'any . prg) -> any</code></a><dd>Conditional loop: While the condition <code>any</code> evaluates to<code>NIL</code>, <code>prg</code> is repeatedly executed. If <code>prg</code>is never executed, <code>NIL</code> is returned. Otherwise the result of<code>prg</code> is returned. See also <code><ahref="refW.html#while">while</a></code>.<p><pre><code>: (until (=T (setq N (read)))   (println 'square (* N N)) )4square 169square 81T-> 81</code></pre><dt><a name="up"><code>(up [cnt] sym ['val]) -> any</code></a><dd>Looks up (or modifies) the <code>cnt</code>th previously saved value of<code>sym</code> in the corresponding enclosing environment. If <code>cnt</code>is not given, 1 is used. See also <code><ahref="refE.html#eval">eval</a></code>, <code><ahref="refR.html#run">run</a></code> and <code><ahref="refE.html#env">env</a></code>.<p><pre><code>: (let N 1 ((quote (N) (println N (up N))) 2))2 1-> 1: (let N 1 ((quote (N) (println N (up N) (up N 7))) 2) N)2 1 7-> 7</code></pre><dt><a name="upp?"><code>(upp? 'any) -> sym | NIL</code></a><dd>Returns <code>any</code> when the argument is a string (symbol) that startswith an uppercase character. See also <code><ahref="refU.html#uppc">uppc</a></code>.<p><pre><code>: (upp? "A")-> T: (upp? "a")-> NIL: (upp? 123)-> NIL: (upp? ".")-> NIL</code></pre><dt><a name="uppc"><code>(uppc 'any) -> any</code></a><dd>Upper case conversion: If <code>any</code> is not a symbol, it is returnedas it is. Otherwise, a new transient symbol with all characters of<code>any</code>, converted to upper case, is returned. See also <code><ahref="refL.html#lowc">lowc</a></code>, <code><ahref="refF.html#fold">fold</a></code> and <code><ahref="refU.html#upp?">upp?</a></code>.<p><pre><code>: (uppc 123)-> 123: (uppc "abc")-> "ABC": (uppc 'car)-> "CAR"</code></pre><dt><a name="use"><code>(use sym . prg) -> any<br>(use (sym ..) . prg) -> any</code></a><dd>Defines local variables. The value of the symbol <code>sym</code> - or thevalues of the symbols <code>sym</code> in the list of the second form - aresaved, <code>prg</code> is executed, then the symbols are restored to theiroriginal values. During execution of <code>prg</code>, the values of the symbolscan be temporarily modified. The return value is the result of <code>prg</code>.See also <code><a href="refB.html#bind">bind</a></code>, <code><ahref="refJ.html#job">job</a></code> and <code><ahref="refL.html#let">let</a></code>.<p><pre><code>: (setq  X 123  Y 456)-> 456: (use (X Y) (setq  X 3  Y 4) (* X Y))-> 12: X-> 123: Y-> 456</code></pre><dt><a name="useKey"><code>(useKey 'var 'cls ['hook]) -> num</code></a><dd>Generates or reuses a key for a database tree, by randomly trying to locatea free number. See also <code><a href="refG.html#genKey">genKey</a></code>.<p><pre><code>: (maxKey (tree 'nr '+Item))-> 8: (useKey 'nr '+Item)-> 12</code></pre><dt><a name="usec"><code>(usec) -> num</code></a><dd>Returns the number the microseconds since interpreter startup. See also<code><a href="refT.html#time">time</a></code> and <code><ahref="refT.html#tick">tick</a></code>.<p><pre><code>: (usec)-> 1154702479219050</code></pre></dl></body></html>

⌨️ 快捷键说明

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