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 236
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>H</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>
<h1>H</h1>
<dl>
<dt><a name="*Hup"><code>*Hup</code></a>
<dd>Global variable holding a (possibly empty) <code>prg</code> body, which will
be executed when a SIGHUP 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> and <code><a
href="refS.html#*Sig1">*Sig[12]</a></code>.
<pre><code>
: (de *Hup (msg 'SIGHUP))
-> *Hup
</code></pre>
<dt><a name="+Hook"><code>+Hook</code></a>
<dd>Prefix class for <code><a href="refR.html#+relation">+relation</a></code>s,
typically <code><a href="refL.html#+Link">+Link</a></code> or <code><a
href="refJ.html#+Joint">+Joint</a></code>. In essence, this maintains an local
database in the referred object. See also <code><a
href="ref.html#dbase">Database</a></code>.
<pre><code>
(rel sup (+Hook +Link) (+Sup)) # Supplier
(rel nr (+Key +Number) sup) # Item number, unique per supplier
(rel dsc (+Ref +String) sup) # Item description, indexed per supplier
</code></pre>
<dt><a name="hash"><code>(hash 'any) -> cnt</code></a>
<dd>Generates a 16-bit number (1-65536) from <code>any</code>, suitable as a
hash value for various purposes, like randomly balanced <code><a
href="refI.html#idx">idx</a></code> structures. See also <code><a
href="refC.html#cache">cache</a></code> and <code><a
href="refS.html#seed">seed</a></code>.
<pre><code>
: (hash 0)
-> 1
: (hash 1)
-> 55682
: (hash "abc")
-> 45454
</code></pre>
<dt><a name="hax"><code>(hax 'num) -> sym</code></a>
<dt><code>(hax 'sym) -> num</code>
<dd>Converts a number <code>num</code> to a string in hexadecimal/alpha
notation, or a hexadecimal/alpha formatted string to a number. The digits are
represented with '<code>@</code>' (zero) and the letters '<code>A</code>' -
'<code>O</code>' (from "alpha" to "omega"). This format is used internally for
the names of <code><a href="ref.html#external-io">external symbols</a></code> in
the 64-bit version. See also <code><a href="refF.html#fmt64">fmt64</a></code>,
<code><a href="refH.html#hex">hex</a></code>, <code><a
href="refB.html#bin">bin</a></code> and <code><a
href="refO.html#oct">oct</a></code>.
<pre><code>
: (hax 7)
-> "G"
: (hax 16)
-> "A@"
: (hax 255)
-> "OO"
: (hax "A")
-> 1
</code></pre>
<dt><a name="hd"><code>(hd 'sym ['cnt]) -> NIL</code></a>
<dd>Displays a hexadecimal dump of the file given by <code>sym</code>, limited
to <code>cnt</code> lines. See also <code><a
href="refP.html#proc">proc</a></code>.
<pre><code>
: (hd "lib.l" 4)
00000000 23 20 32 33 64 65 63 30 39 61 62 75 0A 23 20 28 # 23dec09abu.# (
00000010 63 29 20 53 6F 66 74 77 61 72 65 20 4C 61 62 2E c) Software Lab.
00000020 20 41 6C 65 78 61 6E 64 65 72 20 42 75 72 67 65 Alexander Burge
00000030 72 0A 0A 28 64 65 20 74 61 73 6B 20 28 4B 65 79 r..(de task (Key
-> NIL
</code></pre>
<dt><a name="head"><code>(head 'cnt|lst 'lst) -> lst</code></a>
<dd>Returns a new list made of the first <code>cnt</code> elements of
<code>lst</code>. If <code>cnt</code> is negative, it is added to the length of
<code>lst</code>. If the first argument is a <code>lst</code>, <code>head</code>
is a predicate function returning that argument list if it is <code>equal</code>
to the head of the second argument, and <code>NIL</code> otherwise. See also
<code><a href="refT.html#tail">tail</a></code>.
<pre><code>
: (head 3 '(a b c d e f))
-> (a b c)
: (head 0 '(a b c d e f))
-> NIL
: (head 10 '(a b c d e f))
-> (a b c d e f)
: (head -2 '(a b c d e f))
-> (a b c d)
: (head '(a b c) '(a b c d e f))
-> (a b c)
</code></pre>
<dt><a name="head/3"><code>head/3</code></a>
<dd><a href="ref.html#pilog">Pilog</a> predicate that succeeds if the first
(string) argument is a prefix of the string representation of the result of
applying the <code><a href="refG.html#get">get</a></code> algorithm to the
following arguments. Typically used as filter predicate in <code><a
href="refS.html#select/3">select/3</a></code> database queries. See also
<code><a href="refP.html#pre?">pre?</a></code>, <code><a
href="refI.html#isa/2">isa/2</a></code>, <code><a
href="refS.html#same/3">same/3</a></code>, <code><a
href="refB.html#bool/3">bool/3</a></code>, <code><a
href="refR.html#range/3">range/3</a></code>, <code><a
href="refF.html#fold/3">fold/3</a></code>, <code><a
href="refP.html#part/3">part/3</a></code> and <code><a
href="refT.html#tolr/3">tolr/3</a></code>.
<pre><code>
: (?
@Nm "Muller"
@Tel "37"
(select (@CuSu)
((nm +CuSu @Nm) (tel +CuSu @Tel))
(tolr @Nm @CuSu nm)
(head @Tel @CuSu tel) )
(val @Name @CuSu nm)
(val @Phone @CuSu tel) )
@Nm="Muller" @Tel="37" @CuSu={2-3} @Name="Miller" @Phone="37 4773 82534"
-> NIL
</code></pre>
<dt><a name="heap"><code>(heap 'flg) -> cnt</code></a>
<dd>Returns the total size of the cell heap space in megabytes. If
<code>flg</code> is non-<code>NIL</code>, the size of the currently free space
is returned. See also <code><a href="refS.html#stack">stack</a></code> and
<code><a href="refG.html#gc">gc</a></code>.
<pre><code>
: (gc 4)
-> 4
: (heap)
-> 5
: (heap T)
-> 4
</code></pre>
<dt><a name="hear"><code>(hear 'cnt) -> cnt</code></a>
<dd>Uses the file descriptor <code>cnt</code> as an asynchronous command input
channel. Any executable list received via this channel will be executed in the
background. As this mechanism is also used for inter-family communication (see
<code><a href="refT.html#tell">tell</a></code>), <code>hear</code> is usually
only called explicitly by a top level parent process.
<pre><code>
: (call 'mkfifo "fifo/cmd")
-> T
: (hear (open "fifo/cmd"))
-> 3
</code></pre>
<dt><a name="here"><code>(here ['sym]) -> sym</code></a>
<dd>Echoes the current input stream until <code>sym</code> is encountered, or
until end of file. See also <code><a href="refE.html#echo">echo</a></code>.
<pre><code>
$ cat hello.l
(html 0 "Hello" "lib.css" NIL
(<h2> NIL "Hello")
(here) )
<p>Hello!</p>
<p>This is a test.</p>
$ pil @lib/http.l @lib/xhtml.l hello.l
HTTP/1.0 200 OK
Server: PicoLisp
Date: Sun, 03 Jun 2007 11:41:27 GMT
Cache-Control: max-age=0
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Hello</title>
<link rel="stylesheet" href="http://:/lib.css" type="text/css"/>
</head>
<body><h2>Hello</h2>
<p>Hello!</p>
<p>This is a test.</p>
</body>
</html>
</code></pre>
<dt><a name="hex"><code>(hex 'num ['num]) -> sym</code></a>
<dt><code>(hex 'sym) -> num</code>
<dd>Converts a number <code>num</code> to a hexadecimal string, or a hexadecimal
string <code>sym</code> to a number. In the first case, if the second argument
is given, the result is separated by spaces into groups of such many digits. See
also <code><a href="refB.html#bin">bin</a></code>, <code><a
href="refO.html#oct">oct</a></code>, <code><a
href="refF.html#fmt64">fmt64</a></code>, <code><a
href="refH.html#hax">hax</a></code> and <code><a
href="refF.html#format">format</a></code>.
<pre><code>
: (hex 273)
-> "111"
: (hex "111")
-> 273
: (hex 1234567 4)
-> "12 D687"
</code></pre>
<dt><a name="host"><code>(host 'any) -> sym</code></a>
<dd>Returns the hostname corresponding to the given IP address. See also
<code><a href="refA.html#*Adr">*Adr</a></code>.
<pre><code>
: (host "80.190.158.9")
-> "www.leo.org"
</code></pre>
</dl>
</body>
</html>
|