|
|
1.1 root 1:
2:
3:
4:
5:
6:
7:
8: CHAPTER 6
9:
10:
11: System Functions
12:
13:
14:
15:
16: This chapter describes the functions used to interact
17: with internal components of the Lisp system and operating
18: system.
19:
20: (allocate 's_type 'x_pages)
21:
22: WHERE: s_type is one of the FRANZ LISP data types
23: described in 1.3.
24:
25: RETURNS: x_pages.
26:
27: SIDE EFFECT: FRANZ LISP attempts to allocate x_pages of
28: type s_type. If there aren't x_pages of
29: memory left, no space will be allocated
30: and an error will occur. The storage that
31: is allocated is not given to the caller,
32: instead it is added to the free storage
33: list of s_type. The functions _s_e_g_m_e_n_t and
34: _s_m_a_l_l-_s_e_g_m_e_n_t allocate blocks of storage
35: and return it to the caller.
36:
37: (argv 'x_argnumb)
38:
39: RETURNS: a symbol whose pname is the x_argnumb_t_h argu-
40: ment (starting at 0) on the command line which
41: invoked the current lisp.
42:
43: NOTE: if x_argnumb is less than zero, a fixnum whose
44: value is the number of arguments on the command
45: line is returned. (_a_r_g_v _0) returns the name of
46: the lisp you are running.
47:
48: (baktrace)
49:
50: RETURNS: nil
51:
52: SIDE EFFECT: the lisp runtime stack is examined and the
53: name of (most) of the functions currently
54: in execution are printed, most active
55: first.
56:
57: NOTE: this will occasionally miss the names of compiled
58: lisp functions due to incomplete information on
59: the stack. If you are tracing compiled code,
60: then _b_a_k_t_r_a_c_e won't be able to interpret the
61:
62:
63: System Functions 6-1
64:
65:
66:
67:
68:
69:
70:
71: System Functions 6-2
72:
73:
74: stack unless (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _n_i_l) was done.
75: See the function _s_h_o_w_s_t_a_c_k for another way of
76: printing the lisp runtime stack.
77:
78: (boundp 's_name)
79:
80: RETURNS: nil if s_name is unbound, that is it has
81: never be given a value. If x_name has the
82: value g_val, then (nil . g_val) is returned.
83:
84: (chdir 's_path)
85:
86: RETURNS: t iff the system call succeeds.
87:
88: SIDE EFFECT: the current directory set to s_path. Among
89: other things, this will affect the default
90: location where the input/output functions
91: look for and create files.
92:
93: NOTE: _c_h_d_i_r follows the standard UNIX conventions, if
94: s_path does not begin with a slash, the default
95: path is changed to the current path with s_path
96: appended. _C_h_d_i_r employs tilde-expansion (dis-
97: cussed in Chapter 5).
98:
99: (command-line-args)
100:
101: RETURNS: a list of the arguments typed on the command
102: line, either to the lisp interpreter, or saved
103: lisp dump, or application compiled with the
104: autorun option (liszt -r).
105:
106: (deref 'x_addr)
107:
108: RETURNS: The contents of x_addr, when thought of as a
109: longword memory location.
110:
111: NOTE: This may be useful in constructing arguments to C
112: functions out of `dangerous' areas of memory.
113:
114: (dumplisp s_name)
115:
116: RETURNS: nil
117:
118: SIDE EFFECT: the current lisp is dumped to the named
119: file. When s_name is executed, you will
120: be in a lisp in the same state as when the
121: dumplisp was done.
122:
123: NOTE: dumplisp will fail if one tries to write over the
124: current running file. UNIX does not allow you to
125: modify the file you are running.
126: 9
127:
128: 9 Printed: August 5, 1983
129:
130:
131:
132:
133:
134:
135:
136: System Functions 6-3
137:
138:
139: (eval-when l_time g_exp1 ...)
140:
141: SIDE EFFECT: l_time may contain any combination of the
142: symbols _l_o_a_d, _e_v_a_l, and _c_o_m_p_i_l_e. The
143: effects of load and compile is discussed
144: in 12.3.2.1 compiler. If eval is present
145: however, this simply means that the
146: expressions g_exp1 and so on are evaluated
147: from left to right. If eval is not
148: present, the forms are not evaluated.
149:
150: (exit ['x_code])
151:
152: RETURNS: nothing (it never returns).
153:
154: SIDE EFFECT: the lisp system dies with exit code x_code
155: or 0 if x_code is not specified.
156:
157: (fake 'x_addr)
158:
159: RETURNS: the lisp object at address x_addr.
160:
161: NOTE: This is intended to be used by people debugging
162: the lisp system.
163:
164: (fork)
165:
166: RETURNS: nil to the child process and the process
167: number of the child to the parent.
168:
169: SIDE EFFECT: A copy of the current lisp system is made
170: in memory and both lisp systems now begin
171: to run. This function can be used
172: interactively to temporarily save the
173: state of Lisp (as shown below), but you
174: must be careful that only one of the
175: lisp's interacts with the terminal after
176: the fork. The _w_a_i_t function is useful for
177: this.
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191: 9
192:
193: 9 Printed: August 5, 1983
194:
195:
196:
197:
198:
199:
200:
201: System Functions 6-4
202:
203:
204:
205: ____________________________________________________
206:
207: -> (_s_e_t_q _f_o_o '_b_a_r) ;; set a variable
208: bar
209: -> (_c_o_n_d ((_f_o_r_k)(_w_a_i_t))) ;; duplicate the lisp system and
210: nil ;; make the parent wait
211: -> _f_o_o ;; check the value of the variable
212: bar
213: -> (_s_e_t_q _f_o_o '_b_a_z) ;; give it a new value
214: baz
215: -> _f_o_o ;; make sure it worked
216: baz
217: -> (_e_x_i_t) ;; exit the child
218: (5274 . 0) ;; the _w_a_i_t function returns this
219: -> _f_o_o ;; we check to make sure parent was
220: bar ;; not modified.
221: ____________________________________________________
222:
223:
224:
225:
226: (gc)
227:
228: RETURNS: nil
229:
230: SIDE EFFECT: this causes a garbage collection.
231:
232: NOTE: The function _g_c_a_f_t_e_r is not called automatically
233: after this function finishes. Normally the user
234: doesn't have to call _g_c since garbage collection
235: occurs automatically whenever internal free lists
236: are exhausted.
237:
238: (gcafter s_type)
239:
240: WHERE: s_type is one of the FRANZ LISP data types
241: listed in 1.3.
242:
243: NOTE: this function is called by the garbage collector
244: after a garbage collection which was caused by
245: running out of data type s_type. This function
246: should determine if more space need be allocated
247: and if so should allocate it. There is a default
248: gcafter function but users who want control over
249: space allocation can define their own -- but note
250: that it must be an nlambda.
251:
252:
253:
254:
255:
256: 9
257:
258: 9 Printed: August 5, 1983
259:
260:
261:
262:
263:
264:
265:
266: System Functions 6-5
267:
268:
269: (getenv 's_name)
270:
271: RETURNS: a symbol whose pname is the value of s_name in
272: the current UNIX environment. If s_name
273: doesn't exist in the current environment, a
274: symbol with a null pname is returned.
275:
276: (hashtabstat)
277:
278: RETURNS: a list of fixnums representing the number of
279: symbols in each bucket of the oblist.
280:
281: NOTE: the oblist is stored a hash table of buckets.
282: Ideally there would be the same number of symbols
283: in each bucket.
284:
285: (help [sx_arg])
286:
287: SIDE EFFECT: If sx_arg is a symbol then the portion of
288: this manual beginning with the description
289: of sx_arg is printed on the terminal. If
290: sx_arg is a fixnum or the name of one of
291: the appendicies, that chapter or appendix
292: is printed on the terminal. If no argu-
293: ment is provided, _h_e_l_p prints the options
294: that it recognizes. The program `more' is
295: used to print the manual on the terminal;
296: it will stop after each page and will con-
297: tinue after the space key is pressed.
298:
299: (include s_filename)
300:
301: RETURNS: nil
302:
303: SIDE EFFECT: The given filename is _l_o_a_ded into the
304: lisp.
305:
306: NOTE: this is similar to load except the argument is
307: not evaluated. Include means something special
308: to the compiler.
309:
310: (include-if 'g_predicate s_filename)
311:
312: RETURNS: nil
313:
314: SIDE EFFECT: This has the same effect as include, but
315: is only actuated if the predicate is non-
316: nil.
317:
318:
319:
320:
321: 9
322:
323: 9 Printed: August 5, 1983
324:
325:
326:
327:
328:
329:
330:
331: System Functions 6-6
332:
333:
334: (includef 's_filename)
335:
336: RETURNS: nil
337:
338: SIDE EFFECT: this is the same as _i_n_c_l_u_d_e except the
339: argument is evaluated.
340:
341: (includef-if 'g_predicate s_filename)
342:
343: RETURNS: nil
344:
345: SIDE EFFECT: This has the same effect as includef, but
346: is only actuated if the predicate is non-
347: nil.
348:
349: (maknum 'g_arg)
350:
351: RETURNS: the address of its argument converted into a
352: fixnum.
353:
354: (monitor ['xs_maxaddr])
355:
356: RETURNS: t
357:
358: SIDE EFFECT: If xs_maxaddr is t then profiling of the
359: entire lisp system is begun. If
360: xs_maxaddr is a fixnum then profiling is
361: done only up to address xs_maxaddr. If
362: xs_maxaddr is not given, then profiling is
363: stopped and the data obtained is written
364: to the file 'mon.out' where it can be
365: analyzed with the UNIX 'prof' program.
366:
367: NOTE: this function only works if the lisp system has
368: been compiled in a special way, otherwise, an
369: error is invoked.
370:
371: (opval 's_arg ['g_newval])
372:
373: RETURNS: the value associated with s_arg before the
374: call.
375:
376: SIDE EFFECT: If g_newval is specified, the value asso-
377: ciated with s_arg is changed to g_newval.
378:
379: NOTE: _o_p_v_a_l keeps track of storage allocation. If s_arg
380: is one of the data types then _o_p_v_a_l will return a
381: list of three fixnums representing the number of
382: items of that type in use, the number of pages
383: allocated and the number of items of that type
384: per page. You should never try to change the
385: value _o_p_v_a_l associates with a data type using
386: _o_p_v_a_l.
387:
388:
389: Printed: August 5, 1983
390:
391:
392:
393:
394:
395:
396:
397: System Functions 6-7
398:
399:
400: If s_arg is _p_a_g_e_l_i_m_i_t then _o_p_v_a_l will return (and
401: set if g_newval is given) the maximum amount of
402: lisp data pages it will allocate. This limit
403: should remain small unless you know your program
404: requires lots of space as this limit will catch
405: programs in infinite loops which gobble up
406: memory.
407:
408: (*process 'st_command ['g_readp ['g_writep]])
409:
410: RETURNS: either a fixnum if one argument is given, or a
411: list of two ports and a fixnum if two or three
412: arguments are given.
413:
414: NOTE: *_p_r_o_c_e_s_s starts another process by passing
415: st_command to the shell (it first tries /bin/csh,
416: then it tries /bin/sh if /bin/csh doesn't exist).
417: If only one argument is given to *_p_r_o_c_e_s_s, *_p_r_o_-
418: _c_e_s_s waits for the new process to die and then
419: returns the exit code of the new process. If
420: more two or three arguments are given, *_p_r_o_c_e_s_s
421: starts the process and then returns a list which,
422: depending on the value of g_readp and g_writep,
423: may contain i/o ports for communcating with the
424: new process. If g_writep is non-null, then a
425: port will be created which the lisp program can
426: use to send characters to the new process. If
427: g_readp is non-null, then a port will be created
428: which the lisp program can use to read characters
429: from the new process. The value returned by
430: *_p_r_o_c_e_s_s is (readport writeport pid) where read-
431: port and writeport are either nil or a port based
432: on the value of g_readp and g_writep. Pid is the
433: process id of the new process. Since it is hard
434: to remember the order of g_readp and g_writep,
435: the functions *_p_r_o_c_e_s_s-_s_e_n_d and *_p_r_o_c_e_s_s-_r_e_c_e_i_v_e
436: were written to perform the common functions.
437:
438: (*process-receive 'st_command)
439:
440: RETURNS: a port which can be read.
441:
442: SIDE EFFECT: The command st_command is given to the
443: shell and it is started running in the
444: background. The output of that command is
445: available for reading via the port
446: returned. The input of the command pro-
447: cess is set to /dev/null.
448:
449:
450:
451:
452: 9
453:
454: 9 Printed: August 5, 1983
455:
456:
457:
458:
459:
460:
461:
462: System Functions 6-8
463:
464:
465: (*process-send 'st_command)
466:
467: RETURNS: a port which can be written to.
468:
469: SIDE EFFECT: The command st_command is given to the
470: shell and it is started runing in the
471: background. The lisp program can provide
472: input for that command by sending charac-
473: ters to the port returned by this func-
474: tion. The output of the command process
475: is set to /dev/null.
476:
477: (process s_pgrm [s_frompipe s_topipe])
478:
479: RETURNS: if the optional arguments are not present a
480: fixnum which is the exit code when s_prgm
481: dies. If the optional arguments are present,
482: it returns a fixnum which is the process id of
483: the child.
484:
485: NOTE: This command is obsolete. New programs should
486: use one of the *_p_r_o_c_e_s_s commands given above.
487:
488: SIDE EFFECT: If s_frompipe and s_topipe are given, they
489: are bound to ports which are pipes which
490: direct characters from FRANZ LISP to the
491: new process and to FRANZ LISP from the new
492: process respectively. _P_r_o_c_e_s_s forks a
493: process named s_prgm and waits for it to
494: die iff there are no pipe arguments given.
495:
496: (ptime)
497:
498: RETURNS: a list of two elements, the first is the
499: amount of processor time used by the lisp sys-
500: tem so far, the second is the amount of time
501: used by the garbage collector so far.
502:
503: NOTE: the time is measured in those units used by the
504: _t_i_m_e_s(2) system call, usually 60_t_hs of a second.
505: The first number includes the second number. The
506: amount of time used by garbage collection is not
507: recorded until the first call to ptime. This is
508: done to prevent overhead when the user is not
509: interested in garbage collection times.
510:
511:
512:
513:
514:
515:
516:
517: 9
518:
519: 9 Printed: August 5, 1983
520:
521:
522:
523:
524:
525:
526:
527: System Functions 6-9
528:
529:
530: (reset)
531:
532: SIDE EFFECT: the lisp runtime stack is cleared and the
533: system restarts at the top level by exe-
534: cuting a (_f_u_n_c_a_l_l _t_o_p-_l_e_v_e_l _n_i_l).
535:
536: (restorelisp 's_name)
537:
538: SIDE EFFECT: this reads in file s_name (which was
539: created by _s_a_v_e_l_i_s_p) and then does a
540: (_r_e_s_e_t).
541:
542: NOTE: This is only used on VMS systems where _d_u_m_p_l_i_s_p
543: cannot be used.
544:
545: (retbrk ['x_level])
546:
547: WHERE: x_level is a small integer of either sign.
548:
549: SIDE EFFECT: The default error handler keeps a notion
550: of the current level of the error caught.
551: If x_level is negative, control is thrown
552: to this default error handler whose level
553: is that many less than the present, or to
554: _t_o_p-_l_e_v_e_l if there aren't enough. If
555: x_level is non-negative, control is passed
556: to the handler at that level. If x_level
557: is not present, the value -1 is taken by
558: default.
559:
560: (*rset 'g_flag)
561:
562: RETURNS: g_flag
563:
564: SIDE EFFECT: If g_flag is non nil then the lisp system
565: will maintain extra information about
566: calls to _e_v_a_l and _f_u_n_c_a_l_l. This record
567: keeping slows down the evaluation but this
568: is required for the functions _e_v_a_l_h_o_o_k,
569: _f_u_n_c_a_l_l_h_o_o_k, and _e_v_a_l_f_r_a_m_e to work. To
570: debug compiled lisp code the transfer
571: tables should be unlinked:
572: (_s_s_t_a_t_u_s _t_r_a_n_s_l_i_n_k _n_i_l)
573:
574:
575:
576:
577:
578:
579:
580:
581:
582: 9
583:
584: 9 Printed: August 5, 1983
585:
586:
587:
588:
589:
590:
591:
592: System Functions 6-10
593:
594:
595: (savelisp 's_name)
596:
597: RETURNS: t
598:
599: SIDE EFFECT: the state of the Lisp system is saved in
600: the file s_name. It can be read in by
601: _r_e_s_t_o_r_e_l_i_s_p.
602:
603: NOTE: This is only used on VMS systems where _d_u_m_p_l_i_s_p
604: cannot be used.
605:
606: (segment 's_type 'x_size)
607:
608: WHERE: s_type is one of the data types given in 1.3
609:
610: RETURNS: a segment of contiguous lispvals of type
611: s_type.
612:
613: NOTE: In reality, _s_e_g_m_e_n_t returns a new data cell of
614: type s_type and allocates space for x_size - 1
615: more s_type's beyond the one returned. _S_e_g_m_e_n_t
616: always allocates new space and does so in 512
617: byte chunks. If you ask for 2 fixnums, segment
618: will actually allocate 128 of them thus wasting
619: 126 fixnums. The function _s_m_a_l_l-_s_e_g_m_e_n_t is a
620: smarter space allocator and should be used when-
621: ever possible.
622:
623: (shell)
624:
625: RETURNS: the exit code of the shell when it dies.
626:
627: SIDE EFFECT: this forks a new shell and returns when
628: the shell dies.
629:
630: (showstack)
631:
632: RETURNS: nil
633:
634: SIDE EFFECT: all forms currently in evaluation are
635: printed, beginning with the most recent.
636: For compiled code the most that showstack
637: will show is the function name and it may
638: miss some functions.
639:
640:
641:
642:
643:
644:
645:
646:
647: 9
648:
649: 9 Printed: August 5, 1983
650:
651:
652:
653:
654:
655:
656:
657: System Functions 6-11
658:
659:
660: (signal 'x_signum 's_name)
661:
662: RETURNS: nil if no previous call to signal has been
663: made, or the previously installed s_name.
664:
665: SIDE EFFECT: this declares that the function named
666: s_name will handle the signal number
667: x_signum. If s_name is nil, the signal is
668: ignored. Presently only four UNIX signals
669: are caught, they and their numbers are:
670: Interrupt(2), Floating exception(8),
671: Alarm(14), and Hang-up(1).
672:
673: (sizeof 'g_arg)
674:
675: RETURNS: the number of bytes required to store one
676: object of type g_arg, encoded as a fixnum.
677:
678: (small-segment 's_type 'x_cells)
679:
680: WHERE: s_type is one of fixnum, flonum and value.
681:
682: RETURNS: a segment of x_cells data objects of type
683: s_type.
684:
685: SIDE EFFECT: This may call _s_e_g_m_e_n_t to allocate new
686: space or it may be able to fill the
687: request on a page already allocated. The
688: value returned by _s_m_a_l_l-_s_e_g_m_e_n_t is usually
689: stored in the data subpart of an array
690: object.
691:
692: (sstatus g_type g_val)
693:
694: RETURNS: g_val
695:
696: SIDE EFFECT: If g_type is not one of the special
697: sstatus codes described in the next few
698: pages this simply sets g_val as the value
699: of status type g_type in the system status
700: property list.
701:
702:
703:
704:
705:
706:
707:
708:
709:
710:
711:
712: 9
713:
714: 9 Printed: August 5, 1983
715:
716:
717:
718:
719:
720:
721:
722: System Functions 6-12
723:
724:
725: (sstatus appendmap g_val)
726:
727: RETURNS: g_val
728:
729: SIDE EFFECT: If g_val is non-null when _f_a_s_l is told to
730: create a load map, it will append to the
731: file name given in the _f_a_s_l command,
732: rather than creating a new map file. The
733: initial value is nil.
734:
735: (sstatus automatic-reset g_val)
736:
737: RETURNS: g_val
738:
739: SIDE EFFECT: If g_val is non-null when an error occurs
740: which no one wants to handle, a _r_e_s_e_t will
741: be done instead of entering a primitive
742: internal break loop. The initial value is
743: t.
744:
745: (sstatus chainatom g_val)
746:
747: RETURNS: g_val
748:
749: SIDE EFFECT: If g_val is non nil and a _c_a_r or _c_d_r of a
750: symbol is done, then nil will be returned
751: instead of an error being signaled. This
752: only affects the interpreter, not the com-
753: piler. The initial value is nil.
754:
755: (sstatus dumpcore g_val)
756:
757: RETURNS: g_val
758:
759: SIDE EFFECT: If g_val is nil, FRANZ LISP tells UNIX
760: that a segmentation violation or bus error
761: should cause a core dump. If g_val is non
762: nil then FRANZ LISP will catch those
763: errors and print a message advising the
764: user to reset.
765:
766: NOTE: The initial value for this flag is nil, and only
767: those knowledgeable of the innards of the lisp
768: system should ever set this flag non nil.
769:
770:
771:
772:
773:
774:
775:
776:
777: 9
778:
779: 9 Printed: August 5, 1983
780:
781:
782:
783:
784:
785:
786:
787: System Functions 6-13
788:
789:
790: (sstatus dumpmode x_val)
791:
792: RETURNS: x_val
793:
794: SIDE EFFECT: All subsequent _d_u_m_p_l_i_s_p's will be done in
795: mode x_val. x_val may be either 413 or
796: 410 (decimal).
797:
798: NOTE: the advantage of mode 413 is that the dumped Lisp
799: can be demand paged in when first started, which
800: will make it start faster and disrupt other users
801: less. The initial value is 413.
802:
803: (sstatus evalhook g_val)
804:
805: RETURNS: g_val
806:
807: SIDE EFFECT: When g_val is non nil, this enables the
808: evalhook and funcallhook traps in the
809: evaluator. See 14.4 for more details.
810:
811: (sstatus feature g_val)
812:
813: RETURNS: g_val
814:
815: SIDE EFFECT: g_val is added to the (_s_t_a_t_u_s _f_e_a_t_u_r_e_s)
816: list,
817:
818: (sstatus gcstrings g_val)
819:
820: RETURNS: g_val
821:
822: SIDE EFFECT: if g_val is non-null, and if string gar-
823: bage collection was enabled when the lisp
824: system was compiled, string space will be
825: garbage collected.
826:
827: NOTE: the default value for this is nil since in most
828: applications garbage collecting strings is a
829: waste of time.
830:
831: (sstatus ignoreeof g_val)
832:
833: RETURNS: g_val
834:
835: SIDE EFFECT: If g_val is non-null when an end of file
836: (CNTL-D on UNIX) is typed to the standard
837: top-level interpreter, it will be ignored
838: rather then cause the lisp system to exit.
839: If the the standard input is a file or
840: pipe then this has no effect, an EOF will
841: always cause lisp to exit. The initial
842: value is nil.
843:
844:
845: Printed: August 5, 1983
846:
847:
848:
849:
850:
851:
852:
853: System Functions 6-14
854:
855:
856: (sstatus nofeature g_val)
857:
858: RETURNS: g_val
859:
860: SIDE EFFECT: g_val is removed from the status features
861: list if it was present.
862:
863: (sstatus translink g_val)
864:
865: RETURNS: g_val
866:
867: SIDE EFFECT: If g_val is nil then all transfer tables
868: are cleared and further calls through the
869: transfer table will not cause the fast
870: links to be set up. If g_val is the sym-
871: bol _o_n then all possible transfer table
872: entries will be linked and the flag will
873: be set to cause fast links to be set up
874: dynamically. Otherwise all that is done
875: is to set the flag to cause fast links to
876: be set up dynamically. The initial value
877: is nil.
878:
879: NOTE: For a discussion of transfer tables, see 12.8.
880:
881: (sstatus uctolc g_val)
882:
883: RETURNS: g_val
884:
885: SIDE EFFECT: If g_val is not nil then all unescaped
886: capital letters in symbols read by the
887: reader will be converted to lower case.
888:
889: NOTE: This allows FRANZ LISP to be compatible with sin-
890: gle case lisp systems (e.g. Maclisp, Interlisp
891: and UCILisp).
892:
893: (status g_code)
894:
895: RETURNS: the value associated with the status code
896: g_code if g_code is not one of the special
897: cases given below
898:
899:
900:
901:
902:
903:
904:
905:
906:
907:
908: 9
909:
910: 9 Printed: August 5, 1983
911:
912:
913:
914:
915:
916:
917:
918: System Functions 6-15
919:
920:
921: (status ctime)
922:
923: RETURNS: a symbol whose print name is the current time
924: and date.
925:
926: EXAMPLE: (_s_t_a_t_u_s _c_t_i_m_e) = |Sun Jun 29 16:51:26 1980|
927:
928: NOTE: This has been made obsolete by _t_i_m_e-_s_t_r_i_n_g,
929: described below.
930:
931: (status feature g_val)
932:
933: RETURNS: t iff g_val is in the status features list.
934:
935: (status features)
936:
937: RETURNS: the value of the features code, which is a
938: list of features which are present in this
939: system. You add to this list with
940: (_s_s_t_a_t_u_s _f_e_a_t_u_r_e '_g__v_a_l) and test if feature
941: g_feat is present with
942: (_s_t_a_t_u_s _f_e_a_t_u_r_e '_g__f_e_a_t).
943:
944: (status isatty)
945:
946: RETURNS: t iff the standard input is a terminal.
947:
948: (status localtime)
949:
950: RETURNS: a list of fixnums representing the current
951: time.
952:
953: EXAMPLE: (_s_t_a_t_u_s _l_o_c_a_l_t_i_m_e) = (3 51 13 31 6 81 5 211
954: 1)
955: means 3_r_d second, 51_s_t minute, 13_t_h hour (1
956: p.m), 31_s_t day, month 6 (0 = January), year 81
957: (0 = 1900), day of the week 5 (0 = Sunday),
958: 211_t_h day of the year and daylight savings
959: time is in effect.
960:
961: (status syntax s_char)
962:
963: NOTE: This function should not be used. See the
964: description of _g_e_t_s_y_n_t_a_x (in Chapter 7) for a
965: replacement.
966:
967:
968:
969:
970:
971:
972:
973: 9
974:
975: 9 Printed: August 5, 1983
976:
977:
978:
979:
980:
981:
982:
983: System Functions 6-16
984:
985:
986: (status undeffunc)
987:
988: RETURNS: a list of all functions which transfer table
989: entries point to but which are not defined at
990: this point.
991:
992: NOTE: Some of the undefined functions listed could be
993: arrays which have yet to be created.
994:
995: (status version)
996:
997: RETURNS: a string which is the current lisp version
998: name.
999:
1000: EXAMPLE: (_s_t_a_t_u_s _v_e_r_s_i_o_n) = "Franz Lisp, Opus 38.61"
1001:
1002: (syscall 'x_index ['xst_arg1 ...])
1003:
1004: RETURNS: the result of issuing the UNIX system call
1005: number x_index with arguments xst_arg_i.
1006:
1007: NOTE: The UNIX system calls are described in section 2
1008: of the UNIX Programmer's manual. If xst_arg_i is a
1009: fixnum, then its value is passed as an argument,
1010: if it is a symbol then its pname is passed and
1011: finally if it is a string then the string itself
1012: is passed as an argument. Some useful syscalls
1013: are:
1014: (_s_y_s_c_a_l_l _2_0) returns process id.
1015: (_s_y_s_c_a_l_l _1_3) returns the number of seconds since
1016: Jan 1, 1970.
1017: (_s_y_s_c_a_l_l _1_0 '_f_o_o) will unlink (delete) the file
1018: foo.
1019:
1020: (sys:access 'st_filename 'x_mode)
1021: (sys:chmod 'st_filename 'x_mode)
1022: (sys:gethostname)
1023: (sys:getpid)
1024: (sys:getpwnam 'st_username)
1025: (sys:link 'st_oldfilename 'st_newfilename)
1026: (sys:time)
1027: (sys:unlink 'st_filename)
1028:
1029: NOTE: We have been warned that the actual system call
1030: numbers may vary among different UNIX systems.
1031: Users concerned about portability may wish to use
1032: this group of functions. Another advantage is
1033: that tilde-expansion is performed on all filename
1034: arguments. These functions do what is described
1035: in the system call section of your UNIX manual.
1036:
1037: _s_y_s:_g_e_t_p_w_n_a_m_e returns a vector of four entries
1038: from the password file, being the user name, user
1039:
1040:
1041: Printed: August 5, 1983
1042:
1043:
1044:
1045:
1046:
1047:
1048:
1049: System Functions 6-17
1050:
1051:
1052: id, group id, and home directory.
1053:
1054: (time-string ['x_seconds])
1055:
1056: RETURNS: an ascii string, giving the time and date
1057: which was x_seconds after UNIX's idea of crea-
1058: tion (Midnight, Jan 1, 1970 GMT). If no argu-
1059: ment is given, time-string returns the current
1060: date. This supplants (_s_t_a_t_u_s _c_t_i_m_e), and may
1061: be used to make the results of _f_i_l_e_s_t_a_t more
1062: intelligible.
1063:
1064: (top-level)
1065:
1066: RETURNS: nothing (it never returns)
1067:
1068: NOTE: This function is the top-level read-eval-print
1069: loop. It never returns any value. Its main
1070: utility is that if you redefine it, and do a
1071: (reset) then the redefined (top-level) is then
1072: invoked. The default top-level for Franz, allow
1073: one to specify his own printer or reader, by
1074: binding the symbols top-level-printer and top-
1075: level-reader. One can let the default top-level
1076: do most of the drudgery in catching _r_e_s_e_t's, and
1077: reading in .lisprc files, by binding the symbol
1078: user-top-level, to a routine that concerns itself
1079: only with the read-eval-print loop.
1080:
1081: (wait)
1082:
1083: RETURNS: a dotted pair (_p_r_o_c_e_s_s_i_d . _s_t_a_t_u_s) when the
1084: next child process dies.
1085:
1086:
1087:
1088:
1089:
1090:
1091:
1092:
1093:
1094:
1095:
1096:
1097:
1098:
1099:
1100:
1101:
1102:
1103:
1104: 9
1105:
1106: 9 Printed: August 5, 1983
1107:
1108:
1109:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.