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

📄 ref_.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>Other</title><link rel="stylesheet" href="doc.css" type="text/css"></head><body><h1>Other</h1><dl><dt><a name="!"><code>(! . prg) -> any</code></a><dd>Low level breakpoint function: The current execution environment is savedand the I/O channels are redirected to the console. Then <code>prg</code> isdisplayed, and a read-eval-print-loop is entered (with <code>!</code> as itsprompt character), to evaluate expressions and examine the current programenvironment. An empty input line terminates the read-eval-print-loop, theenvironment and I/O channels are restored, and the result of <code>prg</code> isreturned. <code>!</code> is normally inserted into existing programs with the<code><a href="refD.html#debug">debug</a></code> function. See also <code><ahref="refE.html#e">e</a></code>, <code><a href="ref_.html#^">^</a></code> and<code><a href="refD.html#*Dbg">*Dbg</a></code>.<p><pre><code>: (de foo (N) (and (println 1) (! println N) (println 2)))-> foo: (foo 7)1                 # Executed '(println 1)'(println N)       # Entered breakpoint! N               # Examine the value of 'N'-> 7! (e)             # Evaluate '^', i.e. (println N)7-> 7! (e @)           # Evaluate '@' -> the result of '(println 1)'-> 1!                 # Empty line: continue7                 # Executed '(println N)'2                 # Executed '(println 2)'-> 2</code></pre><dt><a name="$"><code>($ sym|lst lst . prg) -> any</code></a><dd>Low level trace function: The first argument <code>sym|lst</code> is printedto the console with a proper indentation, followed by a colon <code>:</code>. Ifa function is traced, the first argument is the function symbol, else if amethod is traced, it is a cons pair of message and class. The second argument<code>lst</code> should be a list of symbols, identical to the function'sargument list. The current values of these symbols are printed, followed by anewline. Then <code>prg</code> is executed, and its return value printed in asimilar way (this time with an equals sign <code>=</code> instead of a colon)and returned. <code>$</code> is normally inserted into existing programs withthe <code><a href="refT.html#trace">trace</a></code> function.<p><pre><code>: (de foo (A B) ($ foo (A B) (* A B)))-> foo: (foo 3 4) foo : 3 4        # Function entry, arguments 3 and 4 foo = 12         # Function exit, return value 12-> 12</code></pre><dt><a name="$dat"><code>($dat 'sym1 ['sym2]) -> dat</code></a><dd>Converts a string <code>sym1</code> in ISO format to a <code><ahref="refD.html#date">date</a></code>, optionally using a delimiter character<code>sym2</code>. See also <code><a href="refD.html#dat$">dat$</a></code>,<code><a href="ref_.html#$tim">$tim</a></code>, <code><ahref="refS.html#strDat">strDat</a></code> and <code><ahref="refE.html#expDat">expDat</a></code>.<p><pre><code>: ($dat "20070601")-> 733134: ($dat "2007-06-01" "-")-> 733134</code></pre><dt><a name="$tim"><code>($tim 'sym) -> tim</code></a><dd>Converts a string to a <code><a href="refT.html#time">time</a></code>. Theminutes and seconds are optional and default to zero. See also <code><ahref="refT.html#tim$">tim$</a></code> and <code><ahref="ref_.html#$dat">$dat</a></code>.<p><pre><code>: (time ($tim "10:57:56"))-> (10 57 56): (time ($tim "10:57"))-> (10 57 0): (time ($tim "10"))-> (10 0 0)</code></pre><dt><a name="%"><code>(% 'num ..) -> num</code></a><dd>Returns the remainder from the divisions of successive <code>num</code>arguments. The sign of the result is that of the first argument.<p><pre><code>: (% 17 5)-> 2: (% -17 5)  # Sign is that of the first argument-> -2: (% 5 2)-> 1: (% 15 10)-> 5: (% 15 10 2)  # (% 15 10) -> 5, then (% 5 2) -> 1-> 1</code></pre><dt><a name="&"><code>(& 'num ..) -> num</code></a><dd>Returns the bitwise <code>AND</code> of all <code>num</code> arguments. Seealso <code><a href="ref_.html#|">|</a></code>, <code><ahref="refX.html#x|">x|</a></code> and <code><ahref="refB.html#bit?">bit?</a></code>.<p><pre><code>: (& 6 3)-> 2: (& 7 3 1)-> 1</code></pre><dt><a name="*"><code>(* 'num ..) -> num</code></a><dd>Returns the product of all <code>num</code> arguments. See also <code><ahref="ref_.html#/">/</a></code>, <code><a href="ref_.html#*/">*/</a></code>,<code><a href="ref_.html#+">+</a></code> and <code><ahref="ref_.html#-">-</a></code>.<p><pre><code>: (* 1 2 3)-> 6: (* 5 3 2 2)-> 60</code></pre><dt><a name="**"><code>(** 'num1 'num2) -> num</code></a><dd>Returns <code>num1</code> to the power of <code>num2</code>.<p><pre><code>: (** 2 3)-> 8: (** 100 100)-> 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</code></pre><dt><a name="*/"><code>(*/ 'num1 ['num2 ..] 'num3) -> num</code></a><dd>Returns the product of <code>num1</code> and all following <code>num2</code>arguments, divided by the <code>num3</code> argument. The result is rounded tothe nearest integer value. Note this is especially useful for fixed pointarithmetic, by multiplying with (or dividing by) the scale factor. See also<code><a href="ref_.html#*">*</a></code>, <code><ahref="ref_.html#/">/</a></code>, <code><a href="ref_.html#+">+</a></code> and<code><a href="ref_.html#-">-</a></code>.<p><pre><code>: (*/ 3 4 2)-> 6: (*/ 1234 2 10)-> 247: (*/ 100 6)-> 17: (setq *Scl 2)-> 2: (format (*/ 3.0 1.5 1.0) *Scl)-> "4.50"</code></pre><dt><a name="+"><code>(+ 'num ..) -> num</code></a><dd>Returns the sum of all <code>num</code> arguments. See also <code><ahref="ref_.html#-">-</a></code>, <code><a href="ref_.html#*">*</a></code>,<code><a href="ref_.html#/">/</a></code> and <code><ahref="ref_.html#*/">*/</a></code>.<p><pre><code>: (+ 1 2 3)-> 6</code></pre><dt><a name="-"><code>(- 'num ..) -> num</code></a> <dd>Returns the differenceof the first <code>num</code> argument and all following arguments. If only asingle argument is given, it is negated. See also <code><ahref="ref_.html#+">+</a></code>, <code><a href="ref_.html#*">*</a></code>,<code><a href="ref_.html#/">/</a></code> and <code><ahref="ref_.html#*/">*/</a></code>.<p><pre><code>: (- 7)-> -7: (- 7 2 1)-> 4</code></pre><dt><a name="->"><code>(-&gt sym [num]) -> any</code></a><dd>Searches for the current value of the pattern variable <code>sym</code> attop level (or level <code>num</code>) in the current <ahref="ref.html#pilog">Pilog</a> environment. See also <code><ahref="refP.html#prove">prove</a></code> and <code><ahref="refU.html#unify">unify</a></code>.<p><pre><code>: (? (append (1 2 3) (4 5 6) @X) (@ println 'X '= (-> @X)))X = (1 2 3 4 5 6) @X=(1 2 3 4 5 6)-> NIL</code></pre><dt><a name="/"><code>(/ 'num ..) -> num</code></a><dd>Returns the first <code>num</code> argument successively divided by allfollowing arguments. See also <code><a href="ref_.html#*">*</a></code>, <code><ahref="ref_.html#*/">*/</a></code>, <code><a href="ref_.html#+">+</a></code> and<code><a href="ref_.html#-">-</a></code>.<p><pre><code>: (/ 12 3)-> 4: (/ 60 -3 2 2)-> -5</code></pre><dt><a name=":"><code>(: sym|0 [sym1|cnt ..]) -> any</code></a><dd>Fetches a value <code>any</code> from the properties of a symbol, or from alist, by applying the <code><a href="refG.html#get">get</a></code> algorithm to<code>This</code> and the following arguments. Used typically in methods or<code><a href="refW.html#with">with</a></code> bodies. See also <code><ahref="refG.html#get">get</a></code>, <code><a href="ref_.html#=:">=:</a></code>and <code><a href="ref_.html#::">::</a></code>.<p><pre><code>: (put 'X 'a 1)-> 1: (with 'X (: a))-> 1</code></pre><dt><a name="::"><code>(:: sym [sym1|cnt .. sym2]) -> lst|sym</code></a><dd>Fetches a property for a property key <code>sym</code> or <code>sym2</code>from a symbol. That symbol is <code>This</code> (if no other arguments aregiven), or a symbol found by applying the <code><ahref="refG.html#get">get</a></code> algorithm to <code>This</code> and thefollowing arguments. The property (the cell, not just its value) is returned,suitable for direct (destructive) manipulations. Used typically in methods or<code><a href="refW.html#with">with</a></code> bodies. See also <code><a

⌨️ 快捷键说明

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