Commit | Line | Data |
---|---|---|
3edcb7c8 KB |
1 | .\" Copyright (c) 1980 The Regents of the University of California. |
2 | .\" All rights reserved. | |
e105ea67 | 3 | .\" |
3edcb7c8 KB |
4 | .\" %sccs.include.redist.roff% |
5 | .\" | |
6 | .\" @(#)ch6.n 6.2 (Berkeley) %G% | |
e105ea67 | 7 | .\" |
c2858780 NC |
8 | ." $Header: ch6.n,v 1.4 83/07/21 21:08:16 sklower Exp $ |
9 | .Lc System\ Functions 6 | |
10 | .pp | |
11 | This chapter describes the functions used to interact | |
12 | with internal components of the Lisp system and operating system. | |
13 | .Lf allocate "'s_type 'x_pages" | |
14 | .Wh | |
15 | s_type is one of the | |
16 | .Fr | |
17 | data types described in \(sc1.3. | |
18 | .Re | |
19 | x_pages. | |
20 | .Se | |
21 | .Fr | |
22 | attempts to allocate x_pages of type s_type. | |
23 | If there aren't x_pages of memory left, no space will be | |
24 | allocated and an error will occur. | |
25 | The storage that is allocated is not given to the caller, instead it is | |
26 | added to the free storage list of s_type. | |
27 | The functions | |
28 | .i segment | |
29 | and | |
30 | .i small-segment | |
31 | allocate blocks of storage and return it to the caller. | |
32 | .Lf argv "'x_argnumb" | |
33 | .Re | |
34 | a symbol whose pname is the x_argnumb\fIth\fP argument (starting at 0) | |
35 | on the command | |
36 | line which invoked the current lisp. | |
37 | .No | |
38 | if x_argnumb is less than zero, a fixnum whose value is the number of arguments | |
39 | on the command line is returned. | |
40 | \fI(argv\ 0)\fP returns the name of the lisp you are running. | |
41 | .Lf baktrace | |
42 | .Re | |
43 | nil | |
44 | .Se | |
45 | the lisp runtime stack is examined and the name of (most) of the functions | |
46 | currently in execution are printed, most active first. | |
47 | .No | |
48 | this will occasionally miss the names of compiled lisp functions due to | |
49 | incomplete information on the stack. | |
50 | If you are tracing compiled code, then \fIbaktrace\fP won't be able | |
51 | to interpret the stack unless | |
52 | .i (sstatus\ translink\ nil) | |
53 | was done. | |
54 | See the function | |
55 | .i showstack | |
56 | for another way of printing the lisp runtime | |
57 | stack. | |
58 | This misspelling is from Maclisp. | |
59 | .Lf chdir "'s_path" | |
60 | .Re | |
61 | t iff the system call succeeds. | |
62 | .Se | |
63 | the current directory set to s_path. | |
64 | Among other things, this will affect the default location | |
65 | where the input/output functions look for and create files. | |
66 | .No | |
67 | \fIchdir\fP follows the standard UNIX conventions, if s_path does not begin | |
68 | with a slash, the default path is changed to the current path with | |
69 | s_path appended. | |
70 | .i Chdir | |
71 | employs tilde-expansion (discussed in Chapter 5). | |
72 | .Lf command-line-args | |
73 | .Re | |
74 | a list of the arguments typed on the command line, either to the | |
75 | lisp interpreter, or saved lisp dump, or application compiled | |
76 | with the autorun option (liszt -r). | |
77 | .Lf deref "'x_addr" | |
78 | .Re | |
79 | The contents of x_addr, when thought of as a longword memory | |
80 | location. | |
81 | .No | |
82 | This may be useful in constructing arguments to C functions | |
83 | out of `dangerous' areas of memory. | |
84 | .Lf dumplisp "s_name" | |
85 | .Re | |
86 | nil | |
87 | .Se | |
88 | the current lisp is dumped to the named file. | |
89 | When s_name is executed, you will be in a lisp in the | |
90 | same state as when the dumplisp was done. | |
91 | .No | |
92 | dumplisp will fail if one tries to | |
93 | write over the current running file. | |
94 | UNIX does not allow you to modify the file you are running. | |
95 | .Lf eval-when "l_time g_exp1 ..." | |
96 | .Se | |
97 | l_time may contain any combination of the symbols | |
98 | .i load , | |
99 | .i eval , | |
100 | and | |
101 | .i compile . | |
102 | The effects of load and compile is discussed in \(sc12.3.2.1 | |
103 | compiler. | |
104 | If eval is present however, this simply means that the expressions g_exp1 | |
105 | and so on are evaluated from left to right. | |
106 | If eval is not present, the forms are not evaluated. | |
107 | .Lf exit "['x_code]" | |
108 | .Re | |
109 | nothing (it never returns). | |
110 | .Se | |
111 | the lisp system dies with exit code x_code or 0 if x_code is not | |
112 | specified. | |
113 | .Lf fake "'x_addr" | |
114 | .Re | |
115 | the lisp object at address x_addr. | |
116 | .No | |
117 | This is intended to be used by people debugging the lisp system. | |
118 | .Lf fork | |
119 | .Re | |
120 | nil to the child process and the process number of the child to | |
121 | the parent. | |
122 | .Se | |
123 | A copy of the current lisp system is made in memory and both | |
124 | lisp systems now begin to run. | |
125 | This function can be used interactively to temporarily | |
126 | save the state of Lisp (as shown below), but you must be careful that only one | |
127 | of the lisp's interacts with the terminal after the fork. | |
128 | The | |
129 | .i wait | |
130 | function is useful for this. | |
131 | .Eb | |
132 | \-> \fI(setq foo 'bar)\fP ;; set a variable | |
133 | bar | |
134 | \-> \fI(cond ((fork)(wait)))\fP ;; duplicate the lisp system and | |
135 | nil ;; make the parent wait | |
136 | \-> \fIfoo\fP ;; check the value of the variable | |
137 | bar | |
138 | \-> \fI(setq foo 'baz)\fP ;; give it a new value | |
139 | baz | |
140 | \-> \fIfoo\fP ;; make sure it worked | |
141 | baz | |
142 | \-> \fI(exit)\fP ;; exit the child | |
143 | (5274 . 0) ;; the \fIwait\fP function returns this | |
144 | \-> \fIfoo\fP ;; we check to make sure parent was | |
145 | bar ;; not modified. | |
146 | .Ee | |
147 | .Lf gc | |
148 | .Re | |
149 | nil | |
150 | .Se | |
151 | this causes a garbage collection. | |
152 | .No | |
153 | The function | |
154 | .i gcafter | |
155 | is not called automatically after this function finishes. | |
156 | Normally the user doesn't have to call | |
157 | .i gc | |
158 | since | |
159 | garbage collection occurs automatically whenever internal free lists | |
160 | are exhausted. | |
161 | .Lf gcafter "s_type" | |
162 | .Wh | |
163 | s_type is one of the | |
164 | .Fr | |
165 | data types listed in \(sc1.3. | |
166 | .No | |
167 | this function is called by the garbage collector | |
168 | after a garbage collection which was caused by running out of | |
169 | data type s_type. | |
170 | This function should determine if more space need be allocated | |
171 | and if so should allocate it. | |
172 | There is a default gcafter function but users who want control over | |
173 | space allocation can define their own -- but note that it must be | |
174 | an nlambda. | |
175 | .Lf getenv "'s_name" | |
176 | .Re | |
177 | a symbol whose pname is the value of s_name in the current | |
178 | UNIX environment. | |
179 | If s_name doesn't exist in the current environment, a symbol with a null pname | |
180 | is returned. | |
181 | .Lf hashtabstat | |
182 | .Re | |
183 | a list of fixnums representing the number of symbols in each bucket of | |
184 | the oblist. | |
185 | .No | |
186 | the oblist is stored a hash table of buckets. | |
187 | Ideally there would be the same number of symbols in each bucket. | |
188 | .Lf help "[sx_arg]" | |
189 | .Se | |
190 | If sx_arg is a symbol then | |
191 | the portion of this manual beginning with the description of sx_arg | |
192 | is printed on the terminal. | |
193 | If sx_arg is a fixnum or the name of one of the appendicies, that | |
194 | chapter or appendix is printed on the terminal. | |
195 | If no argument is provided, | |
196 | .i help | |
197 | prints the options that it recognizes. | |
198 | The program `more' is used to print the manual on the terminal; it will | |
199 | stop after each page and will continue after the space key is pressed. | |
200 | .Lf include "s_filename" | |
201 | .Re | |
202 | nil | |
203 | .Se | |
204 | The given filename is | |
205 | .i load ed | |
206 | into the lisp. | |
207 | .No | |
208 | this is similar to load except the argument is not evaluated. | |
209 | Include means something special to the compiler. | |
210 | .Lf include-if "'g_predicate s_filename" | |
211 | .Re | |
212 | nil | |
213 | .Se | |
214 | This has the same effect as include, but is only actuated | |
215 | if the predicate is non-nil. | |
216 | .Lf includef "'s_filename" | |
217 | .Re | |
218 | nil | |
219 | .Se | |
220 | this is the same as | |
221 | .i include | |
222 | except the argument is evaluated. | |
223 | .Lf includef-if "'g_predicate s_filename" | |
224 | .Re | |
225 | nil | |
226 | .Se | |
227 | This has the same effect as includef, but is only actuated | |
228 | if the predicate is non-nil. | |
229 | .Lf maknum "'g_arg" | |
230 | .Re | |
231 | the address of its argument converted into a fixnum. | |
232 | .Lf monitor "['xs_maxaddr]" | |
233 | .Re | |
234 | t | |
235 | .Se | |
236 | If xs_maxaddr is t then profiling of the entire lisp system is begun. | |
237 | If xs_maxaddr is a fixnum then profiling is done only up to address | |
238 | xs_maxaddr. | |
239 | If xs_maxaddr is not given, then profiling is stopped and the data | |
240 | obtained is written to the file 'mon.out' where it can be analyzed | |
241 | with the UNIX 'prof' program. | |
242 | .No | |
243 | this function only works if the lisp system has been compiled | |
244 | in a special way, otherwise, an error is invoked. | |
245 | .Lf opval "'s_arg ['g_newval]" | |
246 | .Re | |
247 | the value associated with s_arg before the call. | |
248 | .Se | |
249 | If g_newval is specified, the value associated with s_arg is changed to | |
250 | g_newval. | |
251 | .No | |
252 | \fIopval\fP keeps track of storage allocation. If s_arg is one of the data types | |
253 | then \fIopval\fP will return a list of three fixnums representing the number of | |
254 | items of that type in use, the number of pages allocated and the number | |
255 | of items of that type per page. | |
256 | You should never try to change the value \fIopval\fP associates | |
257 | with a data type using | |
258 | \fIopval\fP. | |
259 | .br | |
260 | If s_arg is | |
261 | .i pagelimit | |
262 | then | |
263 | .i opval | |
264 | will return (and set if g_newval is given) | |
265 | the maximum amount of lisp data pages | |
266 | it will allocate. | |
267 | This limit should remain small unless you know your program requires | |
268 | lots of space as this limit will catch programs in infinite loops which | |
269 | gobble up memory. | |
270 | .Lf *process "'st_command ['g_readp ['g_writep]]" | |
271 | .Re | |
272 | either a fixnum if one argument is given, or a list of two ports and a | |
273 | fixnum if two or three arguments are given. | |
274 | .No | |
275 | \fI*process\fP starts another process by passing st_command to the shell | |
276 | (it first tries /bin/csh, then it tries /bin/sh if /bin/csh doesn't exist). | |
277 | If only one argument is given to \fI*process\fP, | |
278 | \fI*process\fP waits for the new | |
279 | process to die and then returns the exit code of the new process. | |
280 | If more two or three arguments are given, \fI*process\fP starts the process | |
281 | and then returns a list which, depending on the value of g_readp | |
282 | and g_writep, may contain i/o ports for communcating with the new | |
283 | process. | |
284 | If g_writep is non-null, then a port will be created which the lisp program | |
285 | can use to send characters to the new process. | |
286 | If g_readp is non-null, then a port will be created which the lisp program | |
287 | can use to read characters from the new process. | |
288 | The value returned by \fI*process\fP is (readport\ writeport\ pid) | |
289 | where readport and writeport are either nil or a port based on the value | |
290 | of g_readp and g_writep. Pid is the process id of the new process. | |
291 | Since it is hard to remember the order of g_readp and g_writep, the | |
292 | functions \fI*process-send\fP and \fI*process-receive\fP were written to | |
293 | perform the common functions. | |
294 | .Lf *process-receive "'st_command" | |
295 | .Re | |
296 | a port which can be read. | |
297 | .Se | |
298 | The command st_command is given to the shell and it is started running in the | |
299 | background. | |
300 | The output of that command is available for reading via the port returned. | |
301 | The input of the command process is set to /dev/null. | |
302 | .Lf *process-send "'st_command" | |
303 | .Re | |
304 | a port which can be written to. | |
305 | .Se | |
306 | The command st_command is given to the shell and it is started runing in the | |
307 | background. | |
308 | The lisp program can provide input for that command | |
309 | by sending characters to the port returned by this function. | |
310 | The output of the command process is set to /dev/null. | |
311 | .Lf process "s_pgrm [s_frompipe s_topipe]" | |
312 | .Re | |
313 | if the optional arguments are | |
314 | not present a fixnum which is the exit code when s_prgm dies. | |
315 | If the optional arguments are present, it returns a fixnum which | |
316 | is the process id of the child. | |
317 | .No | |
318 | This command is obsolete. | |
319 | New programs should use one of the \fI*process\fP commands | |
320 | given above. | |
321 | .Se | |
322 | If s_frompipe and s_topipe are given, they are bound to | |
323 | ports which are pipes which | |
324 | direct characters from | |
325 | .Fr | |
326 | to the new process | |
327 | and to | |
328 | .Fr | |
329 | from the new process respectively. | |
330 | .i Process | |
331 | forks a process named s_prgm and waits for it to die iff there | |
332 | are no pipe arguments given. | |
333 | .Lf ptime | |
334 | .Re | |
335 | a list of two elements. | |
336 | The first is the amount of processor time used | |
337 | by the lisp system so far, and the | |
338 | second is the amount of time used by the garbage collector so far. | |
339 | .No | |
340 | the time is measured in those units used by the | |
341 | .i times (2) | |
342 | system call, usually 60\fIth\fPs of a second. | |
343 | The first number includes the second number. | |
344 | The amount of time used by garbage collection is not recorded | |
345 | until the first call to ptime. | |
346 | This is done to prevent overhead when the user is not interested in | |
347 | garbage collection times. | |
348 | .Lf reset | |
349 | .Se | |
350 | the lisp runtime stack is cleared and the system restarts at the top level | |
351 | by executing a \fI(funcall\ top-level\ nil)\fP. | |
352 | .Lf restorelisp "'s_name" | |
353 | .Se | |
354 | this reads in file s_name (which was created by | |
355 | .i savelisp ) | |
356 | and then does a \fI(reset)\fP. | |
357 | .No | |
358 | This is only used on VMS systems where | |
359 | .i dumplisp | |
360 | cannot be used. | |
361 | .Lf retbrk "['x_level] | |
362 | .Wh | |
363 | x_level is a small integer of either sign. | |
364 | .Se | |
365 | The default error handler keeps a notion of the current level | |
366 | of the error caught. If x_level is negative, control is thrown | |
367 | to this default error handler whose level is that many less than | |
368 | the present, or to \fItop-level\fP if there aren't enough. | |
369 | If x_level is non-negative, control is passed to the handler at | |
370 | that level. If x_level is not present, the value -1 is taken by | |
371 | default. | |
372 | .Lf *rset "'g_flag" | |
373 | .Re | |
374 | g_flag | |
375 | .Se | |
376 | If g_flag is non nil then the lisp system will maintain extra information | |
377 | about calls to \fIeval\fP and \fIfuncall\fP. | |
378 | This record keeping slows down the evaluation but this is | |
379 | required for the functions | |
380 | \fIevalhook\fP, \fIfuncallhook\fP, and \fIevalframe\fP to work. | |
381 | To debug compiled lisp code the transfer tables should be unlinked: | |
382 | \fI(sstatus\ translink\ nil)\fP | |
383 | .Lf savelisp "'s_name" | |
384 | .Re | |
385 | t | |
386 | .Se | |
387 | the state of the Lisp system is saved in the file s_name. | |
388 | It can be read in by | |
389 | .i restorelisp . | |
390 | .No | |
391 | This is only used on VMS systems where | |
392 | .i dumplisp | |
393 | cannot be used. | |
394 | .Lf segment "'s_type 'x_size" | |
395 | .Wh | |
396 | s_type is one of the data types given in \(sc1.3 | |
397 | .Re | |
398 | a segment of contiguous lispvals of type s_type. | |
399 | .No | |
400 | In reality, | |
401 | .i segment | |
402 | returns a new data cell of type s_type and allocates | |
403 | space for x_size \- 1 more s_type's beyond the one returned. | |
404 | .i Segment | |
405 | always allocates new space and does so in 512 byte chunks. | |
406 | If you ask for 2 fixnums, segment will actually allocate 128 of them | |
407 | thus wasting 126 fixnums. | |
408 | The function | |
409 | .i small-segment | |
410 | is a smarter space allocator and should be used whenever possible. | |
411 | .Lf shell | |
412 | .Re | |
413 | the exit code of the shell when it dies. | |
414 | .Se | |
415 | this forks a new shell and returns when the shell dies. | |
416 | .Lf showstack | |
417 | .Re | |
418 | nil | |
419 | .Se | |
420 | all forms currently in evaluation are printed, beginning with the most recent. | |
421 | For compiled code the most that | |
422 | showstack will show is the function name and it may miss | |
423 | some functions. | |
424 | .Lf signal "'x_signum 's_name" | |
425 | .Re | |
426 | nil if no previous call to signal has been made, or the previously | |
427 | installed s_name. | |
428 | .Se | |
429 | this declares that the function named s_name | |
430 | will handle the signal number x_signum. | |
431 | If s_name is nil, the signal is ignored. Presently only | |
432 | four UNIX signals are caught. | |
433 | They and their numbers are: | |
434 | Interrupt(2), Floating exception(8), Alarm(14), and | |
435 | Hang-up(1). | |
436 | .Lf sizeof "'g_arg" | |
437 | .Re | |
438 | the number of bytes required to store one object of type g_arg, encoded | |
439 | as a fixnum. | |
440 | .Lf small-segment "'s_type 'x_cells" | |
441 | .Wh | |
442 | s_type is one of fixnum, flonum and value. | |
443 | .Re | |
444 | a segment of x_cells data objects of type s_type. | |
445 | .Se | |
446 | This may call | |
447 | .i segment | |
448 | to allocate new space or it may be able to fill the request on a page | |
449 | already allocated. | |
450 | The value returned by | |
451 | .i small-segment | |
452 | is usually stored in the data subpart | |
453 | of an array object. | |
454 | .Lf sstatus "g_type g_val" | |
455 | .Re | |
456 | g_val | |
457 | .Se | |
458 | If g_type is not one of the special sstatus codes described in the | |
459 | next few pages | |
460 | this simply sets g_val as the value of status | |
461 | type g_type in the system status property list. | |
462 | .Lf sstatus\ appendmap "g_val" | |
463 | .Re | |
464 | g_val | |
465 | .Se | |
466 | If g_val is non-null when | |
467 | .i fasl | |
468 | is told to create a load map, it will append to the file name given in | |
469 | the | |
470 | .i fasl | |
471 | command, rather than creating a new map file. | |
472 | The initial value is nil. | |
473 | .Lf sstatus\ automatic-reset "g_val" | |
474 | .Re | |
475 | g_val | |
476 | .Se | |
477 | If g_val is non-null when an error occurs which no one wants to | |
478 | handle, a | |
479 | .i reset | |
480 | will be done instead of entering a primitive internal break loop. | |
481 | The initial value is t. | |
482 | .Lf sstatus\ chainatom "g_val" | |
483 | .Re | |
484 | g_val | |
485 | .Se | |
486 | If g_val is non nil and a | |
487 | .i car | |
488 | or | |
489 | .i cdr | |
490 | of a symbol is done, then nil will be returned instead of an error | |
491 | being signaled. | |
492 | This only affects the interpreter, not the compiler. | |
493 | The initial value is nil. | |
494 | .Lf sstatus\ dumpcore "g_val" | |
495 | .Re | |
496 | g_val | |
497 | .Se | |
498 | If g_val is nil, | |
499 | .Fr | |
500 | tells UNIX that a segmentation violation or | |
501 | bus error should cause a core dump. | |
502 | If g_val is non nil then | |
503 | .Fr | |
504 | will catch those errors and print a message advising the user to reset. | |
505 | .No | |
506 | The initial value for this flag is nil, and only those knowledgeable of | |
507 | the innards of the lisp system should ever set this flag non nil. | |
508 | .Lf sstatus\ dumpmode "x_val" | |
509 | .Re | |
510 | x_val | |
511 | .Se | |
512 | All subsequent | |
513 | .i dumplisp 's | |
514 | will be done in mode x_val. | |
515 | x_val may be either 413 or 410 (decimal). | |
516 | .No | |
517 | the advantage of mode 413 is that the dumped Lisp can be demand paged in when | |
518 | first started, which will make it start faster and disrupt other users less. | |
519 | The initial value is 413. | |
520 | .Lf sstatus\ evalhook "g_val" | |
521 | .Re | |
522 | g_val | |
523 | .Se | |
524 | When g_val is non nil, this enables the | |
525 | evalhook and funcallhook traps in the evaluator. | |
526 | See \(sc14.4 for more details. | |
527 | .Lf sstatus\ feature "g_val" | |
528 | .Re | |
529 | g_val | |
530 | .Se | |
531 | g_val is added to the \fI(status\ features)\fP list, | |
532 | .Lf sstatus\ gcstrings "g_val" | |
533 | .Re | |
534 | g_val | |
535 | .Se | |
536 | if g_val is non-null, and if string garbage collection was enabled when | |
537 | the lisp system was compiled, string space will be garbage collected. | |
538 | .No | |
539 | the default value for this is nil since in most applications garbage | |
540 | collecting strings is a waste of time. | |
541 | .Lf sstatus\ ignoreeof "g_val" | |
542 | .Re | |
543 | g_val | |
544 | .Se | |
545 | If g_val is non-null when | |
546 | an end of file (CNTL-D on UNIX) is typed to the standard top-level interpreter, | |
547 | it will be ignored rather then cause the lisp system to exit. | |
548 | If the the standard input is a file or pipe then this has no effect, | |
549 | an EOF will always cause lisp to exit. | |
550 | The initial value is nil. | |
551 | .Lf sstatus\ nofeature "g_val" | |
552 | .Re | |
553 | g_val | |
554 | .Se | |
555 | g_val is removed from the status features list if it was present. | |
556 | .Lf sstatus\ translink "g_val" | |
557 | .Re | |
558 | g_val | |
559 | .Se | |
560 | If g_val is nil then all transfer tables are cleared and further calls | |
561 | through the transfer table will not cause the fast links to be set up. | |
562 | If g_val is the symbol | |
563 | .i on | |
564 | then all possible transfer table entries will be linked and the flag | |
565 | will be set to cause fast links to be set up dynamically. | |
566 | Otherwise all that is done is to set the flag to cause fast links | |
567 | to be set up dynamically. | |
568 | The initial value is nil. | |
569 | .No | |
570 | For a discussion of transfer tables, see \(sc12.8. | |
571 | .Lf sstatus\ uctolc "g_val" | |
572 | .Re | |
573 | g_val | |
574 | .Se | |
575 | If g_val is not nil then all unescaped capital letters | |
576 | in symbols read by the reader will be converted to lower case. | |
577 | .No | |
578 | This allows | |
579 | .Fr | |
580 | to be compatible with single case lisp | |
581 | systems (e.g. Maclisp, Interlisp and UCILisp). | |
582 | .Lf status "g_code" | |
583 | .Re | |
584 | the value associated with the status code g_code | |
585 | if g_code is not one of the special cases given below | |
586 | .Lf status\ ctime | |
587 | .Re | |
588 | a symbol whose print name is the current time and date. | |
589 | .Ex | |
590 | \fI(status ctime)\fP = |Sun Jun 29 16:51:26 1980| | |
591 | .No | |
592 | This has been made obsolete by \fItime-string\fP, described below. | |
593 | .Lf status\ feature "g_val" | |
594 | .Re | |
595 | t iff g_val is in the status features list. | |
596 | .Lf status\ features | |
597 | .Re | |
598 | the value of the features code, which is a list of features which | |
599 | are present in this system. | |
600 | You add to this list with \fI(sstatus\ feature\ 'g_val)\fP | |
601 | and test if feature g_feat is present with \fI(status\ feature\ 'g_feat)\fP. | |
602 | .Lf status\ isatty | |
603 | .Re | |
604 | t iff the standard input is a terminal. | |
605 | .Lf status\ localtime | |
606 | .Re | |
607 | a list of fixnums representing the current time. | |
608 | .Ex | |
609 | \fI(status localtime)\fP = (3 51 13 31 6 81 5 211 1) | |
610 | .br | |
611 | means 3\fIrd\fP second, 51\fIst\fP minute, 13\fIth\fP hour (1 p.m), | |
612 | 31\fIst\fP day, month 6 (0\ =\ January), year 81 (0\ =\ 1900), | |
613 | day of the week 5 (0\ =\ Sunday), 211\fIth\fP day of the year | |
614 | and daylight savings time is in effect. | |
615 | .Lf status\ syntax "s_char" | |
616 | .No | |
617 | This function should not be used. | |
618 | See the description of | |
619 | .i getsyntax | |
620 | (in Chapter 7) for a replacement. | |
621 | .Lf status\ undeffunc | |
622 | .Re | |
623 | a list of all functions which transfer table entries point to but which | |
624 | are not defined at this point. | |
625 | .No | |
626 | Some of the undefined functions listed could be arrays which have yet | |
627 | to be created. | |
628 | .Lf status\ version | |
629 | .Re | |
630 | a string which is the current lisp version name. | |
631 | .Ex | |
632 | \fI(status version)\fP = "Franz Lisp, Opus 38.61" | |
633 | .Lf syscall "'x_index ['xst_arg1 ...]" | |
634 | .Re | |
635 | the result of issuing the UNIX system call number x_index with arguments | |
636 | xst_arg\fIi\fP. | |
637 | .No | |
638 | The UNIX system calls are described in section 2 of the | |
639 | UNIX Programmer's manual. | |
640 | If xst_arg\fIi\fP is a fixnum, then | |
641 | its value is passed as an argument, if it is a symbol then | |
642 | its pname is passed and finally if it is a string then the string itself | |
643 | is passed as an argument. | |
644 | Some useful syscalls are: | |
645 | .br | |
646 | \fI(syscall\ 20)\fP returns process id. | |
647 | .br | |
648 | \fI(syscall\ 13)\fP returns the number of seconds since Jan 1, 1970. | |
649 | .br | |
650 | \fI(syscall\ 10\ 'foo)\fP will unlink (delete) the file foo. | |
651 | .Lf sys:access "'st_filename 'x_mode" | |
652 | .Lx sys:chmod "'st_filename 'x_mode" | |
653 | .Lx sys:gethostname | |
654 | .Lx sys:getpid | |
655 | .Lx sys:getpwnam 'st_username | |
656 | .Lx sys:link "'st_oldfilename 'st_newfilename" | |
657 | .Lx sys:time | |
658 | .Lx sys:unlink 'st_filename | |
659 | .No | |
660 | We have been warned that the actual system call numbers may vary | |
661 | among different UNIX systems. Users concerned about portability | |
662 | may wish to use this group of functions. | |
663 | Another advantage is that tilde-expansion is performed on | |
664 | all filename arguments. | |
665 | These functions do what is described | |
666 | in the system call section of your UNIX manual. | |
667 | .br | |
668 | .sp | |
669 | .i sys:getpwnam | |
670 | returns a vector of four entries from the password file, being | |
671 | the user name, user id, group id, and home directory. | |
672 | .Lf time-string "['x_seconds]" | |
673 | .Re | |
674 | an ascii string giving the time and date which was | |
675 | x_seconds after UNIX's idea of creation | |
676 | (Midnight, Jan 1, 1970 GMT). If no argument is given, | |
677 | time-string returns the current date. | |
678 | This supplants \fI(status ctime)\fP, and may be used | |
679 | to make the results of \fIfilestat\fP more intelligible. | |
680 | .Lf top-level | |
681 | .Re | |
682 | nothing (it never returns) | |
683 | .No | |
684 | This function is the top-level read-eval-print loop. | |
685 | It never returns any value. | |
686 | Its main utility is that if you redefine it, and do a (reset) then the | |
687 | redefined (top-level) is then invoked. | |
688 | The default top-level for Franz, allow one to specify | |
689 | his own printer or reader, by binding the symbols \fBtop-level-printer\fP | |
690 | and \fBtop-level-reader\fP. | |
691 | One can let the default top-level do most of the drudgery in catching | |
692 | .i reset 's, | |
693 | and reading in .lisprc files, | |
694 | by binding the symbol \fBuser-top-level\fP, to a routine that | |
695 | concerns itself only with the read-eval-print loop. | |
696 | .Lf wait | |
697 | .Re | |
698 | a dotted pair \fI(processid . status)\fP when the | |
699 | next child process dies. |