File: refT.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 (717 lines) | stat: -rw-r--r-- 25,594 bytes parent folder | download
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
<!--
# 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>T</title>
<link rel="stylesheet" href="doc.css" type="text/css">
</head>
<body>

<h1>T</h1>

<dl>

<dt><a id="*Term"><code>*Term</code></a></dt>
<dd>Global variable holding a (possibly empty) <code>prg</code> body, which will
be executed when a SIGTERM signal is sent to the current process. If it returns
non-<code>NIL</code>, the signal is ignored.
See also
<code><a href="refA.html#alarm">alarm</a></code>, <code><a
href="refS.html#sigio">sigio</a></code>, <code><a
href="refS.html#*Hup">*Hup</a></code>, <code><a
href="refW.html#*Winch">*Winch</a></code>, <code><a
href="refS.html#*Sig1">*Sig[12]</a></code> and <code><a
href="refT.html#*TStp1">*TStp[12]</a></code>.

<pre>
: (de *Term (msg 'SIGTERM) T)
-> *Term
</pre></dd>

<dt><a id="*TStp1"><code>*TStp1</code></a></dt>
<dt><a id="*TStp2"><code>*TStp2</code></a></dt>
<dd>Global variables holding (possibly empty) <code>prg</code> bodies, which
will be executed when a SIGTSTP signal (<code>*TStp1</code>) or a SIGCONT signal
(<code>*TStp2</code>) 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="refW.html#*Winch">*Winch</a></code>, <code><a
href="refS.html#*Sig1">*Sig[12]</a></code> and <code><a
href="refT.html#*Term">*Term</a></code>.

<pre>
: (de *TStp1 (msg 'SIGTSTP))
-> *TStp1
</pre></dd>

<dt><a id="*Tmp"><code>*Tmp</code></a></dt>
<dd>A global variable holding the temporary directory name created with <code><a
href="refT.html#tmp">tmp</a></code>. See also <code><a
href="refB.html#*Bye">*Bye</a></code>.

<pre>
: *Bye
-> ((saveHistory) (and *Tmp (call 'rm "-r" *Tmp)))
: (tmp "foo" 123)
-> "/home/app/.pil/tmp/27140/foo123"
: *Tmp
-> "/home/app/.pil/tmp/27140/"
</pre></dd>

<dt><a id="+Time"><code>+Time</code></a></dt>
<dd>Class for clock time values (as calculated by <code><a
href="refT.html#time">time</a></code>), a subclass of <code><a
href="refN.html#+Number">+Number</a></code>. See also <a
href="ref.html#dbase">Database</a>.

<pre>
(rel tim (+Time))  # Time of the day
</pre></dd>

<dt><a id="T"><code>T</code></a></dt>
<dd>A global constant, evaluating to itself. <code>T</code> is commonly returned
as the boolean value "true" (though any non-<code>NIL</code> values could be
used). It represents the absolute maximum, as it is larger than any other
object. As a property key, it is used to store <a
href="ref.html#pilog">Pilog</a> clauses, and inside Pilog clauses it is the
<i>cut</i> operator. See also <code><a href="ref.html#nilSym">NIL</a></code> and
and <a href="ref.html#cmp">Comparing</a>.

<pre>
: T
-> T
: (= 123 123)
-> T
: (get 'not T)
-> ((@P (1 @P) T (fail)) (@P))
</pre></dd>

<dt><a id="This"><code>This</code></a></dt>
<dd>Holds the current object during method execution (see <a
href="ref.html#oop">OO Concepts</a>), or inside the body of a <code><a
href="refW.html#with">with</a></code> statement. As it is a normal symbol,
however, it can be used in normal bindings anywhere. See also <code><a
href="refI.html#isa">isa</a></code>, <code><a href="ref_.html#:">:</a></code>,
<code><a href="ref_.html#=:">=:</a></code>, <code><a
href="ref_.html#::">::</a></code> and <code><a
href="refV.html#var:">var:</a></code>. See also
<code><a href="refW.html#with">with</a></code> and
<code><a href="refT.html#this">this</a></code>.

<pre>
: (with 'X (println 'This 'is This))
This is X
-> X
: (put 'X 'a 1)
-> 1
: (put 'X 'b 2)
-> 2
: (put 'Y 'a 111)
-> 111
: (put 'Y 'b 222)
-> 222
: (mapcar '((This) (cons (: a) (: b))) '(X Y))
-> ((1 . 2) (111 . 222))
</pre></dd>

<dt><a id="t"><code>(t . prg) -> T</code></a></dt>
<dd>Executes <code>prg</code>, and returns <code>T</code>. See also <code><a
href="refN.html#nil">nil</a></code>, <code><a
href="refP.html#prog">prog</a></code>, <code><a
href="refP.html#prog1">prog1</a></code> and <code><a
href="refP.html#prog2">prog2</a></code>.

<pre>
: (t (println 'OK))
OK
-> T
</pre></dd>

<dt><a id="tab"><code>(tab 'lst 'any ..) -> NIL</code></a></dt>
<dd>Print all <code>any</code> arguments in a tabular format. <code>lst</code>
should be a list of numbers, specifying the field width for each argument. All
items in a column will be left-aligned for negative numbers, otherwise
right-aligned. See also <code><a href="refA.html#align">align</a></code>,
<code><a href="refC.html#center">center</a></code> and <code><a
href="refW.html#wrap">wrap</a></code>.

<pre>
: (let Fmt (-3 14 14)
   (tab Fmt "Key" "Rand 1" "Rand 2")
   (tab Fmt "---" "------" "------")
   (for C '(A B C D E F)
      (tab Fmt C (rand) (rand)) ) )
Key        Rand 1        Rand 2
---        ------        ------
A               0    1481765933
B     -1062105905    -877267386
C      -956092119     812669700
D       553475508   -1702133896
E      1344887256   -1417066392
F      1812158119   -1999783937
-> NIL
</pre></dd>

<dt><a id="tail"><code>(tail 'cnt|lst 'lst) -> lst</code></a></dt>
<dd>Returns the last <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>tail</code> is a predicate
function returning that argument list if it is <code>equal</code> to the tail of
the second argument, and <code>NIL</code> otherwise. <code>(tail -2 Lst)</code>
is equivalent to <code>(nth Lst 3)</code>. See also <code><a
href="refO.html#offset">offset</a></code>, <code><a
href="refH.html#head">head</a></code>, <code><a
href="refL.html#last">last</a></code> and <code><a
href="refS.html#stem">stem</a></code>.

<pre>
: (tail 3 '(a b c d e f))
-> (d e f)
: (tail -2 '(a b c d e f))
-> (c d e f)
: (tail 0 '(a b c d e f))
-> NIL
: (tail 10 '(a b c d e f))
-> (a b c d e f)
: (tail '(d e f) '(a b c d e f))
-> (d e f)
</pre></dd>

<dt><a id="task"><code>(task 'num ['num] [sym 'any ..] [. prg]) -> lst</code></a></dt>
<dd>A front-end to the <code><a href="refR.html#*Run">*Run</a></code> global. If
called with only a single <code>num</code> argument, the corresponding entry is
removed from the value of <code>*Run</code>. Otherwise, a new entry is created.
If an entry with that key already exists, an error is issued. For negative
numbers, a second number must be supplied. If <code>sym</code>/<code>any</code>
arguments are given, a <code><a href="refJ.html#job">job</a></code> environment
is built for the <code>*Run</code> entry. See also <code><a
href="refT.html#tasks">tasks</a></code> and <code><a
href="refT.html#timeout">timeout</a></code>.

<pre>
: (task -10000 5000 N 0 (tty (println (inc 'N))))  # Install task for every 10 seconds
-> (-10000 5000 (job '((N . 0)) (tty (println (inc 'N)))))
: 1                                                # ... after 5 seconds
2                                                  # ... after 10 seconds
3                                                  # ... after 10 seconds
(task -10000)                                      # remove again
-> NIL

: (task (port T 4444) (eval (udp @)))              # Receive RPC via UDP
-> (3 (eval (udp @)))

# Another session (on the same machine)
: (udp "localhost" 4444 '(println *Pid))  # Send RPC message
-> (println *Pid)
</pre></dd>

<dt><a id="tasks"><code>(tasks . prg)</code></a></dt>
<dd>Runs a <code><a href="refT.html#task">task</a></code> with variable event
specification in a single <code><a href="refR.html#*Run">*Run</a></code> entry.
The task body <code>prg</code> should return either a positive number (a file
descriptor) or a negative number (a timeout value) to be used in the next
iteration. The first value must be a timeout. A value of <code>NIL</code>
removes the task. Uses <code>-2</code> as implicit key. See also <code><a
href="refT.html#timeout">timeout</a></code>.

<pre>
(tasks  # Three iterations with varying timeout
   (let X (pop '(((-1000 . a) (-4000 . b) (-1000 . c))))
      (tty (println (cdr X)))
      (car X) ) )

(tasks
   (co 'echoes  # Coroutine
      (use S
         (loop  # Loop infinitely
            (yield -4000)  # First wait 4 seconds
            (tty (println 'OK))
            (yield  # Then wait for remote data
               (setq S
                  (pipe (exec "sh" "-c" "sleep 2; echo 7")) ) )
            (tty (println (in S (read))))
            (close S) ) ) ) )
</pre></dd>

<dt><a id="tco"><code>(tco lst . prg) -> any</code></a></dt>
<dt><a id="tc"><code>(tc ['any ..])</code></a></dt>
<dd>Tail call optimization. <code>tco</code> implements a loop which is
restarted whenever <code>tc</code> is called during the execution of
<code>prg</code>. This is faster and uses much less stack space than a recursive
function call. <code>lst</code> is a list of parameter symbols. <code>tc</code>
must be the very last function called in a function body. See also <code><a
href="refR.html#recur">recur</a></code> and <code><a
href="refC.html#catch">catch</a></code>.

<pre>
: (de f (N)
   (if (=0 N)
      'OK
      (printsp N)
      (f (dec N)) ) )  # Recursive call
-> f
: (f 8)
8 7 6 5 4 3 2 1 -> OK

# Equivalent to
: (de f (N)
   (tco (N)
      (if (=0 N)
         'OK
         (printsp N)
         (tc (dec N)) ) ) )  # Tail call
-> f
: (f 8)
8 7 6 5 4 3 2 1 -> OK

# Mutually recursive functions
: (de f (N)
   (tco (N)
      (if (le0 N)
         'OK
         (printsp N)
         (g (dec N)) ) ) )
-> f
: (de g (N)
   (if (le0 N)
      'OK
      (tc (dec N)) ) )  # Tail call
-> g
: (f 8)
8 6 4 2 -> OK
</pre></dd>

<dt><a id="telStr"><code>(telStr 'sym) -> sym</code></a></dt>
<dd>Formats a telephone number according to the current <code><a
href="refL.html#locale">locale</a></code>. If the string head matches the local
country code, it is replaced with the national trunk prefix, otherwise
<code>+</code> is prepended. See also <code><a
href="refE.html#expTel">expTel</a></code>, <code><a
href="refD.html#datStr">datStr</a></code>, <code><a
href="refM.html#money">money</a></code> and <code><a
href="refF.html#format">format</a></code>.

<pre>
: (telStr "49 1234 5678-0")
-> "+49 1234 5678-0"
: (locale "DE" "de")
-> NIL
: (telStr "49 1234 5678-0")
-> "01234 5678-0"
</pre></dd>

<dt><a id="tell"><code>(tell ['cnt] 'sym ['any ..]) -> any</code></a></dt>
<dd>Family IPC: Send an executable list <code>(sym any ..)</code> to all family
members (i.e. all children of the current process, and all other children of the
parent process, see <code><a href="refF.html#fork">fork</a></code>) for
automatic execution. When the <code>cnt</code> argument is given and non-zero,
it should be the PID of such a process, and the list will be sent only to that
process. If <code>cnt</code> is zero, the list will be sent to the parent
process instead. When called without arguments, no message is actually sent, and
the parent process may grant <code><a href="refS.html#sync">sync</a></code> to
the next waiting process. <code>tell</code> is also used internally by <code><a
href="refC.html#commit">commit</a></code> to notify about database changes. When
called explicitly, the size of the message is limited to the POSIX constant
PIPE_BUF. See also <code><a href="refK.html#kids">kids</a></code>, <code><a
href="refD.html#detach">detach</a></code> and <code><a
href="refH.html#hear">hear</a></code>.

<pre>
: (call 'ps "x")                          # Show processes
  PID TTY      STAT   TIME COMMAND
  ..
 1321 pts/0    S      0:00 /usr/bin/picolisp ..  # Parent process
 1324 pts/0    S      0:01 /usr/bin/picolisp ..  # First child
 1325 pts/0    S      0:01 /usr/bin/picolisp ..  # Second child
 1326 pts/0    R      0:00 ps x
-> T
: *Pid                                    # We are the second child
-> 1325
: (tell 'println '*Pid)                   # Ask all others to print their Pid's
1324
-> *Pid
</pre></dd>

<dt><a id="test"><code>(test 'any . prg)</code></a></dt>
<dd>Executes <code>prg</code>, and issues an <code><a
href="ref.html#errors">error</a></code> if the result does not <code><a
href="refM.html#match">match</a></code> the <code>any</code> argument. See also
<code><a href="refA.html#assert">assert</a></code>.

<pre>
: (test 12 (* 3 4))
-> NIL
: (test 12 (+ 3 4))
((+ 3 4))
12 -- 'test' failed
?
</pre></dd>

<dt><a id="text"><code>(text 'any1 'any ..) -> sym</code></a></dt>
<dd>Builds a new transient symbol (string) from the string representation of
<code>any1</code>, by replacing all occurrences of an at-mark "<code>@</code>",
followed by one of the letters "<code>1</code>" through "<code>9</code>", and
"<code>A</code>" through "<code>Z</code>", with the corresponding
<code>any</code> argument. In this context "<code>@A</code>" refers to the 10th
argument. A literal at-mark in the text can be represented by two successive
at-marks. See also <code><a href="refP.html#pack">pack</a></code> and <code><a
href="refG.html#glue">glue</a></code>.

<pre>
: (text "abc @1 def @2" 'XYZ 123)
-> "abc XYZ def 123"
: (text "a@@bc.@1" "de")
-> "a@bc.de"
</pre></dd>

<dt><a id="this"><code>(this 'any) -> any</code></a></dt>
<dd>Sets the current object <code><a
href="refT.html#This">This</a></code> to the new value <code>any</code>.
<code>(this 'any)</code> is equivalent to <code>(setq This 'any)</code>.
See also <code><a href="refW.html#with">with</a></code>.

<pre>
: (this 'X)
-> X
: This
-> X
</pre></dd>

<dt><a id="throw"><code>(throw 'sym 'any)</code></a></dt>
<dd>Non-local jump into a previous <code><a
href="refC.html#catch">catch</a></code> environment with the jump label
<code>sym</code> (or <code>T</code> as a catch-all). Any pending <code><a
href="refF.html#finally">finally</a></code> expressions are executed, local
symbol bindings are restored, open files are closed and internal data structures
are reset appropriately, as the environment was at the time when the
corresponding <code>catch</code> was called. Then <code>any</code> is returned
from that <code>catch</code>. See also <code><a
href="refQ.html#quit">quit</a></code>.

<pre>
: (de foo (N)
   (println N)
   (throw 'OK) )
-> foo
: (let N 1  (catch 'OK (foo 7))  (println N))
7
1
-> 1
</pre></dd>

<dt><a id="till"><code>(till 'any ['flg]) -> lst|sym</code></a></dt>
<dd>Reads from the current input channel till a character contained in
<code>any</code> is found (or until end of file if <code>any</code> is
<code>NIL</code>). If <code>flg</code> is <code>NIL</code>, a list of
single-character transient symbols is returned. Otherwise, a single string is
returned. See also <code><a href="refF.html#from">from</a></code> and <code><a
href="refL.html#line">line</a></code>.

<pre>
: (till ":")
abc:def
-> ("a" "b" "c")
: (till ":" T)
abc:def
-> "abc"
</pre></dd>

<dt><a id="tim$"><code>(tim$ 'tim ['flg]) -> sym</code></a></dt>
<dd>Formats a <code><a href="refT.html#time">time</a></code> <code>tim</code>.
If <code>flg</code> is <code>NIL</code>, the format is HH:MM, otherwise it is
HH:MM:SS. See also <code><a href="ref_.html#$tim">$tim</a></code> and <code><a
href="refD.html#dat$">dat$</a></code>.

<pre>
: (tim$ (time))
-> "10:57"
: (tim$ (time) T)
-> "10:57:56"
</pre></dd>

<dt><a id="time"><code>(time ['T]) -> tim</code></a></dt>
<dt><code>(time 'tim) -> (h m s)</code></dt>
<dt><code>(time 'h 'm ['s]) -> tim | NIL</code></dt>
<dt><code>(time '(h m [s])) -> tim | NIL</code></dt>
<dd>Calculates the time of day, represented as the number of seconds since
midnight. When called without arguments, the current local time is returned.
When called with a <code>T</code> argument, the time of the last call to
<code><a href="refD.html#date">date</a></code> is returned. When called with a
single number <code>tim</code>, it is taken as a time value and a list with the
corresponding hour, minute and second is returned. When called with two or three
numbers (or a list of two or three numbers) for the hour, minute (and optionally
the second), the corresponding time value is returned (or <code>NIL</code> if
they do not represent a legal time). See also <code><a
href="refD.html#date">date</a></code>, <code><a
href="refS.html#stamp">stamp</a></code>, <code><a
href="refU.html#usec">usec</a></code>, <code><a
href="refT.html#tim$">tim$</a></code> and <code><a
href="ref_.html#$tim">$tim</a></code>.

<pre>
: (time)                         # Now
-> 32334
: (time 32334)                   # Now
-> (8 58 54)
: (time 12 70)                   # Illegal time
-> NIL
</pre></dd>

<dt><a id="timeout"><code>(timeout ['num])</code></a></dt>
<dd>Sets or refreshes a timeout value in the <code><a
href="refR.html#*Run">*Run</a></code> global, so that the current process
executes <code><a href="refB.html#bye">bye</a></code> after the given period. If
called without arguments, the timeout is removed. Uses <code>-1</code> as
implicit key. See also <code><a href="refT.html#task">task</a></code>.

<pre>
: (timeout 3600000)           # Timeout after one hour
-> (-1 3600000 (bye))
: *Run                        # Look after a few seconds
-> ((-1 3574516 (bye)))
</pre></dd>

<dt><a id="tmp"><code>(tmp ['any ..]) -> sym</code></a></dt>
<dd>Returns the path name to the <code><a
href="refP.html#pack">pack</a></code>ed <code>any</code> arguments in a
process-local temporary directory. The directory name consists of the path to
".pil/tmp/" in the user's home directory, followed by the current process ID
<code><a href="refP.html#*Pid">*Pid</a></code>. This directory is automatically
created if necessary, and removed upon termination of the process (<code><a
href="refB.html#bye">bye</a></code>). See also <code><a
href="refT.html#*Tmp">*Tmp</a></code> and <code><a
href="refB.html#*Bye">*Bye</a></code> .

<pre>
: *Pid
-> 27140
: (tmp "foo" 123)
-> "/home/app/.pil/tmp/27140/foo123"
: (out (tmp "foo" 123) (println 'OK))
-> OK
: (dir (tmp))
-> ("foo123")
: (in (tmp "foo" 123) (read))
-> OK
</pre></dd>

<dt><a id="tolr/3"><code>tolr/3</code></a></dt>
<dd>(Deprecated since version 25.5.30) <a
href="ref.html#pilog">Pilog</a> predicate that succeeds if the first
argument, after <code><a href="refF.html#fold">fold</a></code>ing it to
a canonical form, is either a <i>substring</i> or a <code><a
href="refS.html#+Sn">+Sn</a></code> <i>soundex</i> match 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="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="refH.html#head/3">head/3</a></code>, <code><a
href="refF.html#fold/3">fold/3</a></code> and <code><a
href="refP.html#part/3">part/3</a></code>.

<pre>
: (?
   @Nr (1 . 5)
   @Nm "Sven"
   (select (@CuSu)
      ((nr +CuSu @Nr) (nm +CuSu @Nm))
      (range @Nr @CuSu nr)
      (tolr @Nm @CuSu nm) )
   (val @Name @CuSu nm) )
 @Nr=(1 . 5) @Nm="Sven" @CuSu={C2} @Name="Seven Oaks Ltd."
</pre></dd>

<dt><a id="touch"><code>(touch 'sym) -> sym</code></a></dt>
<dd>When <code>sym</code> is an external symbol, it is marked as "modified" so
that upon a later <code><a href="refC.html#commit">commit</a></code> it will be
written to the database file. An explicit call of <code>touch</code> is only
necessary when the value or properties of <code>sym</code> are indirectly
modified.

<pre>
: (get '{2} 'lst)
-> (1 2 3 4 5)
: (set (cdr (get (touch '{2}) 'lst)) 999)    # Only read-access, need 'touch'
-> 999
: (get '{2} 'lst)                            # Modified second list element
-> (1 999 3 4 5)
</pre></dd>

<dt><a id="trace"><code>(trace 'sym)</code></a></dt>
<dt><code>(trace 'sym 'cls)</code></dt>
<dt><code>(trace '(sym . cls))</code></dt>
<dd>(Debug mode only) Inserts a <code><a href="ref_.html#$">$</a></code> trace
function call at the beginning of the function or method body of
<code>sym</code>, so that trace information will be printed before and after
execution. Can only be used with EXPRs and SUBRs. Built-in functions (SUBRs) are
automatically converted to Lisp expressions (see <code><a
href="refE.html#expr">expr</a></code>). See also <code><a
href="refD.html#*Dbg">*Dbg</a></code>, <code><a
href="refT.html#traceAll">traceAll</a></code> and <code><a
href="refU.html#untrace">untrace</a></code>, <code><a
href="refD.html#debug">debug</a></code> and <code><a
href="refL.html#lint">lint</a></code>.

<pre>
: (trace '+)
-> +
: (+ 3 4)
 + : 3 4
 + = 7
-> 7
</pre></dd>

<dt><a id="-trace"><code>(-trace)</code></a></dt>
<dd>(Debug mode only) Command line frontend to <code><a
href="refT.html#trace">trace</a></code>. See also <code><a
href="refD.html#-debug">-debug</a></code>.

<pre>
$ ./pil --trace append +
: (append (1 2 3) (4 5 6))
 append : (1 2 3) (4 5 6)
 append = (1 2 3 4 5 6)
-> (1 2 3 4 5 6)
</pre></dd>

<dt><a id="traceAll"><code>(traceAll ['lst]) -> sym</code></a></dt>
<dd>(Debug mode only) Traces all Lisp level functions by inserting a <code><a
href="ref_.html#$">$</a></code> function call at the beginning. <code>lst</code>
may contain symbols which are to be excluded from that process. In addition, all
symbols in the global variable <code>*NoTrace</code> are excluded. See also
<code><a href="refT.html#trace">trace</a></code>, <code><a
href="refU.html#untrace">untrace</a></code> and <code><a
href="refD.html#*Dbg">*Dbg</a></code>.

<pre>
: (traceAll)      # Trace all Lisp level functions
-> balance
</pre></dd>

<dt><a id="trail"><code>(trail ['flg]) -> lst</code></a></dt>
<dd>Returns a stack backtrace for the current point of program execution. The
list elements are either list expressions (denoting function or method calls),
or symbols followed by their corresponding values. If <code>flg</code> is
<code>NIL</code>, the symbols and their values are omitted, and only the
expressions are returned. See also <code><a href="refB.html#bt">bt</a></code>,
<code><a href="refU.html#up">up</a></code> and <code><a
href="refE.html#env">env</a></code>.

<pre>
: (de f (A B)
   (g (inc A) (dec B)) )
-> f
: (de g (X Y)
   (trail T) )
-> g
: (f 3 4)
-> ((f 3 4) A 3 B 4 (g (inc A) (dec B)) X 4 Y 3)
</pre></dd>

<dt><a id="tree"><code>(tree 'sym 'cls ['hook]) -> tree</code></a></dt>
<dd>Returns a data structure specifying a database index tree. <code>sym</code>
and <code>cls</code> determine the relation, with an optional <code>hook</code>
object. See also <code><a href="refR.html#root">root</a></code>, <code><a
href="refF.html#fetch">fetch</a></code>, <code><a
href="refS.html#store">store</a></code>, <code><a
href="refC.html#count">count</a></code>, <code><a
href="refL.html#leaf">leaf</a></code>, <code><a
href="refM.html#minKey">minKey</a></code>, <code><a
href="refM.html#maxKey">maxKey</a></code>, <code><a
href="refI.html#init">init</a></code>, <code><a
href="refS.html#step">step</a></code>, <code><a
href="refS.html#scan">scan</a></code>, <code><a
href="refI.html#iter">iter</a></code>, <code><a
href="refP.html#prune">prune</a></code>, <code><a
href="refZ.html#zapTree">zapTree</a></code> and <code><a
href="refC.html#chkTree">chkTree</a></code>.

<pre>
: (tree 'nm '+Item)
-> (nm . +Item)
</pre></dd>

<dt><a id="trim"><code>(trim 'lst) -> lst</code></a></dt>
<dd>Returns a copy of <code>lst</code> with all trailing whitespace characters
or <code>NIL</code> elements removed. See also <code><a
href="refC.html#clip">clip</a></code>.

<pre>
: (trim (1 NIL 2 NIL NIL))
-> (1 NIL 2)
: (trim '(a b " " " "))
-> (a b)
</pre></dd>

<dt><a id="true/0"><code>true/0</code></a></dt>
<dd><a href="ref.html#pilog">Pilog</a> predicate that always succeeds. See also
<code><a href="refF.html#fail/0">fail/0</a></code> and <code><a
href="refR.html#repeat/0">repeat/0</a></code>.

<pre>
:  (? (true))
-> T
</pre></dd>

<dt><a id="try"><code>(try 'msg 'obj ['any ..]) -> any</code></a></dt>
<dd>Tries to send the message <code>msg</code> to the object <code>obj</code>,
optionally with arguments <code>any</code>. If <code>obj</code> is not an
object, or if the message cannot be located in <code>obj</code>, in its classes
or superclasses, <code>NIL</code> is returned. See also <a
href="ref.html#oop">OO Concepts</a>, <code><a
href="refS.html#send">send</a></code>, <code><a
href="refM.html#method">method</a></code>, <code><a
href="refM.html#meth">meth</a></code>, <code><a
href="refS.html#super">super</a></code> and <code><a
href="refE.html#extra">extra</a></code>.

<pre>
: (try 'msg> 123)
-> NIL
: (try 'html> 'a)
-> NIL
</pre></dd>

<dt><a id="tty"><code>(tty . prg) -> any</code></a></dt>
<dd>Redirects the current output channel to the terminal (stderr) during the
execution of <code>prg</code>. The current output channel and the state of
<code>readline(3)</code> will be saved and restored appropriately. See also
<code><a href="refO.html#out">out</a></code>.

<pre>
: (task -2000 0 (tty (println (inc (0)))))
-> (-2000 0 (tty (println (inc (0)))))
1
2
3
: (* 3 4)  # Typed while numbers are printed
</pre></dd>

<dt><a id="type"><code>(type 'any) -> lst</code></a></dt>
<dd>Return the type (list of classes) of the object <code>any</code>. See also
<a href="ref.html#oop">OO Concepts</a>, <code><a
href="refI.html#isa">isa</a></code>, <code><a
href="refC.html#class">class</a></code>, <code><a
href="refN.html#new">new</a></code> and <code><a
href="refO.html#object">object</a></code>.

<pre>
: (type '{1A;3})
(+Address)
: (type '+DnButton)
-> (+Tiny +Rid +JS +Able +Button)
</pre></dd>

</dl>

</body>
</html>