picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

refV.html (5374B)


      1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
      2 <html lang="en">
      3 <head>
      4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      5 <title>V</title>
      6 <link rel="stylesheet" href="doc.css" type="text/css">
      7 </head>
      8 <body>
      9 
     10 <h1>V</h1>
     11 
     12 <dl>
     13 
     14 <dt><a name="val"><code>(val 'var) -> any</code></a>
     15 <dd>Returns the current value of <code>var</code>. See also <code><a
     16 href="refS.html#setq">setq</a></code>, <code><a
     17 href="refS.html#set">set</a></code> and <code><a
     18 href="refD.html#def">def</a></code>.
     19 
     20 <pre><code>
     21 : (setq L '(a b c))
     22 -> (a b c)
     23 : (val 'L)
     24 -> (a b c)
     25 : (val (cdr L))
     26 -> b
     27 </code></pre>
     28 
     29 <dt><a name="val/3"><code>val/3</code></a>
     30 <dd><a href="ref.html#pilog">Pilog</a> predicate that returns the value of an
     31 object's attribute. Typically used in database queries. The first argument is a
     32 Pilog variable to bind the value, the second is the object, and the third and
     33 following arguments are used to apply the <code><a
     34 href="refG.html#get">get</a></code> algorithm to that object. See also <code><a
     35 href="refD.html#db/3">db/3</a></code> and <code><a
     36 href="refS.html#select/3">select/3</a></code>.
     37 
     38 <pre><code>
     39 : (?
     40    (db nr +Item (2 . 5) @Item)   # Fetch articles 2 through 5
     41    (val @Nm @Item nm)            # Get item description
     42    (val @Sup @Item sup nm) )     # and supplier's name
     43  @Item={3-2} @Nm="Spare Part" @Sup="Seven Oaks Ltd."                             @Item={3-3} @Nm="Auxiliary Construction" @Sup="Active Parts Inc."
     44  @Item={3-4} @Nm="Enhancement Additive" @Sup="Seven Oaks Ltd."
     45  @Item={3-5} @Nm="Metal Fittings" @Sup="Active Parts Inc."
     46 -> NIL
     47 </code></pre>
     48 
     49 <dt><a name="var"><code>(var sym . any) -> any</code></a>
     50 <dt><code>(var (sym . cls) . any) -> any</code>
     51 <dd>Defines a class variable <code>sym</code> with the initial value
     52 <code>any</code> for the current class, implicitly given by the value of the
     53 global variable <code><a href="refC.html#*Class">*Class</a></code>, or - in the
     54 second form - for the explicitly given class cls. See also <a
     55 href="ref.html#oop">OO Concepts</a>, <code><a
     56 href="refR.html#rel">rel</a></code> and <code><a
     57 href="refV.html#var:">var:</a></code>.
     58 
     59 <pre><code>
     60 : (class +A)
     61 -> +A
     62 : (var a . 1)
     63 -> 1
     64 : (var b . 2)
     65 -> 2
     66 : (show '+A)
     67 +A NIL
     68    b 2
     69    a 1
     70 -> +A
     71 </code></pre>
     72 
     73 <dt><a name="var:"><code>(var: sym) -> any</code></a>
     74 <dd>Fetches the value of a class variable <code>sym</code> for the current
     75 object <code><a href="refT.html#This">This</a></code>, by searching the property
     76 lists of its class(es) and supperclasses. See also <a href="ref.html#oop">OO
     77 Concepts</a>, <code><a href="refV.html#var">var</a></code>, <code><a
     78 href="refW.html#with">with</a></code>, <code><a
     79 href="refM.html#meta">meta</a></code>, <code><a href="ref_.html#:">:</a></code>,
     80 <code><a href="ref_.html#=:">=:</a></code> and <code><a
     81 href="ref_.html#::">::</a></code>.
     82 
     83 <pre><code>
     84 : (object 'O '(+A) 'a 9 'b 8)
     85 -> O
     86 : (with 'O (list (: a) (: b) (var: a) (var: b)))
     87 -> (9 8 1 2)
     88 </code></pre>
     89 
     90 <dt><a name="version"><code>(version ['flg]) -> lst</code></a>
     91 <dd>Prints the current version as a string of dot-separated numbers, and returns
     92 the current version as a list of numbers. The JVM- and C-versions print an
     93 additional "JVM" or "C", respectively, separated by a space. When
     94 <code>flg</code> is non-NIL, printing is suppressed.
     95 
     96 <pre><code>
     97 $ pil -version
     98 3.0.1.22
     99 : (version T)
    100 -> (3 0 1 22)
    101 </code></pre>
    102 
    103 <dt><a name="vi"><code>(vi 'sym) -> sym</code></a>
    104 <dt><code>(vi 'sym 'cls) -> sym</code>
    105 <dt><code>(vi '(sym . cls)) -> sym</code>
    106 <dt><code>(vi) -> NIL</code>
    107 <dd>(Debug mode only) Opens the "vi" editor on the function or method definition
    108 of <code>sym</code>. A call to <code><a href="refL.html#ld">ld</a></code>
    109 thereafter will <code><a href="refL.html#load">load</a></code> the modified
    110 file. A call without arguments permanently switches the REPL line editor and the
    111 <code><a href="refE.html#edit">edit</a></code> function to "vi" mode. See also
    112 <code><a href="refD.html#doc">doc</a></code>, <code><a
    113 href="refE.html#edit">edit</a></code>, <code><a
    114 href="refE.html#em">em</a></code>, <code><a
    115 href="refD.html#*Dbg">*Dbg</a></code>, <code><a
    116 href="refD.html#debug">debug</a></code> and <code><a
    117 href="refP.html#pp">pp</a></code>.
    118 
    119 <pre><code>
    120 : (vi 'url> '+CuSu)  # Edit the method's source code, then exit from 'vi'
    121 -> T
    122 </code></pre>
    123 
    124 <dt><a name="view"><code>(view 'lst ['T]) -> any</code></a>
    125 <dd>Views <code>lst</code> as tree-structured ASCII graphics. When the
    126 <code>T</code> argument is given, <code>lst</code> should be a binary tree
    127 structure (as generated by <code><a href="refI.html#idx">idx</a></code>), which
    128 is then shown as a left-rotated tree. See also <code><a
    129 href="refP.html#pretty">pretty</a></code> and <code><a
    130 href="refS.html#show">show</a></code>.
    131 
    132 <pre><code>
    133 : (balance 'I '(a b c d e f g h i j k l m n o))
    134 -> NIL
    135 : I
    136 -> (h (d (b (a) c) f (e) g) l (j (i) k) n (m) o)
    137 
    138 : (view I)
    139 +-- h
    140 |
    141 +---+-- d
    142 |   |
    143 |   +---+-- b
    144 |   |   |
    145 |   |   +---+-- a
    146 |   |   |
    147 |   |   +-- c
    148 |   |
    149 |   +-- f
    150 |   |
    151 |   +---+-- e
    152 |   |
    153 |   +-- g
    154 |
    155 +-- l
    156 |
    157 +---+-- j
    158 |   |
    159 |   +---+-- i
    160 |   |
    161 |   +-- k
    162 |
    163 +-- n
    164 |
    165 +---+-- m
    166 |
    167 +-- o
    168 -> NIL
    169 
    170 : (view I T)
    171          o
    172       n
    173          m
    174    l
    175          k
    176       j
    177          i
    178 h
    179          g
    180       f
    181          e
    182    d
    183          c
    184       b
    185          a
    186 -> NIL
    187 </code></pre>
    188 
    189 </dl>
    190 
    191 </body>
    192 </html>