- *Hup
- Global variable holding a (possibly empty) prgbody, which will
be executed when a SIGHUP signal is sent to the current process. See alsoalarm,sigio,*Winch,*Sig[12],*TStp[12]and*Term.
: (de *Hup (msg 'SIGHUP))
-> *Hup
 
- +Hook
- Prefix class for +relations,
typically+Linkor+Joint. In essence, this maintains an local
database in the referred object. See also Database.
(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
 
- +Hook2
- Prefix class for +indexrelations. It maintains both a normal (global) index, and an object-local index
in the corresponding+Hookobject.
See also Database.
(rel nm (+Hook2 +IdxFold +String) 3 shop)       # Global and shop-local index
 
- (h) -> flg
- (Debug mode only) Edits the history in memory with Vip. Returns
Tif Vip was exited with "x" andNILif exited with
"q". See alsohistoryandvi.
: (h)    # Edit history
-> T     # "x"
 
- (has 'any) -> lst
- (Debug mode only) Returns a list of all internal symbols which have the
value any. See alsowho,can,whatanddep.
: +
-> 270310
: (has 270310)
-> (+ @)
: meth
-> 267259
: (has 267259)
-> (@ js> dec> inc> upd> ele> log> chk> val> del> rel> all> url> zap> clr> str> has>
 
- (hash 'any) -> cnt
- Generates a 16-bit number (1-65536) from any, suitable as a
hash value for various purposes, like randomly balancedidxstructures. See alsocache,enum,revandseed.
: (hash 0)
-> 1
: (hash 1)
-> 55682
: (hash "abc")
-> 8986
 
- (hax 'num) -> sym
- (hax 'sym) -> num
- Converts a number numto a string in hexadecimal/alpha
notation, or a hexadecimal/alpha formatted string to a number. The digits are
represented with '@' (zero) and the letters 'A' -
'O' (from "alpha" to "omega"). This format is used internally for
the names ofexternal symbols.
See alsohex,binandoct.
: (hax 7)
-> "G"
: (hax 16)
-> "A@"
: (hax 255)
-> "OO"
: (hax "A")
-> 1
 
- (hd 'sym ['cnt]) -> NIL
- (Debug mode only) Displays a hexadecimal dump of the file given by
sym, limited tocntlines. See alsoproc.
:  (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
 
- (head 'cnt|lst 'lst) -> lst
- Returns a new list made of the first cntelements oflst. Ifcntis negative, it is added to the length oflst. If the first argument is alst,headis a predicate function returning that argument list if it isequalto the head of the second argument, andNILotherwise. See alsotailandpre?.
: (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)
 
- head/3
- Pilog predicate that succeeds if the first
(string) argument is a prefix of the string representation of the result of
applying the getalgorithm to the
following arguments. Typically used as filter predicate inselect/3database queries. See alsopre?,isa/2,same/3,bool/3,range/3,fold/3,part/3andtolr/3.
: (?
   @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={C3} @Name="Miller" @Phone="37 4773 82534"
-> NIL
- (heap 'flg) -> cnt
- Returns the total size of the cell heap space in megabytes. If
flgis non-NIL, the size of the currently free space
is returned. See alsostackandgc.
: (gc 4)
-> 4
: (heap)
-> 5
: (heap T)
-> 4
 
- (hear 'cnt) -> cnt
- Uses the file descriptor cntas 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 (seetell),hearis usually
only called explicitly by a top level parent process.
: (call 'mkfifo "fifo/cmd")
-> T
: (hear (open "fifo/cmd"))
-> 3
 
- (help 'sym ['flg]) -> sym
- (Debug mode only) Dumps the reference documentation for symto
the current output channel. Ifflgis non-NIL, the
examples are dumped too. See also Function Reference
anddoc.
: (help 'car)
========================================
(car 'var) -> any
List access: Returns the value of var if it is a symbol, or the first element if
it is a list. See also cdr and c..r.
-> car
: (help 'car T)
========================================
(car 'var) -> any
List access: Returns the value of var if it is a symbol, or the first element if
it is a list. See also cdr and c..r.
: (car (1 2 3 4 5 6))
-> 1
-> car
 
- (here ['sym]) -> sym
- Echoes the current input stream until symis encountered, or
until end of file. See alsoecho.
$ 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>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width"/>
<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>
 
- (hex 'num ['num]) -> sym
- (hex 'sym) -> num
- Converts a number numto a hexadecimal string, or a hexadecimal
stringsymto 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
alsobin,oct,haxandformat.
: (hex 273)
-> "111"
: (hex "111")
-> 273
: (hex 1234567 4)
-> "12 D687"
 
- (history ['lst]) -> lst
- When called without argument, historyreturns the currentreadline(3)history.lstis a list of strings.
Otherwise, the history is set tolst. See also Invocation.
: (+ 1 2 3)
-> 6
: (history)
-> ("(+ 1 2 3)" "(history)")
- (host 'any) -> sym
- Returns the hostname corresponding to the given IP address. See also
*Adr.
: (host "80.190.158.9")
-> "www.leo.org"