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

📄 refs.html

📁 A very small LISP implementation with several packages and demo programs.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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>S</title><link rel="stylesheet" href="doc.css" type="text/css"></head><body><h1>S</h1><dl><dt><a name="*Scl"><code>*Scl</code></a><dd>A global variable holding the current fixed-point input scale. See also <ahref="ref.html#num-io">Numbers</a> and <code><ahref="refS.html#scl">scl</a></code>.<p><pre><code>: (str "123.45")                 # Default value of '*Scl' is 0-> (123): (setq *Scl 3)-> 3: (str "123.45")-> (123450)</code></pre><dt><a name="*Sig1"><code>*Sig1</code></a><dt><a name="*Sig2"><code>*Sig2</code></a><dd>Global variables holding (possibly empty) <code>prg</code> bodies, whichwill be executed when a SIGUSR1 signal (or a SIGUSR2 signal, respectively) issent to the current process. Note that this mechanism is "unreliable", in theway that when a second signal (it may be SIGHUP, SIGINT, another SIGUSR1/2,SIGALRM or SIGTERM) arrives before the first signal's <code>prg</code> isrunning, the first signal will be lost. See also <code><ahref="refA.html#alarm">alarm</a></code>, <code><ahref="refR.html#*Run">*Run</a></code>, <code><ahref="refH.html#*Hup">*Hup</a></code> and <code><ahref="refE.html#*Err">*Err</a></code>.<p><pre><code>: (de *Sig1 (msg 'SIGUSR1))-> *Sig1</code></pre><dt><a name="*Solo"><code>*Solo</code></a><dd>A global variable indicating exclusive database access. Its value is<code>0</code> initially, set to <code>T</code> (or <code>NIL</code>) duringcooperative database locks when <code><a href="refL.html#lock">lock</a></code>is successfully called with a <code>NIL</code> (or non-<code>NIL</code>)argument. See also <code><a href="refZ.html#*Zap">*Zap</a></code>.<p><pre><code>: *Solo-> 0: (lock *DB)-> NIL: *Solo-> NIL: (rollback)-> T: *Solo-> 0: (lock)-> NIL: *Solo-> T: (rollback)-> T: *Solo-> T</code></pre><dt><a name="scan"><code>(scan 'tree ['fun] ['any1] ['any2] ['flg])</code></a><dd>Scan through a database tree by applying <code>fun</code> to all key-valuepairs. <code>fun</code> should be a function accepting two arguments for key andvalue. It defaults to <code><a href="refP.html#println">println</a></code>.<code>any1</code> and <code>any2</code> may specify a range of keys. If<code>any2</code> is greater than <code>any1</code>, the traversal will be inopposite direction. If <code>flg</code> is non-<code>NIL</code>, partial keysare skipped. See also <code><a href="refT.html#tree">tree</a></code>, <code><ahref="refI.html#iter">iter</a></code>, <code><ahref="refI.html#init">init</a></code> and <code><ahref="refS.html#step">step</a></code>.<p><pre><code>: (scan (tree 'nm '+Item))("ASLRSNSTRSTN" {3-3} . T) {3-3}("Additive" {3-4}) {3-4}("Appliance" {3-6}) {3-6}("Auxiliary Construction" . {3-3}) {3-3}("Construction" {3-3}) {3-3}("ENNSNNTTTF" {3-4} . T) {3-4}("Enhancement Additive" . {3-4}) {3-4}("Fittings" {3-5}) {3-5}("GTSTFLNS" {3-6} . T) {3-6}("Gadget Appliance" . {3-6}) {3-6}...: (scan (tree 'nm '+Item) println NIL T T)  # 'flg' is non-NIL("Auxiliary Construction" . {3-3}) {3-3}("Enhancement Additive" . {3-4}) {3-4}("Gadget Appliance" . {3-6}) {3-6}("Main Part" . {3-1}) {3-1}("Metal Fittings" . {3-5}) {3-5}("Spare Part" . {3-2}) {3-2}("Testartikel" . {3-8}) {3-8}-> {7-6}</code></pre><dt><a name="scl"><code>(scl 'num . prg) -> any</code></a><dd>Dynamically bind <code><a href="refS.html#*Scl">*Scl</a></code> to<code>num</code> during the execution of <code>prg</code>. See also <ahref="ref.html#num-io">Numbers</a>.<p><pre><code>: (scl 0 (str "123.45"))-> (123): (scl 1 (read))123.45-> 1235: (scl 3 (str "123.45"))-> (123450)</code></pre><dt><a name="sect"><code>(sect 'lst 'lst) -> lst</code></a><dd>Returns the intersection of the <code>lst</code> arguments. See also<code><a href="refD.html#diff">diff</a></code>.<p><pre><code>: (sect (1 2 3 4) (3 4 5 6))-> (3 4): (sect (1 2 3) (4 5 6))-> NIL</code></pre><dt><a name="seed"><code>(seed 'any) -> cnt</code></a><dd>Initializes the random generator's seed, and returns a pseudo random numberin the range -2147483648 .. +2147483647. See also <code><ahref="refR.html#rand">rand</a></code>.<p><pre><code>: (seed "init string")-> 2015582081: (rand)-> -706917003: (rand)-> 1224196082: (seed (time))-> 128285383</code></pre><dt><a name="seek"><code>(seek 'fun 'lst ..) -> lst</code></a><dd>Applies <code>fun</code> to <code>lst</code> and all successive<code>CDR</code>'s, until non-<code>NIL</code> is returned. Returns the tail of<code>lst</code> starting with that element, or <code>NIL</code> if<code>fun</code> did not return non-<code>NIL</code> for any element of<code>lst</code>. When additional <code>lst</code> arguments are given, they arepassed to <code>fun</code> in the same way. See also <code><ahref="refF.html#find">find</a></code>, <code><ahref="refP.html#pick">pick</a></code>.<p><pre><code>: (seek '((X) (> (car X) 9)) (1 5 8 12 19 22))-> (12 19 22)</code></pre><dt><a name="send"><code>(send 'msg 'obj ['any ..]) -> any</code></a><dd>Sends the message <code>msg</code> to the object <code>obj</code>,optionally with arguments <code>any</code>. If the message cannot be located in<code>obj</code>, its classes and superclasses, an error <code>"Badmessage"</code> is issued. See also <code><a href="ref.html#oop">OOConcepts</a></code>, <code><a href="refT.html#try">try</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>: (send 'stop> Dlg)  # Equivalent to (stop> Dlg)-> NIL</code></pre><dt><a name="seq"><code>(seq 'cnt|sym1 ['sym2 ['num]]) -> sym | num | NIL</code></a><dd>Sequential single step: Returns the <i>first</i> external symbol in the<code>cnt</code>'th database file, or the <i>next</i> external symbol following<code>sym1</code> in the database, or <code>NIL</code> when the end of thedatabase is reached. When <code>sym2</code> is given, the database is extendedup to (including the creation of) <code>sym2</code>. If <code>num</code> isgiven, it should be the return value of a previous call to <code>seq</code>, andis used as an internal free list link. See also <code><ahref="refF.html#free">free</a></code>.<p><pre><code>: (pool "db")-> T: (seq *DB)-> {2}: (seq @)-> {3}</code></pre><dt><a name="set"><code>(set 'var 'any ..) -> any</code></a><dd>Stores new values <code>any</code> in the <code>var</code> arguments.<p><pre><code>: (set 'L '(a b c)  (cdr L) '999)-> 999: L-> (a 999 c)</code></pre><dt><a name="setq"><code>(setq var 'any ..) -> any</code></a><dd>Stores new values <code>any</code> in the <code>var</code> arguments.<p><pre><code>: (setq  A 123  B (list A A))  # Set 'A' to 123, then 'B' to (123 123)-> (123 123)</code></pre><dt><a name="show"><code>(show 'any ['sym|cnt]) -> any</code></a><dd>Shows the name, value and property list of a symbol found by applying the<code><a href="refG.html#get">get</a></code> algorithm to <code>any</code> andthe following arguments. See also <code><ahref="refV.html#view">view</a></code>.<p><pre><code>: (setq A 123456)-> 123456: (put 'A 'x 1)-> 1: (put 'A 'lst (9 8 7))-> (9 8 7): (put 'A 'flg T)-> T: (show 'A)A 123456   flg   lst (9 8 7)   x 1-> A: (show 'A 'lst 2)-> 8</code></pre><dt><a name="size"><code>(size 'any) -> cnt</code></a><dd>Returns the "size" of <code>any</code>. For numbers this is the number ofbytes needed for the value, for external symbols it is the number of bytes itwould occupy in the database, for other symbols it is the number of bytesoccupied in the UTF-8 representation of the name, and for lists it is the totalnumber of cells in this list and all its sublists. See also <code><ahref="refL.html#length">length</a></code>.<p><pre><code>: (size "abc")-> 3: (size "盲bc")-> 4: (size 123)-> 1: (size (1 (2) 3))-> 4: (size (1 2 3 .))-> 3</code></pre><dt><a name="skip"><code>(skip ['sym]) -> sym</code></a><dd>Skips all white space (and comments if <code>sym</code> is given) in theinput stream. Returns the next available character, or <code>NIL</code> upon endof file. See also <code><a href="refP.html#peek">peek</a></code> and <code><ahref="refE.html#eof">eof</a></code>.<p><pre><code>$ cat a# Commentabcd$ ./p dbg.l: (in "a" (skip "#"))-> "a"</code></pre><dt><a name="sort"><code>(sort 'lst) -> lst</code></a><dd>Sorts <code>lst</code> by destructively exchanging its elements. See also <ahref="ref.html#cmp">Comparing</a>, <code><ahref="refG.html#group">group</a></code> and <code><ahref="refU.html#uniq">uniq</a></code>.<p><pre><code>: (sort '(a 3 1 (1 2 3) d b 4 T NIL (a b c) (x y z) c 2))-> (NIL 1 2 3 4 a b c d (1 2 3) (a b c) (x y z) T)</code></pre><dt><a name="space"><code>(space ['cnt]) -> cnt</code></a><dd>Prints <code>cnt</code> spaces, or a single space when <code>cnt</code> isnot given.<p><pre><code>: (space) -> 1: (space 1) -> 1: (space 2)  -> 2</code></pre><dt><a name="sp?"><code>(sp? 'any) -> flg</code></a><dd>Returns <code>T</code> when the argument <code>any</code> is<code>NIL</code>, or if it is a string (symbol) that consists only of whitespacecharacters.<p><pre><code>: (sp? "  ")-> T: (sp? "ABC")-> NIL: (sp? 123)-> NIL</code></pre><dt><a name="split"><code>(split 'lst 'any ..) -> lst</code></a><dd>Splits <code>lst</code> at all places containing an element <code>any</code>and returns the resulting list of sublists.<p><pre><code>: (split (1 a 2 b 3 c 4 d 5 e 6) 'e 3 'a)-> ((1) (2 b) (c 4 d 5) (6))

⌨️ 快捷键说明

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