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

📄 refl.html

📁 A very small LISP implementation with several packages and demo programs.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<dt><a name="list"><code>(list 'any ..) -> lst</code></a><dd>Returns a list of all <code>any</code> arguments.<p><pre><code>: (list 1 2 3 4)-> (1 2 3 4): (list 'a (2 3) "Ok")-> (a (2 3) "Ok")</code></pre><dt><a name="lst?"><code>(lst? 'any) -> flg</code></a><dd>Returns <code>T</code> when the argument <code>any</code> is a (possiblyempty) list (<code>NIL</code> or a cons pair cell). See also <code><ahref="refP.html#pair">pair</a></code>.<p><pre><code>: (lst? NIL)-> T: (lst? (1 . 2))-> T: (lst? (1 2 3))-> T</code></pre><dt><a name="listen"><code>(listen 'cnt1 ['cnt2]) -> cnt | NIL</code></a><dd>Listens at a socket descriptor <code>cnt1</code> (as received by <code><ahref="refP.html#port">port</a></code>) for an incoming connection, and returnsthe new socket descriptor <code>cnt</code>. While waiting for a connection, a<code>select</code> system call is executed for all file descriptors and timersin the <code>VAL</code> of the global variable <code><ahref="refR.html#*Run">*Run</a></code>. If <code>cnt2</code> isnon-<code>NIL</code>, that amount of milliseconds is waited maximally, and<code>NIL</code> is returned upon timeout. The global variable <code>*Adr</code>is set to the IP address of the client. See also <code><ahref="refA.html#accept">accept</a></code>, <code><ahref="refC.html#connect">connect</a></code>, <code><ahref="refN.html#nagle">nagle</a></code> and <code><ahref="refA.html#*Adr">*Adr</a></code>.<p><pre><code>: (setq *Socket   (listen (port 6789) 60000) )  # Listen at port 6789 for max 60 seconds-> 4: *Adr-> "127.0.0.1"</code></pre><dt><a name="lit"><code>(lit 'any) -> any</code></a><dd>Returns the literal (i.e. quoted) value of <code>any</code>, by<code>cons</code>ing it with the <code><ahref="refQ.html#quote">quote</a></code> function if necessary.<p><pre><code>: (lit T)-> T: (lit 1)-> 1: (lit '(1))-> (1): (lit '(a))-> '(a)</code></pre><dt><a name="load"><code>(load 'any ..) -> any</code></a><dd>Loads all <code>any</code> arguments. Normally, the name of each argument istaken as a file to be executed in a read-eval loop. The argument semantics areidentical to that of <code><a href="refI.html#in">in</a></code>, with theexception that if an argument is a symbol and its first character is a hyphen'-', then that argument is parsed as a function call (without the surroundingparentheses). When <code>any</code> is <code>T</code>, all remaining commandline arguments are loaded recursively. When <code>any</code> is<code>NIL</code>, standard input is read, a prompt is issued before each readoperation, the results are printed to standard output (read-eval-print loop),and <code>load</code> terminates when an empty line is entered. In any case,<code>load</code> terminates upon end of file, or when <code>NIL</code> is read.The hash table for transient symbols is cleared before and after the load, sothat all transient symbols in the file have a local scope. Returns the value ofthe last evaluated expression. See also <code><ahref="refI.html#ipid">ipid</a></code>, <code><ahref="refC.html#call">call</a></code>, <code><ahref="refI.html#in">in</a></code>, <code><ahref="refO.html#out">out</a></code> and <code><ahref="refS.html#str">str</a></code>.<p><pre><code>: (load "lib.l" "-* 1 2 3")-> 6</code></pre><dt><a name="loc"><code>(loc 'sym 'lst) -> sym</code></a><dd>Locates in <code>lst</code> a <code><ahref="ref.html#transient">transient</a></code> symbol with the same name as<code>sym</code>. Allows to get hold of otherwise inaccessible symbols. See also<code><a href="ref_.html#====">====</a></code>.<p><pre><code>: (loc "X" curry)-> "X": (== @ "X")-> NIL</code></pre><dt><a name="locale"><code>(locale 'sym1 'sym2 ['sym3])</code></a><dd>Sets the current locale to that given by the country file <code>sym1</code>and the language file <code>sym2</code> (both located in the "loc/" directory),and an optional application-specific directory <code>sym3</code>. The localeinfluences the language, and numerical, date and other formats. See also<code><a href="refU.html#*Uni">*Uni</a></code>, <code><ahref="refD.html#datStr">datStr</a></code>, <code><ahref="refS.html#strDat">strDat</a></code>, <code><ahref="refE.html#expDat">expDat</a></code>, <code><ahref="refD.html#day">day</a></code>, <code><ahref="refT.html#telStr">telStr</a></code>, <code><ahref="refE.html#expTel">expTel</a></code> and and <code><ahref="refM.html#money">money</a></code>.<p><pre><code>: (locale "DE" "de" "app/loc/")-> "Zip": ,"Yes"-> "Ja"</code></pre><dt><a name="lock"><code>(lock ['sym]) -> cnt | NIL</code></a><dd>Write-locks an external symbol <code>sym</code> (file record locking), orthe whole database root file if <code>sym</code> is <code>NIL</code>. Returns<code>NIL</code> if successful, or the ID of the process currently holding thelock. When <code>sym</code> is non-<code>NIL</code>, the lock is released at thenext top level call to <code><a href="refC.html#commit">commit</a></code> or<code><a href="refR.html#rollback">rollback</a></code>, otherwise only whenanother database is opened with <code><a href="refP.html#pool">pool</a></code>,or when the process terminates. See also <code><ahref="refS.html#*Solo">*Solo</a></code>.<p><pre><code>: (lock '{1})        # Lock single object-> NIL: (lock)             # Lock whole database-> NIL</code></pre><dt><a name="loop"><code>(loop ['any | (NIL 'any . prg) | (T 'any . prg) ..]) -> any</code></a><dd>Endless loop with multiple conditional exits: The body is executed anunlimited number of times. If a clause has <code>NIL</code> or <code>T</code> asits <code>CAR</code>, the clause's second element is evaluated as a conditionand - if the result is <code>NIL</code> or non-<code>NIL</code>, respectively -the <code>prg</code> is executed and the result returned. See also <code><ahref="refD.html#do">do</a></code> and <code><ahref="refF.html#for">for</a></code>.<p><pre><code>: (let N 3   (loop      (prinl N)      (T (=0 (dec 'N)) 'done) ) )321-> done</code></pre><dt><a name="low?"><code>(low? 'any) -> sym | NIL</code></a><dd>Returns <code>any</code> when the argument is a string (symbol) that startswith a lowercase character. See also <code><ahref="refL.html#lowc">lowc</a></code>.<p><pre><code>: (low? "a")-> "a": (low? "A")-> NIL: (low? 123)-> NIL: (low? ".")-> NIL</code></pre><dt><a name="lowc"><code>(lowc 'any) -> any</code></a><dd>Lower 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 lower case, is returned. See also <code><ahref="refU.html#uppc">uppc</a></code>, <code><ahref="refF.html#fold">fold</a></code> and <code><ahref="refL.html#low?">low?</a></code>.<p><pre><code>: (lowc 123)-> 123: (lowc "ABC")-> "abc"</code></pre><dt><a name="lt0"><code>(lt0 'any) -> num | NIL</code></a><dd>Returns <code>num</code> when the argument is a number and less than zero,otherwise <code>NIL</code>. See also <code><ahref="refG.html#ge0">ge0</a></code>, <code><ahref="refG.html#gt0">gt0</a></code>, <code><a href="ref_.html#=0">=0</a></code>and <code><a href="refN.html#n0">n0</a></code>.<p><pre><code>: (lt0 -2)-> -2: (lt0 3)-> NIL</code></pre><dt><a name="lup"><code>(lup 'lst 'any) -> lst<br>(lup 'lst 'any 'any2) -> lst</code></a><dd>Looks up <code>any</code> in the CAR-elements of cells stored in the indextree <code>lst</code>, as built-up by <code><ahref="refI.html#idx">idx</a></code>. In the first form, the first found cell isreturned, in the second form a list of all cells whose CAR is in the range<code>any</code> .. <code>any2</code>. See also <code><ahref="refA.html#assoc">assoc</a></code>.<p><pre><code>: (idx 'A 'a T)-> NIL: (idx 'A (1 . b) T)-> NIL: (idx 'A 123 T)-> NIL: (idx 'A (1 . a) T)-> NIL: (idx 'A (1 . c) T)-> NIL: (idx 'A (2 . d) T)-> NIL: (idx 'A)-> (123 a (1 . a) (1 . b) (1 . c) (2 . d)): (lup A 1)-> (1 . b): (lup A 2)-> (2 . d): (lup A 1 1)-> ((1 . a) (1 . b) (1 . c)): (lup A 1 2)-> ((1 . a) (1 . b) (1 . c) (2 . d))</code></pre></dl></body></html>

⌨️ 快捷键说明

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