File: refV.html

package info (click to toggle)
picolisp 25.12-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,388 kB
  • sloc: ansic: 3,092; javascript: 1,004; makefile: 107; sh: 2
file content (215 lines) | stat: -rw-r--r-- 5,546 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!--
# VIP @lib/vip/html.l
# 30may25 Software Lab. Alexander Burger
-->

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>V</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>

<h1>V</h1>

<dl>

<dt><a id="val"><code>(val 'var) -> any</code></a></dt>
<dd>Returns the current value of <code>var</code>. See also <code><a
href="refS.html#setq">setq</a></code>, <code><a
href="refS.html#set">set</a></code> and <code><a
href="refD.html#def">def</a></code>.

<pre>
: (setq L '(a b c))
-> (a b c)
: (val 'L)
-> (a b c)
: (val (cdr L))
-> b
</pre></dd>

<dt><a id="val/3"><code>val/3</code></a></dt>
<dd>(Deprecated since version 25.5.30) <a
href="ref.html#pilog">Pilog</a> predicate that returns the value of an
object's attribute. Typically used in database queries. The first
argument is a Pilog variable to bind the value, the second is the
object, and the third and following arguments are used to apply the
<code><a href="refG.html#get">get</a></code> algorithm to that object.
See also <code><a href="refD.html#db/3">db/3</a></code> and <code><a
href="refS.html#select/3">select/3</a></code>.

<pre>
: (?
   (db nr +Item (2 . 5) @Item)   # Fetch articles 2 through 5
   (val @Nm @Item nm)            # Get item description
   (val @Sup @Item sup nm) )     # and supplier's name
 @Item={B2} @Nm="Spare Part" @Sup="Seven Oaks Ltd."
 @Item={B3} @Nm="Auxiliary Construction" @Sup="Active Parts Inc."
 @Item={B4} @Nm="Enhancement Additive" @Sup="Seven Oaks Ltd."
 @Item={B5} @Nm="Metal Fittings" @Sup="Active Parts Inc."
-> NIL
</pre></dd>

<dt><a id="var"><code>(var sym . any) -> any</code></a></dt>
<dt><code>(var (sym . cls) . any) -> any</code></dt>
<dd>Defines a class variable <code>sym</code> with the initial value
<code>any</code> for the current class, implicitly given by the value of the
global variable <code><a href="refC.html#*Class">*Class</a></code>, or - in the
second form - for the explicitly given class cls. See also <a
href="ref.html#oop">OO Concepts</a>, <code><a
href="refR.html#rel">rel</a></code> and <code><a
href="refV.html#var:">var:</a></code>.

<pre>
: (class +A)
-> +A
: (var a . 1)
-> 1
: (var b . 2)
-> 2
: (show '+A)
+A NIL
   b 2
   a 1
-> +A
</pre></dd>

<dt><a id="var:"><code>(var: sym) -> any</code></a></dt>
<dd>Fetches the value of a class variable <code>sym</code> for the current
object <code><a href="refT.html#This">This</a></code>, by searching the property
lists of its class(es) and superclasses. See also <a href="ref.html#oop">OO
Concepts</a>, <code><a href="refV.html#var">var</a></code>, <code><a
href="refW.html#with">with</a></code>, <code><a
href="refM.html#meta">meta</a></code>, <code><a href="ref_.html#:">:</a></code>,
<code><a href="ref_.html#=:">=:</a></code> and <code><a
href="ref_.html#::">::</a></code>.

<pre>
: (class +A)
-> +A
: (var a . 1)
-> 1
: (var b . 2)
-> 2
: (object 'O '(+A) 'a 9 'b 8)
-> O
: (with 'O (list (: a) (: b) (var: a) (var: b)))
-> (9 8 1 2)
</pre></dd>

<dt><a id="version"><code>(version ['flg]) -> lst</code></a></dt>
<dt><code>(version 'lst) -> lst</code></dt>
<dd>Prints the current version as a string of dot-separated numbers, and returns
the current version as a list of numbers. When <code>flg</code> is non-NIL,
printing is suppressed. The second form checks for the required version in
<code>lst</code> and throws an error if the current version is too old. See also
<code><a href="refC.html#*CPU">*CPU</a></code> and <code><a
href="refO.html#*OS">*OS</a></code>.

<pre>
$ pil -version
25.5.8

: (version T)
-> (25 5 8)
: (version)
25.5.8
-> (25 5 8)

: (version (25 5 9))
!? (version (25 5 9))
(25 5 8) -- Inadequate PicoLisp version
?
</pre></dd>

<dt><a id="vi"><code>(vi 'sym) -> sym | NIL</code></a></dt>
<dt><code>(vi 'sym 'cls) -> sym | NIL</code></dt>
<dt><code>(vi 'lst) -> lst | NIL</code></dt>
<dt><code>(v . lst) -> lst | NIL</code></dt>
<dt><code>(v) -> NIL</code></dt>
<dd>(Debug mode only) Opens the Vip editor on the function or method definition
of <code>sym</code> (source file or direct path name), or on a list of symbols
<code>lst</code> (in-memory). <code>(v)</code> resumes a Vip session suspended
with "qz". See also <code><a href="refD.html#doc">doc</a></code>, <code><a
href="refD.html#*Dbg">*Dbg</a></code>, <code><a
href="refD.html#debug">debug</a></code> and <code><a
href="refP.html#pp">pp</a></code>.

<pre>
: (vi 'put> '+Entity)  # Edit the method's source code
: (v {1})  # In-memory-edit the database root object
-> put>
</pre></dd>

<dt><a id="view"><code>(view 'lst ['T]) -> any</code></a></dt>
<dd>Views <code>lst</code> as tree-structured ASCII graphics. When the
<code>T</code> argument is given, <code>lst</code> should be a binary tree
structure (as generated by <code><a href="refI.html#idx">idx</a></code>), which
is then shown as a left-rotated tree. See also <code><a
href="refP.html#pretty">pretty</a></code> and <code><a
href="refS.html#show">show</a></code>.

<pre>
: (balance 'I '(a b c d e f g h i j k l m n o))
-> NIL
: I
-> (h (d (b (a) c) f (e) g) l (j (i) k) n (m) o)

: (view I)
+-- h
|
+---+-- d
|   |
|   +---+-- b
|   |   |
|   |   +---+-- a
|   |   |
|   |   +-- c
|   |
|   +-- f
|   |
|   +---+-- e
|   |
|   +-- g
|
+-- l
|
+---+-- j
|   |
|   +---+-- i
|   |
|   +-- k
|
+-- n
|
+---+-- m
|
+-- o
-> NIL

: (view I T)
         o
      n
         m
   l
         k
      j
         i
h
         g
      f
         e
   d
         c
      b
         a
-> NIL
</pre></dd>

</dl>

</body>
</html>