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 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
|
<!--
# VIP @lib/vip/html.l
# 09dec25 Software Lab. Alexander Burger
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>W</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>
<h1>W</h1>
<dl>
<dt><a id="*Winch"><code>*Winch</code></a></dt>
<dd>Global variable holding a (possibly empty) <code>prg</code> body, which will
be executed when a SIGWINCH signal is sent to the current process. See also
<code><a href="refA.html#alarm">alarm</a></code>, <code><a
href="refS.html#sigio">sigio</a></code>, <code><a
href="refH.html#*Hup">*Hup</a></code>, <code><a
href="refS.html#*Sig1">*Sig[12]</a></code>, <code><a
href="refT.html#*TStp1">*TStp[12]</a></code> and <code><a
href="refT.html#*Term">*Term</a></code>.
<pre>
: (de *Winch (msg 'SIGWINCH))
-> *Winch
</pre></dd>
<dt><a id="wait"><code>(wait 'cnt|NIL . prg) -> any</code></a></dt>
<dt><code>(wait 'cnt|NIL T 'fd) -> fd|NIL</code></dt>
<dd>Waits for a condition. While the result of the execution of <code>prg</code>
is <code>NIL</code> (first form), or no input is available for the file
descriptor in <code>fd</code> (second form), a <code>poll(2)</code> system call
is executed for all file descriptors and timers in the <code>VAL</code> of the
global variable <code><a href="refR.html#*Run">*Run</a></code>. When
<code>cnt</code> is non-<code>NIL</code>, the waiting time is limited to
<code>cnt</code> milliseconds. Returns the result of <code>prg</code>. See also
<code><a href="refK.html#key">key</a></code> and <code><a
href="refS.html#sync">sync</a></code>.
<pre>
: (wait 2000) # Wait 2 seconds
-> NIL
: (prog
(zero *Cnt)
(setq *Run # Install background loop
'((-2000 0 (println (inc '*Cnt)))) ) # Increment '*Cnt' every 2 sec
(wait NIL (> *Cnt 6)) # Wait until > 6
(off *Run) )
1 # Waiting ..
2
3
4
5
6
7
-> NIL
</pre></dd>
<dt><a id="week"><code>(week 'dat) -> num</code></a></dt>
<dd>Returns the number of the week for a given <code><a
href="refD.html#date">date</a></code> <code>dat</code>. See also <code><a
href="refD.html#day">day</a></code>, <code><a
href="refU.html#ultimo">ultimo</a></code>, <code><a
href="refD.html#datStr">datStr</a></code> and <code><a
href="refS.html#strDat">strDat</a></code>.
<pre>
: (datStr (date))
-> "2007-06-01"
: (week (date))
-> 22
</pre></dd>
<dt><a id="when"><code>(when 'any . prg) -> any</code></a></dt>
<dd>Conditional execution: When the condition <code>any</code> evaluates to
non-<code>NIL</code>, <code>prg</code> is executed and the result is returned.
Otherwise <code>NIL</code> is returned. See also <code><a
href="refU.html#unless">unless</a></code>, <code><a
href="refI.html#if">if</a></code>, <code><a href="refA.html#and">and</a></code>
and <code><a href="refC.html#cond">cond</a></code>.
<pre>
: (when (> 4 3) (println 'OK) (println 'Good))
OK
Good
-> Good
</pre></dd>
<dt><a id="while"><code>(while 'any . prg) -> any</code></a></dt>
<dd>Conditional loop: While the condition <code>any</code> evaluates to
non-<code>NIL</code>, <code>prg</code> is repeatedly executed. If
<code>prg</code> is never executed, <code>NIL</code> is returned. Otherwise the
result of <code>prg</code> is returned. See also <code><a
href="refU.html#until">until</a></code>, <code><a
href="refF.html#for">for</a></code>, <code><a
href="refL.html#loop">loop</a></code> and <code><a
href="refD.html#do">do</a></code>.
<pre>
: (while (read)
(println 'got: @) )
abc
got: abc
1234
got: 1234
NIL
-> 1234
</pre></dd>
<dt><a id="what"><code>(what 'sym) -> lst</code></a></dt>
<dd>(Debug mode only) Returns a list of all internal symbols that match the
pattern string <code>sym</code>. See also <code><a
href="refM.html#match">match</a></code>, <code><a
href="refW.html#who">who</a></code>, <code><a
href="refH.html#has">has</a></code> and <code><a
href="refC.html#can">can</a></code>.
<pre>
: (what "cd@dr")
-> (cdaddr cdaadr cddr cddddr cdddr cddadr cdadr)
</pre></dd>
<dt><a id="who"><code>(who 'any) -> lst</code></a></dt>
<dd>(Debug mode only) Returns a list of all functions or method definitions that
contain the atom or pattern <code>any</code>. See also <code><a
href="refM.html#match">match</a></code>, <code><a
href="refW.html#what">what</a></code>, <code><a
href="refH.html#has">has</a></code> and <code><a
href="refC.html#can">can</a></code>.
<pre>
: (who 'caddr) # Who is using 'caddr'?
-> ($dat lint1 expDat datStr $tim tim$ mail _gen dat$ datSym)
: (who "Type error")
-> ((mis> . +Link) *Uni (mis> . +Joint))
: (more (who "Type error") pp) # Pretty print all results
(dm (mis> . +Link) (Val Obj)
(and
Val
(nor (isa (: type) Val) (canQuery Val))
"Type error" ) )
. # Stop
-> T
</pre></dd>
<dt><a id="wipe"><code>(wipe 'sym|lst) -> sym|lst</code></a></dt>
<dd>Clears the <code>VAL</code> and the property list of <code>sym</code>, or of
all symbols in the list <code>lst</code>. When a symbol is an external symbol,
its state is also set to "not loaded". Does nothing when <code>sym</code> is an
external symbol that has been modified or deleted ("dirty").
<pre>
: (setq A (1 2 3 4))
-> (1 2 3 4)
: (put 'A 'a 1)
-> 1
: (put 'A 'b 2)
-> 2
: (show 'A)
A (1 2 3 4)
b 2
a 1
-> A
: (wipe 'A)
-> A
: (show 'A)
A NIL
-> A
</pre></dd>
<dt><a id="with"><code>(with 'any . prg) -> any</code></a></dt>
<dd>Saves the current object <code><a
href="refT.html#This">This</a></code> and sets it to the new value
<code>any</code>. Then <code>prg</code> is executed, and
<code>This</code> is restored to its previous value. The return value is
the result of <code>prg</code>. Used typically to access the local data
of <code>var</code> in the same manner as inside a method body.
<code>prg</code> is not executed (and <code>NIL</code> is returned) when
<code>var</code> is <code>NIL</code>. <code>(with 'X . prg)</code> is
equivalent to <code>(let? This 'X . prg)</code>. See also <code><a
href="refT.html#this">this</a></code>.
<pre>
: (put 'X 'a 1)
-> 1
: (put 'X 'b 2)
-> 2
: (with 'X (list (: a) (: b)))
-> (1 2)
</pre></dd>
<dt><a id="wr"><code>(wr 'cnt ..) -> cnt</code></a></dt>
<dd>Writes all <code>cnt</code> arguments as raw bytes to the current output
channel. See also <code><a href="refR.html#rd">rd</a></code> and <code><a
href="refP.html#pr">pr</a></code>.
<pre>
: (out "x" (wr 1 255 257)) # Write to "x"
-> 257
: (hd "x")
00000000 01 FF 01 ...
-> NIL
</pre></dd>
<dt><a id="wrap"><code>(wrap 'cnt 'lst) -> sym</code></a></dt>
<dt><code>(wrap 'cnt 'sym) -> lst</code></dt>
<dd>The first form returns a transient symbol with all characters in
<code>lst</code> <code><a href="refP.html#pack">pack</a></code>ed in lines with
a maximal length of <code>cnt</code>. The second form converts a symbol to a
list of transient symbols each with a maximal length of <code>cnt</code>. See
also <code><a href="refT.html#tab">tab</a></code>, <code><a
href="refA.html#align">align</a></code> and <code><a
href="refC.html#center">center</a></code>.
<pre>
: (wrap 20 (chop "The quick brown fox jumps over the lazy dog"))
-> "The quick brown fox^Jjumps over the lazy^Jdog"
: (wrap 8 (chop "The quick brown fox jumps over the lazy dog"))
-> "The^Jquick^Jbrown^Jfox^Jjumps^Jover the^Jlazy dog"
: (wrap 8 "The quick brown fox jumps over the lazy dog")
-> ("The" "quick" "brown" "fox" "jumps" "over the" "lazy dog")
</pre></dd>
</dl>
</body>
</html>
|