~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to info/chap-25.texi

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
@node Environment, Glossary (Glossary), System Construction, Top
 
4
@chapter Environment
 
5
 
 
6
@menu
 
7
* The External Environment::    
 
8
* Environment Dictionary::      
 
9
@end menu
 
10
 
 
11
@node The External Environment, Environment Dictionary, Environment, Environment
 
12
@section The External Environment
 
13
 
 
14
@c including concept-environment
 
15
 
 
16
@menu
 
17
* Top level loop::              
 
18
* Debugging Utilities::         
 
19
* Environment Inquiry::         
 
20
* Time::                        
 
21
@end menu
 
22
 
 
23
@node Top level loop, Debugging Utilities, The External Environment, The External Environment
 
24
@subsection Top level loop
 
25
 
 
26
The top level loop is the @r{Common Lisp} mechanism by which the user normally
 
27
interacts with the @r{Common Lisp} system. This loop is sometimes referred to 
 
28
as the @i{Lisp read-eval-print loop}
 
29
because it typically consists of an endless loop that reads an expression,
 
30
evaluates it and prints the results.
 
31
 
 
32
The top level loop is not completely specified; thus the user
 
33
interface is @i{implementation-defined}.
 
34
The top level loop 
 
35
prints all values resulting from the evaluation of a 
 
36
@i{form}.
 
37
Figure 25--1 lists variables that are maintained by the @i{Lisp read-eval-print loop}.
 
38
 
 
39
@format
 
40
@group
 
41
@noindent
 
42
@w{  *    +    /    -  }
 
43
@w{  **   ++   //      }
 
44
@w{  ***  +++  ///     }
 
45
 
 
46
@noindent
 
47
@w{  Figure 25--1: Variables maintained by the Read-Eval-Print Loop}
 
48
 
 
49
@end group
 
50
@end format
 
51
 
 
52
@node Debugging Utilities, Environment Inquiry, Top level loop, The External Environment
 
53
@subsection Debugging Utilities
 
54
 
 
55
Figure 25--2 shows @i{defined names} relating to
 
56
debugging.
 
57
 
 
58
@format
 
59
@group
 
60
@noindent
 
61
@w{  *debugger-hook*  documentation    step     }
 
62
@w{  apropos          dribble          time     }
 
63
@w{  apropos-list     ed               trace    }
 
64
@w{  break            inspect          untrace  }
 
65
@w{  describe         invoke-debugger           }
 
66
 
 
67
@noindent
 
68
@w{  Figure 25--2: Defined names relating to debugging}
 
69
 
 
70
@end group
 
71
@end format
 
72
 
 
73
@node Environment Inquiry, Time, Debugging Utilities, The External Environment
 
74
@subsection Environment Inquiry
 
75
 
 
76
Environment inquiry @i{defined names} provide information about
 
77
the hardware and software configuration on which a @r{Common Lisp} program is
 
78
being executed.
 
79
 
 
80
Figure 25--3 shows @i{defined names} relating to environment inquiry.
 
81
 
 
82
@format
 
83
@group
 
84
@noindent
 
85
@w{  *features*                   machine-instance  short-site-name   }
 
86
@w{  lisp-implementation-type     machine-type      software-type     }
 
87
@w{  lisp-implementation-version  machine-version   software-version  }
 
88
@w{  long-site-name               room                                }
 
89
 
 
90
@noindent
 
91
@w{    Figure 25--3: Defined names relating to environment inquiry.   }
 
92
 
 
93
@end group
 
94
@end format
 
95
 
 
96
@node Time,  , Environment Inquiry, The External Environment
 
97
@subsection Time
 
98
 
 
99
Time is represented in four different ways in @r{Common Lisp}:
 
100
    @i{decoded time},
 
101
    @i{universal time},
 
102
    @i{internal time},
 
103
and seconds.
 
104
@i{Decoded time} and @i{universal time} are used primarily to represent calendar time,
 
105
and are precise only to one second.
 
106
@i{Internal time} is used primarily to represent measurements of computer
 
107
time (such as run time) and is precise to some @i{implementation-dependent}
 
108
fraction of a second called an @i{internal time unit},
 
109
as specified by @b{internal-time-units-per-second}.
 
110
An @i{internal time} can be used 
 
111
  for either @i{absolute} and @i{relative} @i{time} measurements.
 
112
Both a @i{universal time} and a @i{decoded time} can be used 
 
113
  only for @i{absolute} @i{time} measurements.
 
114
In the case of one function, @b{sleep},
 
115
time intervals are represented as a non-negative @i{real} number of seconds.
 
116
 
 
117
Figure 25--4 shows @i{defined names} relating to @i{time}.
 
118
 
 
119
@format
 
120
@group
 
121
@noindent
 
122
@w{  decode-universal-time   get-internal-run-time           }
 
123
@w{  encode-universal-time   get-universal-time              }
 
124
@w{  get-decoded-time        internal-time-units-per-second  }
 
125
@w{  get-internal-real-time  sleep                           }
 
126
 
 
127
@noindent
 
128
@w{        Figure 25--4: Defined names involving Time.       }
 
129
 
 
130
@end group
 
131
@end format
 
132
 
 
133
@menu
 
134
* Decoded Time::                
 
135
* Universal Time::              
 
136
* Internal Time::               
 
137
* Seconds::                     
 
138
@end menu
 
139
 
 
140
@node Decoded Time, Universal Time, Time, Time
 
141
@subsubsection Decoded Time
 
142
 
 
143
A @i{decoded time}
 
144
@IGindex{decoded time}
 
145
 is an ordered series of nine values that, taken together,
 
146
represent a point in calendar time (ignoring @i{leap seconds}):
 
147
 
 
148
@table @asis
 
149
 
 
150
@item @b{Second}  
 
151
An @i{integer} between 0 and~59, inclusive.
 
152
 
 
153
@item @b{Minute}  
 
154
An @i{integer} between 0 and~59, inclusive.
 
155
 
 
156
@item @b{Hour}  
 
157
An @i{integer} between 0 and~23, inclusive.
 
158
 
 
159
@item @b{Date}  
 
160
An @i{integer} between 1 and~31, inclusive (the upper limit actually
 
161
depends on the month and year, of course).
 
162
 
 
163
@item @b{Month}  
 
164
An @i{integer} between 1 and 12, inclusive;
 
165
1~means January, 2~means February, and so on; 12~means December.
 
166
 
 
167
@item @b{Year}  
 
168
An @i{integer} indicating the year A.D.  However, if this 
 
169
@i{integer}
 
170
is between 0 and 99, the ``obvious'' year is used; more precisely,
 
171
that year is assumed that is equal to the 
 
172
@i{integer} modulo 100 and
 
173
within fifty years of the current year (inclusive backwards
 
174
and exclusive forwards).  
 
175
Thus, in the year 1978, year 28 is 1928
 
176
but year 27 is 2027.  (Functions that return time in this format always return
 
177
a full year number.) 
 
178
 
 
179
@item @b{Day of week}  
 
180
An @i{integer} between~0 and~6, inclusive;
 
181
0~means Monday, 1~means Tuesday, and so on; 6~means Sunday.
 
182
 
 
183
@item @b{Daylight saving time flag}  
 
184
A @i{generalized boolean} that,
 
185
if @i{true}, indicates that daylight saving time is in effect.
 
186
 
 
187
@item @b{Time zone}  
 
188
A @i{time zone}.
 
189
 
 
190
@end table
 
191
 
 
192
Figure 25--5 shows @i{defined names} relating to @i{decoded time}.
 
193
 
 
194
@format
 
195
@group
 
196
@noindent
 
197
@w{  decode-universal-time  get-decoded-time  }
 
198
 
 
199
@noindent
 
200
@w{  Figure 25--5: Defined names involving time in Decoded Time.}
 
201
 
 
202
@end group
 
203
@end format
 
204
 
 
205
@node Universal Time, Internal Time, Decoded Time, Time
 
206
@subsubsection Universal Time
 
207
 
 
208
@i{Universal time}
 
209
@IGindex{universal time}
 
210
 is an @i{absolute} @i{time} represented as a
 
211
single non-negative @i{integer}---the number of seconds since
 
212
midnight, January 1, 1900 GMT (ignoring @i{leap seconds}).
 
213
Thus the time 1 is 00:00:01 (that is, 12:00:01 a.m.) on January 1, 1900 GMT.
 
214
Similarly, the time 2398291201 corresponds to time 00:00:01 on January 1,
 
215
1976 GMT.
 
216
Recall that the year 1900 was not a leap year; for the purposes of
 
217
@r{Common Lisp}, a year is a leap year if and only if its number is divisible by 4,
 
218
except that years divisible by 100 are not leap years, except that years
 
219
divisible by 400 are leap years.  Therefore the year 2000 will
 
220
be a leap year.
 
221
Because @i{universal time} must be a non-negative @i{integer},
 
222
times before the base time of midnight, January 1, 1900 GMT cannot be processed by @r{Common Lisp}.
 
223
 
 
224
@format
 
225
@group
 
226
@noindent
 
227
@w{  decode-universal-time  get-universal-time  }
 
228
@w{  encode-universal-time                      }
 
229
 
 
230
@noindent
 
231
@w{  Figure 25--6: Defined names involving time in Universal Time.}
 
232
 
 
233
@end group
 
234
@end format
 
235
 
 
236
@node Internal Time, Seconds, Universal Time, Time
 
237
@subsubsection Internal Time
 
238
 
 
239
@i{Internal time}
 
240
@IGindex{internal time}
 
241
 represents time as a single @i{integer},
 
242
in terms of an @i{implementation-dependent} unit called an @i{internal time unit}.
 
243
Relative time is measured as a number of these units.
 
244
Absolute time is relative to an arbitrary time base.
 
245
 
 
246
Figure 25--7 shows @i{defined names} related to @i{internal time}.
 
247
 
 
248
@format
 
249
@group
 
250
@noindent
 
251
@w{  get-internal-real-time  internal-time-units-per-second  }
 
252
@w{  get-internal-run-time                                   }
 
253
 
 
254
@noindent
 
255
@w{  Figure 25--7: Defined names involving time in Internal Time.}
 
256
 
 
257
@end group
 
258
@end format
 
259
 
 
260
@node Seconds,  , Internal Time, Time
 
261
@subsubsection Seconds
 
262
 
 
263
One function, @b{sleep}, takes its argument as a non-negative @i{real} number
 
264
of seconds.  Informally, it may be useful to think of this as 
 
265
a @i{relative} @i{universal time}, but it differs in one important way:
 
266
@i{universal times} are always non-negative @i{integers}, whereas the argument to
 
267
@b{sleep} can be any kind of non-negative @i{real}, in order to allow for
 
268
the possibility of fractional seconds.
 
269
 
 
270
@format
 
271
@group
 
272
@noindent
 
273
@w{  sleep    }
 
274
 
 
275
@noindent
 
276
@w{  Figure 25--8: Defined names involving time in Seconds.}
 
277
 
 
278
@end group
 
279
@end format
 
280
 
 
281
@c end of including concept-environment
 
282
 
 
283
@node Environment Dictionary,  , The External Environment, Environment
 
284
@section Environment Dictionary
 
285
 
 
286
@c including dict-environment
 
287
 
 
288
@menu
 
289
* decode-universal-time::       
 
290
* encode-universal-time::       
 
291
* get-universal-time::          
 
292
* sleep::                       
 
293
* apropos::                     
 
294
* describe::                    
 
295
* describe-object::             
 
296
* trace::                       
 
297
* step::                        
 
298
* time::                        
 
299
* internal-time-units-per-second::  
 
300
* get-internal-real-time::      
 
301
* get-internal-run-time::       
 
302
* disassemble::                 
 
303
* documentation::               
 
304
* room::                        
 
305
* ed::                          
 
306
* inspect::                     
 
307
* dribble::                     
 
308
* - (Variable)::                                
 
309
* + (Variable)::                                
 
310
* * (Variable)::                                
 
311
* / (Variable)::                                
 
312
* lisp-implementation-type::    
 
313
* short-site-name::             
 
314
* machine-instance::            
 
315
* machine-type::                
 
316
* machine-version::             
 
317
* software-type::               
 
318
* user-homedir-pathname::       
 
319
@end menu
 
320
 
 
321
@node decode-universal-time, encode-universal-time, Environment Dictionary, Environment Dictionary
 
322
@subsection decode-universal-time                                            [Function]
 
323
 
 
324
@code{decode-universal-time}  @i{universal-time @r{&optional} time-zone}@*
 
325
   @result{}  @i{second, minute, hour, date, month, year, day, daylight-p, zone}
 
326
 
 
327
@subsubheading  Arguments and Values::
 
328
 
 
329
@i{universal-time}---a @i{universal time}.
 
330
 
 
331
@i{time-zone}---a @i{time zone}.
 
332
 
 
333
@i{second}, @i{minute}, @i{hour}, @i{date}, @i{month},
 
334
@i{year}, @i{day}, @i{daylight-p}, @i{zone}---a @i{decoded time}.
 
335
 
 
336
@subsubheading  Description::
 
337
 
 
338
Returns the @i{decoded time} represented by the given @i{universal time}.
 
339
 
 
340
If @i{time-zone} is not supplied,
 
341
it defaults to the current time zone adjusted for daylight saving time.  
 
342
 
 
343
If @i{time-zone} is supplied, daylight saving time information is ignored.
 
344
The daylight saving time flag is @b{nil} if @i{time-zone} is supplied.
 
345
 
 
346
@subsubheading  Examples::
 
347
 
 
348
@example
 
349
 (decode-universal-time 0 0) @result{}  0, 0, 0, 1, 1, 1900, 0, @i{false}, 0
 
350
 
 
351
;; The next two examples assume Eastern Daylight Time.
 
352
 (decode-universal-time 2414296800 5) @result{}  0, 0, 1, 4, 7, 1976, 6, @i{false}, 5
 
353
 (decode-universal-time 2414293200) @result{}  0, 0, 1, 4, 7, 1976, 6, @i{true}, 5
 
354
 
 
355
;; This example assumes that the time zone is Eastern Daylight Time
 
356
;; (and that the time zone is constant throughout the example).
 
357
 (let* ((here (nth 8 (multiple-value-list (get-decoded-time)))) ;Time zone
 
358
        (recently (get-universal-time))
 
359
        (a (nthcdr 7 (multiple-value-list (decode-universal-time recently))))
 
360
        (b (nthcdr 7 (multiple-value-list (decode-universal-time recently here)))))
 
361
   (list a b (equal a b))) @result{}  ((T 5) (NIL 5) NIL)
 
362
@end example
 
363
 
 
364
@subsubheading  Affected By::
 
365
 
 
366
@i{Implementation-dependent} mechanisms for calculating when or if daylight
 
367
savings time is in effect for any given session.
 
368
 
 
369
@subsubheading  See Also::
 
370
 
 
371
@ref{encode-universal-time}
 
372
 
373
@ref{get-universal-time}
 
374
 
375
@ref{Time}
 
376
 
 
377
@node encode-universal-time, get-universal-time, decode-universal-time, Environment Dictionary
 
378
@subsection encode-universal-time                                            [function]
 
379
 
 
380
@subsubheading  Syntax::
 
381
 
 
382
@code{encode-universal-time}  @i{second minute hour date month year
 
383
                               @r{&optional} time-zone}@*
 
384
   @result{}  @i{universal-time}
 
385
 
 
386
@subsubheading  Arguments and Values::
 
387
 
 
388
@i{second}, @i{minute}, @i{hour}, 
 
389
@i{date}, @i{month}, @i{year}, 
 
390
@i{time-zone}---the corresponding parts of a @i{decoded time}.
 
391
 (Note that some of the nine values in a full @i{decoded time} are redundant,
 
392
  and so are not used as inputs to this function.)
 
393
 
 
394
@i{universal-time}---a @i{universal time}.
 
395
 
 
396
@subsubheading  Description::
 
397
 
 
398
@b{encode-universal-time} converts a time from Decoded Time format
 
399
to a @i{universal time}.
 
400
 
 
401
If @i{time-zone} is supplied, no adjustment for daylight savings time is performed.
 
402
 
 
403
@subsubheading  Examples::
 
404
 
 
405
@example
 
406
 (encode-universal-time 0 0 0 1 1 1900 0) @result{}  0
 
407
 (encode-universal-time 0 0 1 4 7 1976 5) @result{}  2414296800
 
408
;; The next example assumes Eastern Daylight Time.
 
409
 (encode-universal-time 0 0 1 4 7 1976) @result{}  2414293200
 
410
@end example
 
411
 
 
412
@subsubheading  See Also::
 
413
 
 
414
@ref{decode-universal-time}
 
415
, @b{get-decoded-time}
 
416
 
 
417
@node get-universal-time, sleep, encode-universal-time, Environment Dictionary
 
418
@subsection get-universal-time, get-decoded-time                             [Function]
 
419
 
 
420
@code{get-universal-time}  @i{<@i{no @i{arguments}}>} @result{}  @i{universal-time}
 
421
 
 
422
@code{get-decoded-time}  @i{<@i{no @i{arguments}}>}@*
 
423
   @result{}  @i{second, minute, hour, date, month, year, day, daylight-p, zone}
 
424
 
 
425
@subsubheading  Arguments and Values::
 
426
 
 
427
@i{universal-time}---a @i{universal time}.
 
428
 
 
429
@i{second}, @i{minute}, @i{hour},
 
430
@i{date}, @i{month}, @i{year},
 
431
@i{day}, @i{daylight-p}, @i{zone}---a @i{decoded time}.
 
432
 
 
433
@subsubheading  Description::
 
434
 
 
435
@b{get-universal-time} returns the current time, represented as a @i{universal time}.
 
436
 
 
437
@b{get-decoded-time} returns the current time, represented as a @i{decoded time}.
 
438
 
 
439
@subsubheading  Examples::
 
440
 
 
441
@example
 
442
;; At noon on July 4, 1976 in Eastern Daylight Time.
 
443
 (get-decoded-time) @result{}  0, 0, 12, 4, 7, 1976, 6, @i{true}, 5
 
444
;; At exactly the same instant.
 
445
 (get-universal-time) @result{}  2414332800
 
446
;; Exactly five minutes later.
 
447
 (get-universal-time) @result{}  2414333100
 
448
;; The difference is 300 seconds (five minutes)
 
449
 (- * **) @result{}  300
 
450
@end example
 
451
 
 
452
@subsubheading  Affected By::
 
453
 
 
454
The time of day (@i{i.e.}, the passage of time),
 
455
the system clock's ability to keep accurate time,
 
456
and the accuracy of the system clock's initial setting.
 
457
 
 
458
@subsubheading  Exceptional Situations::
 
459
 
 
460
An error of @i{type} @b{error} might be signaled if the current time cannot be determined.
 
461
 
 
462
@subsubheading  See Also::
 
463
 
 
464
@ref{decode-universal-time}
 
465
,
 
466
@ref{encode-universal-time}
 
467
,
 
468
@ref{Time}
 
469
 
 
470
@subsubheading  Notes::
 
471
 
 
472
@example
 
473
 (get-decoded-time) @equiv{} (decode-universal-time (get-universal-time))
 
474
@end example
 
475
 
 
476
No @i{implementation} is required to have a way to verify that the
 
477
time returned is correct.  However, if an @i{implementation} provides
 
478
a validity check (@i{e.g.}, the failure to have properly initialized the system
 
479
clock can be reliably detected) and that validity check fails, 
 
480
the @i{implementation} is strongly encouraged (but not required)
 
481
to signal an error of @i{type} @b{error} (rather than, for example, returning a
 
482
known-to-be-wrong value) that is @i{correctable} by allowing the user
 
483
to interactively set the correct time.
 
484
 
 
485
@node sleep, apropos, get-universal-time, Environment Dictionary
 
486
@subsection sleep                                                            [Function]
 
487
 
 
488
@code{sleep}  @i{seconds} @result{}  @i{@b{nil}}
 
489
 
 
490
@subsubheading  Arguments and Values::
 
491
 
 
492
@i{seconds}---a non-negative @i{real}.
 
493
 
 
494
@subsubheading  Description::
 
495
 
 
496
Causes execution to cease and become dormant for approximately the
 
497
seconds of real time indicated by @i{seconds}, 
 
498
whereupon execution is resumed.
 
499
 
 
500
@subsubheading  Examples::
 
501
 
 
502
@example
 
503
 (sleep 1) @result{}  NIL 
 
504
 
 
505
;; Actually, since SLEEP is permitted to use approximate timing, 
 
506
;; this might not always yield true, but it will often enough that
 
507
;; we felt it to be a productive example of the intent.
 
508
 (let ((then (get-universal-time))
 
509
       (now  (progn (sleep 10) (get-universal-time))))
 
510
   (>= (- now then) 10))
 
511
@result{}  @i{true}
 
512
@end example
 
513
 
 
514
@subsubheading  Side Effects::
 
515
 
 
516
Causes processing to pause.
 
517
 
 
518
@subsubheading  Affected By::
 
519
 
 
520
The granularity of the scheduler.
 
521
 
 
522
@subsubheading  Exceptional Situations::
 
523
 
 
524
Should signal an error of @i{type} @b{type-error}
 
525
                              if @i{seconds} is not a non-negative @i{real}.
 
526
 
 
527
@node apropos, describe, sleep, Environment Dictionary
 
528
@subsection apropos, apropos-list                                            [Function]
 
529
 
 
530
@code{apropos}  @i{string @r{&optional} package} @result{}  @i{<@i{no @i{values}}>}
 
531
 
 
532
@code{apropos-list}  @i{string @r{&optional} package} @result{}  @i{symbols}
 
533
 
 
534
@subsubheading  Arguments and Values::
 
535
 
 
536
@i{string}---a @i{string designator}.
 
537
 
 
538
@i{package}---a @i{package designator} or @b{nil}.
 
539
 The default is @b{nil}.
 
540
 
 
541
@i{symbols}---a @i{list} of @i{symbols}.
 
542
 
 
543
@subsubheading  Description::
 
544
 
 
545
These functions search for @i{interned} @i{symbols} 
 
546
whose @i{names} contain the substring @i{string}.
 
547
 
 
548
For @b{apropos}, as each such @i{symbol} is found,
 
549
its name is printed on @i{standard output}.
 
550
In addition,
 
551
if such a @i{symbol} is defined as a @i{function} or @i{dynamic variable},
 
552
information about those definitions might also be printed.
 
553
 
 
554
For @b{apropos-list},
 
555
no output occurs as the search proceeds;
 
556
instead a list of the matching @i{symbols} is returned when the search is complete.
 
557
 
 
558
If @i{package} is @i{non-nil},
 
559
only the @i{symbols} @i{accessible} in that @i{package} are searched;
 
560
otherwise all @i{symbols} @i{accessible} in any @i{package} are searched.
 
561
 
 
562
Because a @i{symbol} might be available 
 
563
by way of more than one inheritance path,
 
564
@b{apropos} might print information about the @i{same} @i{symbol} more than once,
 
565
or @b{apropos-list} might return a @i{list} containing duplicate @i{symbols}.
 
566
 
 
567
Whether or not the search is case-sensitive is @i{implementation-defined}.
 
568
 
 
569
@subsubheading  Affected By::
 
570
 
 
571
The set of @i{symbols} which are currently @i{interned}
 
572
in any @i{packages} being searched.
 
573
 
 
574
@b{apropos} is also affected by @b{*standard-output*}.
 
575
 
 
576
@node describe, describe-object, apropos, Environment Dictionary
 
577
@subsection describe                                                         [Function]
 
578
 
 
579
@code{describe}  @i{object @r{&optional} stream} @result{}  @i{<@i{no @i{values}}>}
 
580
 
 
581
@subsubheading  Arguments and Values::
 
582
 
 
583
@i{object}---an @i{object}.
 
584
 
 
585
@i{stream}---an @i{output} @i{stream designator}.
 
586
 The default is @i{standard output}.
 
587
 
 
588
@subsubheading  Description::
 
589
 
 
590
@b{describe} displays information about @i{object}
 
591
 
 
592
to @i{stream}.
 
593
 
 
594
For example, @b{describe} of a @i{symbol} might show the
 
595
@i{symbol}'s value, its definition, and each of its properties. 
 
596
@b{describe} of a @i{float} might show the number's
 
597
internal representation in a way that is useful for tracking
 
598
down round-off errors.  In all cases, however, the nature and format of the
 
599
output of @b{describe} is @i{implementation-dependent}.
 
600
 
 
601
@b{describe} can describe something that it finds inside the @i{object};
 
602
in such cases, a notational device such as increased indentation or positioning in a
 
603
table is typically used in order to visually distinguish such recursive descriptions 
 
604
from descriptions of the argument @i{object}.
 
605
 
 
606
The actual act of describing the object is implemented by @b{describe-object}.
 
607
@b{describe} exists as an interface primarily to manage argument defaulting (including
 
608
conversion of arguments @b{t} and @b{nil} into @i{stream} @i{objects}) and to inhibit
 
609
any return values from @b{describe-object}.
 
610
 
 
611
@b{describe} is not intended to be an interactive function.  In a 
 
612
@i{conforming implementation}, @b{describe} must not, by default, 
 
613
prompt for user input.  User-defined methods for @b{describe-object}
 
614
are likewise restricted.  
 
615
 
 
616
@subsubheading  Side Effects::
 
617
 
 
618
Output to @i{standard output} or @i{terminal I/O}.
 
619
 
 
620
@subsubheading  Affected By::
 
621
 
 
622
@b{*standard-output*} and @b{*terminal-io*},
 
623
methods on @b{describe-object} and @b{print-object}
 
624
for @i{objects} having user-defined @i{classes}.
 
625
 
 
626
@subsubheading  See Also::
 
627
 
 
628
@ref{inspect}
 
629
 
630
@ref{describe-object}
 
631
 
 
632
@node describe-object, trace, describe, Environment Dictionary
 
633
@subsection describe-object                                 [Standard Generic Function]
 
634
 
 
635
@subsubheading  Syntax::
 
636
 
 
637
@code{describe-object}  @i{object stream} @result{}  @i{@i{implementation-dependent}}
 
638
 
 
639
@subsubheading  Method Signatures::
 
640
 
 
641
@code{describe-object}  @i{(@i{object} standard-object) @i{stream}}
 
642
 
 
643
@subsubheading  Arguments and Values::
 
644
 
 
645
@i{object}---an @i{object}.
 
646
 
 
647
@i{stream}---a @i{stream}.
 
648
 
 
649
@subsubheading  Description::
 
650
 
 
651
The generic function @b{describe-object} prints a description of
 
652
@i{object} to a @i{stream}.  @b{describe-object} is called 
 
653
by @b{describe}; it must not be called by the user.
 
654
 
 
655
Each implementation is required to provide a @i{method} on 
 
656
the @i{class} @b{standard-object} and @i{methods} on enough other
 
657
@i{classes} so as to ensure that there is always an applicable @i{method}.  
 
658
Implementations are free to add @i{methods} for other @i{classes}.
 
659
Users can write @i{methods} for @b{describe-object} for their
 
660
own @i{classes} if they do not wish to inherit an implementation-supplied
 
661
@i{method}.
 
662
 
 
663
@i{Methods} on @b{describe-object} can recursively call
 
664
@b{describe}.  Indentation, depth limits, and circularity detection
 
665
are all taken care of automatically, provided that each @i{method} 
 
666
handles exactly one level of structure and calls @b{describe} 
 
667
recursively if there are more structural levels.  The consequences are 
 
668
undefined if this rule is not obeyed.
 
669
 
 
670
In some implementations the @i{stream} argument passed to a
 
671
@b{describe-object} method is not the original @i{stream}, but is
 
672
an intermediate @i{stream} that implements parts of @b{describe}.
 
673
@i{Methods} should therefore not depend on the identity of this
 
674
@i{stream}.
 
675
 
 
676
@subsubheading  Examples::
 
677
 
 
678
@example
 
679
 (defclass spaceship ()
 
680
   ((captain :initarg :captain :accessor spaceship-captain)
 
681
    (serial# :initarg :serial-number :accessor spaceship-serial-number)))
 
682
 
 
683
 (defclass federation-starship (spaceship) ())
 
684
 
 
685
 (defmethod describe-object ((s spaceship) stream)
 
686
   (with-slots (captain serial#) s
 
687
     (format stream "~&~S is a spaceship of type ~S,~
 
688
                     ~
 
689
                       and with serial number ~D.~
 
690
             s (type-of s) captain serial#)))
 
691
 
 
692
 (make-instance 'federation-starship
 
693
                :captain "Rachel Garrett"
 
694
                :serial-number "NCC-1701-C")
 
695
@result{}  #<FEDERATION-STARSHIP 26312465>
 
696
 
 
697
 (describe *)
 
698
@t{ |> } #<FEDERATION-STARSHIP 26312465> is a spaceship of type FEDERATION-STARSHIP,
 
699
@t{ |> } with Rachel Garrett at the helm and with serial number NCC-1701-C.
 
700
@result{}  <@i{no @i{values}}>
 
701
@end example
 
702
 
 
703
@subsubheading  See Also::
 
704
 
 
705
@ref{describe}
 
706
 
 
707
@subsubheading  Notes::
 
708
 
 
709
The same implementation techniques that are applicable to @b{print-object} are
 
710
applicable to @b{describe-object}.
 
711
 
 
712
The reason for making the return values for @b{describe-object}
 
713
unspecified is to  avoid forcing users to include explicit @t{(values)}
 
714
in all of their @i{methods}.  @b{describe} takes care of that.
 
715
 
 
716
@node trace, step, describe-object, Environment Dictionary
 
717
@subsection trace, untrace                                                      [Macro]
 
718
 
 
719
@code{trace}  @i{@{@i{function-name}@}*} @result{}  @i{trace-result}
 
720
 
 
721
@code{untrace}  @i{@{@i{function-name}@}*} @result{}  @i{untrace-result}
 
722
 
 
723
@subsubheading  Arguments and Values::
 
724
 
 
725
@i{function-name}---a @i{function name}.
 
726
 
 
727
@i{trace-result}---@i{implementation-dependent},
 
728
  unless no @i{function-names} are supplied, 
 
729
  in which case @i{trace-result} is a @i{list} of @i{function names}.
 
730
 
 
731
@i{untrace-result}---@i{implementation-dependent}.
 
732
 
 
733
@subsubheading  Description::
 
734
 
 
735
@b{trace} and @b{untrace} control the invocation of the trace facility.  
 
736
 
 
737
Invoking @b{trace} with one or more @i{function-names} causes
 
738
the denoted @i{functions} to be ``traced.''
 
739
Whenever a traced @i{function} is invoked, information
 
740
     about the call,
 
741
     about the arguments passed,
 
742
 and about any eventually returned values
 
743
is printed to @i{trace output}.
 
744
If @b{trace} is used with no @i{function-names},
 
745
no tracing action is performed; 
 
746
instead, a list of the @i{functions} currently being traced is returned.
 
747
 
 
748
Invoking @b{untrace} with one or more function names causes those
 
749
functions to be ``untraced'' (@i{i.e.}, no longer traced).
 
750
If @b{untrace} is used with no @i{function-names},
 
751
all @i{functions} currently being traced are untraced.
 
752
 
 
753
If a @i{function} to be traced has been open-coded
 
754
(@i{e.g.}, because it was declared @b{inline}),
 
755
a call to that @i{function} might not produce trace output.
 
756
 
 
757
@subsubheading  Examples::
 
758
 
 
759
@example
 
760
 (defun fact (n) (if (zerop n) 1 (* n (fact (- n 1)))))
 
761
@result{}  FACT
 
762
 (trace fact)
 
763
@result{}  (FACT)
 
764
;; Of course, the format of traced output is implementation-dependent.
 
765
 (fact 3)
 
766
@t{ |> } 1 Enter FACT 3
 
767
@t{ |> } | 2 Enter FACT 2
 
768
@t{ |> } |   3 Enter FACT 1
 
769
@t{ |> } |   | 4 Enter FACT 0
 
770
@t{ |> } |   | 4 Exit FACT 1
 
771
@t{ |> } |   3 Exit FACT 1
 
772
@t{ |> } | 2 Exit FACT 2
 
773
@t{ |> } 1 Exit FACT 6
 
774
@result{}  6
 
775
@end example
 
776
 
 
777
@subsubheading  Side Effects::
 
778
 
 
779
Might change the definitions of the @i{functions} named by @i{function-names}.
 
780
 
 
781
@subsubheading  Affected By::
 
782
 
 
783
Whether the functions named are defined or already being traced.
 
784
 
 
785
@subsubheading  Exceptional Situations::
 
786
 
 
787
   Tracing an already traced function,
 
788
or untracing a function not currently being traced,
 
789
should produce no harmful effects, but might signal a warning.
 
790
 
 
791
@subsubheading  See Also::
 
792
 
 
793
@b{*trace-output*},
 
794
@ref{step}
 
795
 
 
796
@subsubheading  Notes::
 
797
 
 
798
@b{trace} and @b{untrace} may also accept additional
 
799
@i{implementation-dependent} argument formats.  The format of the trace
 
800
output is @i{implementation-dependent}.
 
801
 
 
802
Although @b{trace} can be extended to permit non-standard options,
 
803
@i{implementations} are nevertheless encouraged (but not required)
 
804
to warn about the use of syntax or options 
 
805
that are neither specified by this standard 
 
806
nor added as an extension by the @i{implementation},
 
807
since they could be symptomatic of typographical errors
 
808
or of reliance on features supported in @i{implementations} 
 
809
other than the current @i{implementation}.
 
810
 
 
811
@node step, time, trace, Environment Dictionary
 
812
@subsection step                                                                [Macro]
 
813
 
 
814
@code{step}  @i{form} @result{}  @i{@{@i{result}@}*}
 
815
 
 
816
@subsubheading  Arguments and Values:: 
 
817
 
 
818
@i{form}---a @i{form}; evaluated as described below.
 
819
 
 
820
@i{results}---the @i{values} returned by the @i{form}.
 
821
 
 
822
@subsubheading  Description::
 
823
 
 
824
@b{step} implements a debugging paradigm wherein the programmer
 
825
is allowed to @i{step} through the @i{evaluation} of a @i{form}.
 
826
The specific nature of the interaction,
 
827
 
 
828
including which I/O streams are used and
 
829
whether the stepping has lexical or dynamic scope,
 
830
 
 
831
is @i{implementation-defined}.
 
832
 
 
833
@b{step} evaluates @i{form} in the current @i{environment}.
 
834
A call to @b{step} can be compiled, but it is acceptable for an
 
835
implementation to interactively step through only those parts of the computation
 
836
that are interpreted.
 
837
 
 
838
It is technically permissible for a @i{conforming implementation} 
 
839
to take no action at all other than normal @i{execution} of the @i{form}.
 
840
In such a situation, 
 
841
@t{(step @i{form})}
 
842
is equivalent to, for example,
 
843
@t{(let () @i{form})}. 
 
844
In implementations where this is the case, the associated documentation
 
845
should mention that fact.
 
846
 
 
847
@subsubheading  See Also::
 
848
 
 
849
@ref{trace}
 
850
 
 
851
@subsubheading  Notes::
 
852
 
 
853
@i{Implementations} are encouraged to respond to the typing of @t{?} 
 
854
or the pressing of a ``help key'' by providing help including a list of
 
855
commands.
 
856
 
 
857
@node time, internal-time-units-per-second, step, Environment Dictionary
 
858
@subsection time                                                                [Macro]
 
859
 
 
860
@code{time}  @i{form} @result{}  @i{@{@i{result}@}*}
 
861
 
 
862
@subsubheading  Arguments and Values::
 
863
 
 
864
@i{form}---a @i{form}; evaluated as described below.
 
865
 
 
866
@i{results}---the @i{values} returned by the @i{form}.
 
867
 
 
868
@subsubheading  Description::
 
869
 
 
870
@b{time} evaluates @i{form} in the current @i{environment} (lexical and dynamic).
 
871
A call to @b{time} can be compiled.
 
872
 
 
873
@b{time} prints various timing data and other information to @i{trace output}.
 
874
The nature and format of the printed information is @i{implementation-defined}.
 
875
Implementations are encouraged to provide such information as 
 
876
     elapsed real time,
 
877
     machine run time,
 
878
 and storage management statistics.
 
879
 
 
880
@subsubheading  Affected By::
 
881
 
 
882
The accuracy of the results depends, among other things, on the accuracy
 
883
of the corresponding functions provided by the underlying operating system.
 
884
 
 
885
The magnitude of the results may depend on 
 
886
  the hardware,
 
887
  the operating system,
 
888
  the lisp implementation,
 
889
 and the state of the global environment.
 
890
Some specific issues which frequently affect the outcome are
 
891
  hardware speed,
 
892
  nature of the scheduler (if any),
 
893
  number of competing processes (if any),
 
894
  system paging,
 
895
  whether the call is interpreted or compiled,
 
896
  whether functions called are compiled,
 
897
  the kind of garbage collector involved and whether it runs,
 
898
  whether internal data structures (e.g., hash tables) are implicitly reorganized,
 
899
  @i{etc.}
 
900
 
 
901
@subsubheading  See Also::
 
902
 
 
903
@ref{get-internal-real-time}
 
904
,
 
905
@ref{get-internal-run-time}
 
906
 
 
907
@subsubheading  Notes::
 
908
 
 
909
In general, these timings are not guaranteed to be reliable enough for
 
910
marketing comparisons. Their value is primarily heuristic, for tuning
 
911
purposes.
 
912
 
 
913
For useful background information on the complicated issues involved in
 
914
interpreting timing results, see @i{Performance and Evaluation of Lisp Programs}.
 
915
 
 
916
@node internal-time-units-per-second, get-internal-real-time, time, Environment Dictionary
 
917
@subsection internal-time-units-per-second                          [Constant Variable]
 
918
 
 
919
@subsubheading  Constant Value::
 
920
 
 
921
A positive @i{integer}, the magnitude of which is @i{implementation-dependent}.
 
922
 
 
923
@subsubheading  Description::
 
924
 
 
925
The number of @i{internal time units} in one second.
 
926
 
 
927
@subsubheading  See Also::
 
928
 
 
929
@ref{get-internal-run-time}
 
930
 
931
@ref{get-internal-real-time}
 
932
 
 
933
@subsubheading  Notes::
 
934
 
 
935
These units form the basis of the Internal Time format representation.
 
936
 
 
937
@node get-internal-real-time, get-internal-run-time, internal-time-units-per-second, Environment Dictionary
 
938
@subsection get-internal-real-time                                           [Function]
 
939
 
 
940
@code{get-internal-real-time}  @i{<@i{no @i{arguments}}>} @result{}  @i{internal-time}
 
941
 
 
942
@subsubheading  Arguments and Values::
 
943
 
 
944
@i{internal-time}---a non-negative @i{integer}.
 
945
 
 
946
@subsubheading  Description::
 
947
 
 
948
@b{get-internal-real-time} returns as an @i{integer} the 
 
949
current time in @i{internal time units}, relative to an arbitrary 
 
950
time base.  The difference between the values of two calls to this
 
951
function is the amount of elapsed real time (@i{i.e.}, clock time) between the two calls. 
 
952
 
 
953
@subsubheading  Affected By::
 
954
 
 
955
Time of day (@i{i.e.}, the passage of time).
 
956
The time base affects the result magnitude.
 
957
 
 
958
@subsubheading  See Also::
 
959
 
 
960
@ref{internal-time-units-per-second}
 
961
 
 
962
@node get-internal-run-time, disassemble, get-internal-real-time, Environment Dictionary
 
963
@subsection get-internal-run-time                                            [Function]
 
964
 
 
965
@code{get-internal-run-time}  @i{<@i{no @i{arguments}}>} @result{}  @i{internal-time}
 
966
 
 
967
@subsubheading  Arguments and Values::
 
968
 
 
969
@i{internal-time}---a non-negative @i{integer}.
 
970
 
 
971
@subsubheading  Description::
 
972
 
 
973
Returns as an @i{integer} the current 
 
974
run time in @i{internal time units}.  The precise meaning of this quantity is
 
975
@i{implementation-defined};  it may measure real time, run time, CPU cycles, or some
 
976
other quantity.  The intent is that the difference between the values of two calls
 
977
to this function be the amount of time between the two calls during which 
 
978
computational effort was expended on behalf of the executing program.
 
979
 
 
980
@subsubheading  Affected By::
 
981
 
 
982
The @i{implementation},
 
983
the time of day (@i{i.e.}, the passage of time).
 
984
 
 
985
@subsubheading  See Also::
 
986
 
 
987
@ref{internal-time-units-per-second}
 
988
 
 
989
@subsubheading  Notes::
 
990
 
 
991
Depending on the @i{implementation}, paging time and garbage
 
992
collection time might be included in this measurement.  Also, in a
 
993
multitasking environment, it might not be possible to show the time for
 
994
just the running process, so in some @i{implementations}, time taken
 
995
by other processes during the same time interval might be included in
 
996
this measurement as well.
 
997
 
 
998
@node disassemble, documentation, get-internal-run-time, Environment Dictionary
 
999
@subsection disassemble                                                      [Function]
 
1000
 
 
1001
@code{disassemble}  @i{fn} @result{}  @i{@b{nil}}
 
1002
 
 
1003
@subsubheading  Arguments and Values::
 
1004
 
 
1005
@i{fn}---an @i{extended function designator}
 
1006
          or a @i{lambda expression}.
 
1007
 
 
1008
@subsubheading  Description::
 
1009
 
 
1010
The @i{function} @b{disassemble} is a debugging aid that composes symbolic 
 
1011
instructions or expressions in some @i{implementation-dependent} 
 
1012
language which represent the code used to produce the @i{function}
 
1013
which is or is named by the argument @i{fn}.  The result is displayed
 
1014
to @i{standard output} in an @i{implementation-dependent} format.
 
1015
 
 
1016
If @i{fn} is a @i{lambda expression} or @i{interpreted function},
 
1017
it is compiled first and the result is disassembled.
 
1018
 
 
1019
If the @i{fn} @i{designator} is a @i{function name},
 
1020
the @i{function} that it @i{names} is disassembled.
 
1021
 
 
1022
(If that @i{function} is an @i{interpreted function},
 
1023
it is first compiled but the result of this implicit compilation is not installed.)
 
1024
 
 
1025
@subsubheading  Examples::
 
1026
 
 
1027
@example
 
1028
 (defun f (a) (1+ a)) @result{}  F
 
1029
 (eq (symbol-function 'f)
 
1030
     (progn (disassemble 'f)
 
1031
            (symbol-function 'f))) @result{}  @i{true}
 
1032
@end example
 
1033
 
 
1034
@subsubheading  Affected By::
 
1035
 
 
1036
@b{*standard-output*}.
 
1037
 
 
1038
@subsubheading  Exceptional Situations::
 
1039
 
 
1040
Should signal an error of @i{type} @b{type-error}
 
1041
                              if @i{fn} is not an @i{extended function designator}
 
1042
                  or a @i{lambda expression}.
 
1043
 
 
1044
@node documentation, room, disassemble, Environment Dictionary
 
1045
@subsection documentation, (setf documentation)             [Standard Generic Function]
 
1046
 
 
1047
@subsubheading  Syntax::
 
1048
 
 
1049
@code{documentation}  @i{x doc-type} @result{}  @i{documentation}
 
1050
 
 
1051
@code{(setf documentation)}  @i{new-value x doc-type} @result{}  @i{new-value}
 
1052
 
 
1053
@subsubheading  Argument Precedence Order::
 
1054
 
 
1055
@i{doc-type}, @i{object}
 
1056
 
 
1057
@subsubheading  Method Signatures::
 
1058
 
 
1059
@subsubheading Functions, Macros, and Special Forms
 
1060
 
 
1061
documentation (@i{x} @code{function}) (doc-type (eql 't))@*
 
1062
(setf documentation) @i{new-value}(@i{x} @code{function}) (doc-type (eql 't))
 
1063
 
 
1064
documentation (@i{x} @code{function}) (doc-type (eql 'function))@*
 
1065
(setf documentation) @i{new-value}(@i{x} @code{function}) (doc-type (eql 'function))
 
1066
 
 
1067
documentation (@i{x} @code{list}) (doc-type (eql 'function))@*
 
1068
(setf documentation) @i{new-value}(@i{x} @code{list}) (doc-type (eql 'function))
 
1069
 
 
1070
documentation (@i{x} @code{list}) (doc-type (eql 'compiler-macro))@*
 
1071
(setf documentation) @i{new-value}(@i{x} @code{list}) (doc-type (eql 'compiler-macro))
 
1072
 
 
1073
documentation (@i{x} @code{symbol}) (doc-type (eql 'function))@*
 
1074
(setf documentation) @i{new-value}(@i{x} @code{symbol}) (doc-type (eql 'function))
 
1075
 
 
1076
documentation (@i{x} @code{symbol}) (doc-type (eql 'compiler-macro))@*
 
1077
(setf documentation) @i{new-value}(@i{x} @code{symbol}) (doc-type (eql 'compiler-macro))
 
1078
 
 
1079
documentation (@i{x} @code{symbol}) (doc-type (eql 'setf))@*
 
1080
(setf documentation) @i{new-value}(@i{x} @code{symbol}) (doc-type (eql 'setf))
 
1081
 
 
1082
@subsubheading Method Combinations
 
1083
 
 
1084
documentation (@i{x} @code{method-combination}) (doc-type (eql 't))@*
 
1085
(setf documentation) @i{new-value}(@i{x} @code{method-combination}) (doc-type (eql 't))
 
1086
 
 
1087
documentation (@i{x} @code{method-combination}) (doc-type (eql 'method-combination))@*
 
1088
(setf documentation) @i{new-value}(@i{x} @code{method-combination}) (doc-type (eql 'method-combination))
 
1089
 
 
1090
documentation (@i{x} @code{symbol}) (doc-type (eql 'method-combination))@*
 
1091
(setf documentation) @i{new-value}(@i{x} @code{symbol}) (doc-type (eql 'method-combination))
 
1092
 
 
1093
@subsubheading Methods
 
1094
 
 
1095
documentation (@i{x} @code{standard-method}) (doc-type (eql 't))@*
 
1096
(setf documentation) @i{new-value}(@i{x} @code{standard-method}) (doc-type (eql 't))
 
1097
 
 
1098
@subsubheading Packages
 
1099
 
 
1100
documentation (@i{x} @code{package}) (doc-type (eql 't))@*
 
1101
(setf documentation) @i{new-value}(@i{x} @code{package}) (doc-type (eql 't))
 
1102
 
 
1103
@subsubheading Types, Classes, and Structure Names
 
1104
 
 
1105
documentation (@i{x} @code{standard-class}) (doc-type (eql 't))@*
 
1106
(setf documentation) @i{new-value}(@i{x} @code{standard-class}) (doc-type (eql 't))
 
1107
 
 
1108
documentation (@i{x} @code{standard-class}) (doc-type (eql 'type))@*
 
1109
(setf documentation) @i{new-value}(@i{x} @code{standard-class}) (doc-type (eql 'type))
 
1110
 
 
1111
documentation (@i{x} @code{structure-class}) (doc-type (eql 't))@*
 
1112
(setf documentation) @i{new-value}(@i{x} @code{structure-class}) (doc-type (eql 't))
 
1113
 
 
1114
documentation (@i{x} @code{structure-class}) (doc-type (eql 'type))@*
 
1115
(setf documentation) @i{new-value}(@i{x} @code{structure-class}) (doc-type (eql 'type))
 
1116
 
 
1117
documentation (@i{x} @code{symbol}) (doc-type (eql 'type))@*
 
1118
(setf documentation) @i{new-value}(@i{x} @code{symbol}) (doc-type (eql 'type))
 
1119
 
 
1120
documentation (@i{x} @code{symbol}) (doc-type (eql 'structure))@*
 
1121
(setf documentation) @i{new-value}(@i{x} @code{symbol}) (doc-type (eql 'structure))
 
1122
 
 
1123
@subsubheading Variables
 
1124
 
 
1125
documentation (@i{x} @code{symbol}) (doc-type (eql 'variable))@*
 
1126
(setf documentation) @i{new-value}(@i{x} @code{symbol}) (doc-type (eql 'variable))
 
1127
 
 
1128
@subsubheading  Arguments and Values::
 
1129
 
 
1130
@i{x}---an @i{object}.
 
1131
 
 
1132
@i{doc-type}---a @i{symbol}.
 
1133
 
 
1134
@i{documentation}---a @i{string}, or @b{nil}.
 
1135
 
 
1136
@i{new-value}---a @i{string}.
 
1137
 
 
1138
@subsubheading  Description::
 
1139
 
 
1140
The @i{generic function} @b{documentation} returns the @i{documentation string}
 
1141
associated with the given @i{object} if it is available;
 
1142
otherwise it returns @b{nil}.
 
1143
 
 
1144
The @i{generic function} @t{(setf documentation)} updates the 
 
1145
@i{documentation string} associated with @i{x} to @i{new-value}.
 
1146
If @i{x} is a @i{list},
 
1147
it must be of the form @t{(setf @i{symbol})}.
 
1148
 
 
1149
@i{Documentation strings} are made available for debugging purposes.
 
1150
@i{Conforming programs} are permitted to use @i{documentation strings}
 
1151
when they are present, but should not depend for their correct behavior on 
 
1152
the presence of those @i{documentation strings}.
 
1153
An @i{implementation} is permitted to discard @i{documentation strings} 
 
1154
at any time for @i{implementation-defined} reasons.
 
1155
 
 
1156
The nature of the @i{documentation string} returned depends on the
 
1157
@i{doc-type}, as follows:
 
1158
 
 
1159
@table @asis
 
1160
 
 
1161
@item @b{compiler-macro}  
 
1162
Returns the @i{documentation string} of the @i{compiler macro}
 
1163
whose @i{name} is the @i{function name} @i{x}.
 
1164
 
 
1165
@item @b{function}  
 
1166
If @i{x} is a @i{function name},
 
1167
returns the @i{documentation string} of 
 
1168
the @i{function}, @i{macro}, or @i{special operator} 
 
1169
whose @i{name} is @i{x}.
 
1170
 
 
1171
If @i{x} is a @i{function},
 
1172
returns the @i{documentation string} associated with @i{x}.
 
1173
 
 
1174
@item @b{method-combination}  
 
1175
If @i{x} is a @i{symbol},
 
1176
returns the @i{documentation string} of
 
1177
the @i{method combination}
 
1178
whose @i{name} is @i{x}.
 
1179
 
 
1180
If @i{x} is a @i{method combination},
 
1181
returns the @i{documentation string} associated with @i{x}.
 
1182
 
 
1183
@item @b{setf}  
 
1184
Returns the @i{documentation string} of 
 
1185
 
 
1186
the @i{setf expander}
 
1187
 
 
1188
whose @i{name} is the @i{symbol} @i{x}.
 
1189
 
 
1190
@item @b{structure}  
 
1191
Returns the @i{documentation string} 
 
1192
associated with the @i{structure name} @i{x}.
 
1193
 
 
1194
@item @b{t}  
 
1195
Returns a @i{documentation string} specialized on the @i{class} of
 
1196
the argument @i{x} itself.
 
1197
For example, if @i{x} is a @i{function},
 
1198
the @i{documentation string} associated with the @i{function} @i{x} is returned.
 
1199
 
 
1200
@item @b{type}  
 
1201
If @i{x} is a @i{symbol},
 
1202
returns the @i{documentation string} of the @i{class}
 
1203
whose @i{name} is the @i{symbol} @i{x},
 
1204
if there is such a @i{class}.
 
1205
Otherwise, it returns the @i{documentation string} of the @i{type} 
 
1206
which is the @i{type specifier} @i{symbol} @i{x}.
 
1207
 
 
1208
If @i{x} is a @i{structure class} or @i{standard class},
 
1209
returns the @i{documentation string} associated with
 
1210
the @i{class} @i{x}.
 
1211
 
 
1212
@item @b{variable}  
 
1213
Returns the @i{documentation string} of
 
1214
the @i{dynamic variable} or @i{constant variable}
 
1215
whose @i{name} is the @i{symbol} @i{x}.
 
1216
 
 
1217
@end table
 
1218
 
 
1219
A @i{conforming implementation} or a @i{conforming program}
 
1220
may extend the set of @i{symbols} that are acceptable as the @i{doc-type}.
 
1221
 
 
1222
@subsubheading  Notes::
 
1223
 
 
1224
This standard prescribes no means to retrieve the @i{documentation strings}
 
1225
for individual slots specified in a @b{defclass} form, but 
 
1226
@i{implementations} might still provide debugging tools and/or
 
1227
programming language extensions which manipulate this information.
 
1228
Implementors wishing to provide such support are encouraged to consult the
 
1229
@i{Metaobject Protocol} for suggestions about how this might be done.
 
1230
 
 
1231
@node room, ed, documentation, Environment Dictionary
 
1232
@subsection room                                                             [Function]
 
1233
 
 
1234
@code{room}  @i{@r{&optional} x} @result{}  @i{@i{implementation-dependent}}
 
1235
 
 
1236
@subsubheading  Arguments and Values:: 
 
1237
 
 
1238
@i{x}---one of @b{t}, @b{nil}, or @t{:default}.
 
1239
 
 
1240
@subsubheading  Description::
 
1241
 
 
1242
@b{room} prints, to @i{standard output},
 
1243
information about the state of internal storage and its management.
 
1244
This might include descriptions of the amount of memory in use and 
 
1245
the degree of memory compaction, possibly broken down by internal data type if that
 
1246
is appropriate.  The nature and format of the printed information is
 
1247
@i{implementation-dependent}.
 
1248
The intent is to provide information that a @i{programmer}
 
1249
might use to tune a @i{program} for a particular @i{implementation}.
 
1250
 
 
1251
@t{(room nil)} prints out a minimal amount of information.
 
1252
@t{(room t)} prints out a maximal amount of information.
 
1253
 
 
1254
@t{(room)} or @t{(room :default)} prints out an intermediate amount
 
1255
of information that is likely to be useful.
 
1256
 
 
1257
@subsubheading  Side Effects::
 
1258
 
 
1259
Output to @i{standard output}.
 
1260
 
 
1261
@subsubheading  Affected By::
 
1262
 
 
1263
@b{*standard-output*}.
 
1264
 
 
1265
@node ed, inspect, room, Environment Dictionary
 
1266
@subsection ed                                                               [Function]
 
1267
 
 
1268
@code{ed}  @i{@r{&optional} x} @result{}  @i{@i{implementation-dependent}}
 
1269
 
 
1270
@subsubheading  Arguments and Values::
 
1271
 
 
1272
@i{x}---@b{nil}, a @i{pathname}, a @i{string}, or a @i{function name}.
 
1273
 
 
1274
 The default is @b{nil}.
 
1275
 
 
1276
@subsubheading  Description::
 
1277
 
 
1278
@b{ed} invokes the editor if the @i{implementation} provides a resident editor.
 
1279
 
 
1280
If @i{x} is @b{nil}, the editor is entered.
 
1281
If the editor had been previously entered, its prior state is resumed, if possible.
 
1282
 
 
1283
If @i{x} is a @i{pathname} or @i{string}, 
 
1284
it is taken as the @i{pathname designator} for a @i{file} to be edited.
 
1285
 
 
1286
If @i{x} is a @i{function name}, the text of its definition is edited.
 
1287
The means by which the function text is obtained is @i{implementation-defined}.
 
1288
 
 
1289
@subsubheading  Exceptional Situations::
 
1290
 
 
1291
The consequences are undefined if the @i{implementation} does not provide a resident editor.
 
1292
 
 
1293
Might signal @b{type-error} if its argument is supplied but is not
 
1294
a @i{symbol}, a @i{pathname}, or @b{nil}. 
 
1295
 
 
1296
If a failure occurs when performing some operation on the @i{file system}
 
1297
while attempting to edit a @i{file},
 
1298
an error of @i{type} @b{file-error} is signaled.
 
1299
 
 
1300
An error of @i{type} @b{file-error} might be signaled if @i{x}
 
1301
is a @i{designator} for a @i{wild} @i{pathname}.
 
1302
 
 
1303
@i{Implementation-dependent} additional conditions might be signaled as well.
 
1304
 
 
1305
@subsubheading  See Also::
 
1306
 
 
1307
@b{pathname},
 
1308
 
 
1309
@b{logical-pathname},
 
1310
 
 
1311
@ref{compile-file}
 
1312
,
 
1313
@ref{load}
 
1314
,
 
1315
 
 
1316
@ref{Pathnames as Filenames}
 
1317
 
 
1318
@node inspect, dribble, ed, Environment Dictionary
 
1319
@subsection inspect                                                          [Function]
 
1320
 
 
1321
@code{inspect}  @i{object} @result{}  @i{@i{implementation-dependent}}
 
1322
 
 
1323
@subsubheading  Arguments and Values::
 
1324
 
 
1325
@i{object}---an @i{object}.
 
1326
 
 
1327
@subsubheading  Description::
 
1328
 
 
1329
@b{inspect} is an interactive version of @b{describe}.
 
1330
The nature of the interaction is @i{implementation-dependent},
 
1331
but the purpose of @b{inspect} is to make it easy to wander
 
1332
through a data structure, examining and modifying parts of it.
 
1333
 
 
1334
@subsubheading  Side Effects::
 
1335
 
 
1336
@i{implementation-dependent}.
 
1337
 
 
1338
@subsubheading  Affected By::
 
1339
 
 
1340
@i{implementation-dependent}.
 
1341
 
 
1342
@subsubheading  Exceptional Situations::
 
1343
 
 
1344
@i{implementation-dependent}.
 
1345
 
 
1346
@subsubheading  See Also::
 
1347
 
 
1348
@ref{describe}
 
1349
 
 
1350
@subsubheading  Notes::
 
1351
 
 
1352
Implementations are encouraged to respond to the typing
 
1353
of @t{?} or a ``help key'' by providing help, including a list
 
1354
of commands.
 
1355
 
 
1356
@node dribble, - (Variable), inspect, Environment Dictionary
 
1357
@subsection dribble                                                          [Function]
 
1358
 
 
1359
@code{dribble}  @i{@r{&optional} pathname} @result{}  @i{@i{implementation-dependent}}
 
1360
 
 
1361
@subsubheading  Arguments and Values::
 
1362
 
 
1363
@i{pathname}---a @i{pathname designator}.
 
1364
 
 
1365
@subsubheading  Description::
 
1366
 
 
1367
Either @i{binds} @b{*standard-input*} and @b{*standard-output*} 
 
1368
or takes other appropriate action, 
 
1369
so as to send a record of the input/output interaction to a file 
 
1370
named by @i{pathname}.  @b{dribble} is intended to create
 
1371
a readable record of an interactive session.
 
1372
 
 
1373
If @i{pathname} is a @i{logical pathname}, it is translated
 
1374
into a physical pathname as if by calling @b{translate-logical-pathname}.
 
1375
 
 
1376
@t{(dribble)} terminates the recording of input and output 
 
1377
and closes the dribble file.
 
1378
 
 
1379
If @b{dribble} is @i{called} while a @i{stream} to a ``dribble file'' 
 
1380
is still open from a previous @i{call} to @b{dribble},
 
1381
the effect is @i{implementation-defined}.  For example, 
 
1382
    the already-@i{open} @i{stream} might be @i{closed}, 
 
1383
 or dribbling might occur both to the old @i{stream} and to a new one,
 
1384
 or the old @i{stream} might stay open but not receive any further output,
 
1385
 or the new request might be ignored,
 
1386
 or some other action might be taken.
 
1387
 
 
1388
@subsubheading  Affected By::
 
1389
 
 
1390
The @i{implementation}.
 
1391
 
 
1392
@subsubheading  Exceptional Situations::
 
1393
 
 
1394
If a failure occurs when performing some operation on the @i{file system}
 
1395
while creating the dribble file, 
 
1396
an error of @i{type} @b{file-error} is signaled.
 
1397
 
 
1398
An error of @i{type} @b{file-error} might be signaled if @i{pathname}
 
1399
is a @i{designator} for a @i{wild} @i{pathname}.
 
1400
 
 
1401
@subsubheading  See Also::
 
1402
 
 
1403
@ref{Pathnames as Filenames}
 
1404
 
 
1405
@subsubheading  Notes::
 
1406
 
 
1407
@b{dribble} can return before subsequent 
 
1408
@i{forms} are executed. It also
 
1409
can enter a recursive interaction loop, 
 
1410
returning only when @t{(dribble)} is done.
 
1411
 
 
1412
@b{dribble} is intended primarily for interactive debugging;
 
1413
its effect cannot be relied upon when used in a program.
 
1414
 
 
1415
@node - (Variable), + (Variable), dribble, Environment Dictionary
 
1416
@subsection -                                                              [Variable]
 
1417
 
 
1418
@subsubheading  Value Type::
 
1419
 
 
1420
a @i{form}.
 
1421
 
 
1422
@subsubheading  Initial Value::
 
1423
 
 
1424
@i{implementation-dependent}.
 
1425
 
 
1426
@subsubheading  Description::
 
1427
 
 
1428
The @i{value} of @b{-} is the @i{form} that is currently being evaluated by
 
1429
the @i{Lisp read-eval-print loop}.
 
1430
 
 
1431
@subsubheading  Examples::
 
1432
 
 
1433
@example
 
1434
(format t "~&Evaluating ~S~
 
1435
@t{ |> } Evaluating (FORMAT T "~&Evaluating ~S~
 
1436
@result{}  NIL
 
1437
@end example
 
1438
 
 
1439
@subsubheading  Affected By::
 
1440
 
 
1441
@i{Lisp read-eval-print loop}.
 
1442
 
 
1443
@subsubheading  See Also::
 
1444
 
 
1445
@b{+} (@i{variable}),
 
1446
@b{*} (@i{variable}),
 
1447
@ref{/}
 
1448
 (@i{variable}), 
 
1449
@ref{Top level loop}
 
1450
 
 
1451
@node + (Variable), * (Variable), - (Variable), Environment Dictionary
 
1452
@subsection +, ++, +++                                                       [Variable]
 
1453
 
 
1454
@subsubheading  Value Type::
 
1455
 
 
1456
an @i{object}.
 
1457
 
 
1458
@subsubheading  Initial Value::
 
1459
 
 
1460
@i{implementation-dependent}.
 
1461
 
 
1462
@subsubheading  Description::
 
1463
 
 
1464
The @i{variables} @b{+}, @b{++}, and @b{+++} are maintained by the
 
1465
@i{Lisp read-eval-print loop} to save @i{forms} that were
 
1466
recently @i{evaluated}.
 
1467
 
 
1468
The @i{value} of @b{+}   is the last @i{form} that was @i{evaluated},
 
1469
the @i{value} of @b{++}  is the previous value of @b{+}, and
 
1470
the @i{value} of @b{+++} is the previous value of @b{++}.
 
1471
 
 
1472
@subsubheading  Examples::
 
1473
@example
 
1474
(+ 0 1) @result{}  1
 
1475
(- 4 2) @result{}  2
 
1476
(/ 9 3) @result{}  3
 
1477
(list + ++ +++) @result{}  ((/ 9 3) (- 4 2) (+ 0 1))
 
1478
(setq a 1 b 2 c 3 d (list a b c)) @result{}  (1 2 3)
 
1479
(setq a 4 b 5 c 6 d (list a b c)) @result{}  (4 5 6)
 
1480
(list a b c) @result{}  (4 5 6)
 
1481
(eval +++) @result{}  (1 2 3)
 
1482
#.`(,@@++ d) @result{}  (1 2 3 (1 2 3))
 
1483
@end example
 
1484
 
 
1485
@subsubheading  Affected By:: 
 
1486
 
 
1487
@i{Lisp read-eval-print loop}.
 
1488
 
 
1489
@subsubheading  See Also::
 
1490
 
 
1491
@ref{-}
 
1492
 (@i{variable}),
 
1493
@b{*} (@i{variable}),
 
1494
@ref{/}
 
1495
 (@i{variable}), 
 
1496
@ref{Top level loop}
 
1497
 
 
1498
@node * (Variable), / (Variable), + (Variable), Environment Dictionary
 
1499
@subsection *, **, ***                                                       [Variable]
 
1500
 
 
1501
@subsubheading  Value Type::
 
1502
 
 
1503
an @i{object}.
 
1504
 
 
1505
@subsubheading  Initial Value::
 
1506
 
 
1507
@i{implementation-dependent}.
 
1508
 
 
1509
@subsubheading  Description::
 
1510
 
 
1511
The @i{variables} @b{*}, @b{**}, and @b{***} are 
 
1512
maintained by the @i{Lisp read-eval-print loop} to save the 
 
1513
values of results that are printed each time through the loop.
 
1514
 
 
1515
The @i{value} of @b{*}   is the most recent @i{primary value} that was printed,
 
1516
the @i{value} of @b{**}  is the previous value of @b{*}, and 
 
1517
the @i{value} of @b{***} is the previous value of @b{**}.
 
1518
 
 
1519
If several values are produced, @b{*} contains the first value only;
 
1520
@b{*} contains @b{nil} if zero values are produced.
 
1521
 
 
1522
The @i{values} of @b{*}, @b{**}, and @b{***} are updated immediately
 
1523
prior to printing the @i{return value} of a top-level @i{form} by the
 
1524
@i{Lisp read-eval-print loop}.  If the @i{evaluation} of such a @i{form}
 
1525
is aborted prior to its normal return, the values of @b{*}, @b{**}, and @b{***} 
 
1526
are not updated.
 
1527
 
 
1528
@subsubheading  Examples::
 
1529
@example
 
1530
(values 'a1 'a2) @result{}  A1, A2
 
1531
'b @result{}  B
 
1532
(values 'c1 'c2 'c3) @result{}  C1, C2, C3
 
1533
(list * ** ***) @result{}  (C1 B A1)
 
1534
 
 
1535
(defun cube-root (x) (expt x 1/3)) @result{}  CUBE-ROOT
 
1536
(compile *) @result{}  CUBE-ROOT
 
1537
(setq a (cube-root 27.0)) @result{}  3.0
 
1538
(* * 9.0) @result{}  27.0
 
1539
@end example
 
1540
 
 
1541
@subsubheading  Affected By::
 
1542
 
 
1543
@i{Lisp read-eval-print loop}.
 
1544
 
 
1545
@subsubheading  See Also::
 
1546
 
 
1547
@ref{-}
 
1548
 (@i{variable}),
 
1549
@b{+} (@i{variable}),
 
1550
@ref{/}
 
1551
 (@i{variable}), 
 
1552
@ref{Top level loop}
 
1553
 
 
1554
@subsubheading  Notes::
 
1555
 
 
1556
@example
 
1557
 *   @equiv{} (car /)
 
1558
 **  @equiv{} (car //)
 
1559
 *** @equiv{} (car ///)
 
1560
@end example
 
1561
 
 
1562
@node / (Variable), lisp-implementation-type, * (Variable), Environment Dictionary
 
1563
@subsection /, //, ///                                                       [Variable]
 
1564
 
 
1565
@subsubheading  Value Type::
 
1566
 
 
1567
a @i{proper list}.
 
1568
 
 
1569
@subsubheading  Initial Value::
 
1570
 
 
1571
@i{implementation-dependent}.
 
1572
 
 
1573
@subsubheading  Description::
 
1574
 
 
1575
The @i{variables} @b{/}, @b{//}, and @b{///} are maintained by
 
1576
the @i{Lisp read-eval-print loop} to save the values of results that
 
1577
were printed at the end of the loop.
 
1578
 
 
1579
The @i{value} of @b{/}   is a @i{list} of the most recent @i{values} that were printed,
 
1580
the @i{value} of @b{//}  is the previous value of @b{/}, and
 
1581
the @i{value} of @b{///} is the previous value of @b{//}.
 
1582
 
 
1583
The @i{values} of @b{/}, @b{//}, and @b{///} are updated immediately
 
1584
prior to printing the @i{return value} of a top-level @i{form} by the
 
1585
@i{Lisp read-eval-print loop}.  If the @i{evaluation} of such a @i{form}
 
1586
is aborted prior to its normal return, the values of @b{/}, @b{//}, and @b{///} 
 
1587
are not updated.
 
1588
 
 
1589
@subsubheading  Examples::
 
1590
@example
 
1591
 (floor 22 7) @result{}  3, 1
 
1592
 (+ (* (car /) 7) (cadr /)) @result{}  22
 
1593
@end example
 
1594
 
 
1595
@subsubheading  Affected By::
 
1596
 
 
1597
@i{Lisp read-eval-print loop}.
 
1598
 
 
1599
@subsubheading  See Also::
 
1600
 
 
1601
@ref{-}
 
1602
 (@i{variable}),
 
1603
@b{+} (@i{variable}),
 
1604
@b{*} (@i{variable}),
 
1605
@ref{Top level loop}
 
1606
 
 
1607
@node lisp-implementation-type, short-site-name, / (Variable), Environment Dictionary
 
1608
@subsection lisp-implementation-type,
 
1609
@subheading lisp-implementation-version
 
1610
@flushright
 
1611
@i{[Function]}
 
1612
@end flushright
 
1613
 
 
1614
@code{lisp-implementation-type}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1615
 
 
1616
@code{lisp-implementation-version}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1617
 
 
1618
@subsubheading  Arguments and Values::
 
1619
 
 
1620
@i{description}---a @i{string} or @b{nil}.
 
1621
 
 
1622
@subsubheading  Description::
 
1623
 
 
1624
@b{lisp-implementation-type} and @b{lisp-implementation-version} 
 
1625
identify the current implementation of @r{Common Lisp}.
 
1626
 
 
1627
@b{lisp-implementation-type} returns a @i{string} 
 
1628
that identifies the generic name of
 
1629
the particular @r{Common Lisp} implementation.
 
1630
 
 
1631
@b{lisp-implementation-version} 
 
1632
returns a @i{string} that identifies the version of
 
1633
the particular @r{Common Lisp} implementation.
 
1634
 
 
1635
If no appropriate
 
1636
and relevant result can be produced, @b{nil} is returned instead
 
1637
of a @i{string}.
 
1638
 
 
1639
@subsubheading  Examples::
 
1640
 
 
1641
@example
 
1642
 (lisp-implementation-type)
 
1643
@result{}  "ACME Lisp"
 
1644
@i{OR}@result{} "Joe's Common Lisp"
 
1645
 (lisp-implementation-version)
 
1646
@result{}  "1.3a"
 
1647
@result{}  "V2"
 
1648
@i{OR}@result{} "Release 17.3, ECO #6"
 
1649
@end example
 
1650
 
 
1651
@node short-site-name, machine-instance, lisp-implementation-type, Environment Dictionary
 
1652
@subsection short-site-name, long-site-name                                  [Function]
 
1653
 
 
1654
@code{short-site-name}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1655
 
 
1656
@code{long-site-name}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1657
 
 
1658
@subsubheading  Arguments and Values:: 
 
1659
 
 
1660
@i{description}---a @i{string} or @b{nil}.
 
1661
 
 
1662
@subsubheading  Description::
 
1663
 
 
1664
@b{short-site-name} and @b{long-site-name} return
 
1665
a @i{string} that identifies the physical location 
 
1666
of the computer hardware, 
 
1667
or @b{nil} if no appropriate @i{description} can be produced.
 
1668
 
 
1669
@subsubheading  Examples::
 
1670
 
 
1671
@example
 
1672
 (short-site-name)
 
1673
@result{}  "MIT AI Lab"
 
1674
@i{OR}@result{} "CMU-CSD"
 
1675
 (long-site-name)
 
1676
@result{}  "MIT Artificial Intelligence Laboratory"
 
1677
@i{OR}@result{} "CMU Computer Science Department"
 
1678
@end example
 
1679
 
 
1680
@subsubheading  Affected By::
 
1681
 
 
1682
The implementation,
 
1683
the location of the computer hardware,
 
1684
and the installation/configuration process.
 
1685
 
 
1686
@node machine-instance, machine-type, short-site-name, Environment Dictionary
 
1687
@subsection machine-instance                                                 [Function]
 
1688
 
 
1689
@code{machine-instance}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1690
 
 
1691
@subsubheading  Arguments and Values::
 
1692
 
 
1693
@i{description}---a @i{string} or @b{nil}.
 
1694
 
 
1695
@subsubheading  Description::
 
1696
 
 
1697
Returns a @i{string} that identifies the particular instance of
 
1698
the computer hardware on which @r{Common Lisp} is running, 
 
1699
or @b{nil} if no such @i{string} can be computed.
 
1700
 
 
1701
@subsubheading  Examples::
 
1702
 
 
1703
@example
 
1704
 (machine-instance)
 
1705
@result{}  "ACME.COM"
 
1706
@i{OR}@result{} "S/N 123231"
 
1707
@i{OR}@result{} "18.26.0.179"
 
1708
@i{OR}@result{} "AA-00-04-00-A7-A4"
 
1709
@end example
 
1710
 
 
1711
@subsubheading  Affected By::
 
1712
 
 
1713
The machine instance,
 
1714
and the @i{implementation}.
 
1715
 
 
1716
@subsubheading  See Also::
 
1717
 
 
1718
@ref{machine-type}
 
1719
 
1720
@ref{machine-version}
 
1721
 
 
1722
@node machine-type, machine-version, machine-instance, Environment Dictionary
 
1723
@subsection machine-type                                                     [Function]
 
1724
 
 
1725
@code{machine-type}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1726
 
 
1727
@subsubheading  Arguments and Values::
 
1728
 
 
1729
@i{description}---a @i{string} or @b{nil}.
 
1730
 
 
1731
@subsubheading  Description::
 
1732
 
 
1733
Returns a @i{string} that identifies the generic name of
 
1734
the computer hardware on which @r{Common Lisp} is running.
 
1735
 
 
1736
@subsubheading  Examples::
 
1737
 
 
1738
@example
 
1739
 (machine-type)
 
1740
@result{}  "DEC PDP-10"
 
1741
@i{OR}@result{} "Symbolics LM-2"
 
1742
@end example
 
1743
 
 
1744
@subsubheading  Affected By::
 
1745
 
 
1746
The machine type.
 
1747
The implementation.
 
1748
 
 
1749
@subsubheading  See Also::
 
1750
 
 
1751
@ref{machine-version}
 
1752
 
 
1753
@node machine-version, software-type, machine-type, Environment Dictionary
 
1754
@subsection machine-version                                                  [Function]
 
1755
 
 
1756
@code{machine-version}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1757
 
 
1758
@subsubheading  Arguments and Values::
 
1759
 
 
1760
@i{description}---a @i{string} or @b{nil}.
 
1761
 
 
1762
@subsubheading  Description::
 
1763
 
 
1764
Returns a @i{string} that identifies the version of the computer hardware
 
1765
on which @r{Common Lisp} is running, or @b{nil} if no such value can be computed.
 
1766
 
 
1767
@subsubheading  Examples::
 
1768
 
 
1769
@example
 
1770
 (machine-version) @result{}  "KL-10, microcode 9"
 
1771
@end example
 
1772
 
 
1773
@subsubheading  Affected By::
 
1774
 
 
1775
The machine version, 
 
1776
and the @i{implementation}.
 
1777
 
 
1778
@subsubheading  See Also::
 
1779
 
 
1780
@ref{machine-type}
 
1781
 
1782
@ref{machine-instance}
 
1783
 
 
1784
@node software-type, user-homedir-pathname, machine-version, Environment Dictionary
 
1785
@subsection software-type, software-version                                  [Function]
 
1786
 
 
1787
@code{software-type}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1788
 
 
1789
@code{software-version}  @i{<@i{no @i{arguments}}>} @result{}  @i{description}
 
1790
 
 
1791
@subsubheading  Arguments and Values:: 
 
1792
 
 
1793
@i{description}---a @i{string} or @b{nil}.
 
1794
 
 
1795
@subsubheading  Description::
 
1796
 
 
1797
@b{software-type} returns a @i{string} that identifies the
 
1798
generic name of any relevant supporting software, or @b{nil} if no
 
1799
appropriate or relevant result can be produced.          
 
1800
 
 
1801
@b{software-version} returns a @i{string} that identifies 
 
1802
the version of any relevant supporting software, or @b{nil} if no 
 
1803
appropriate or relevant result can be produced.          
 
1804
 
 
1805
@subsubheading  Examples::
 
1806
 
 
1807
@example
 
1808
 (software-type) @result{}  "Multics"
 
1809
 (software-version) @result{}  "1.3x"
 
1810
@end example
 
1811
 
 
1812
@subsubheading  Affected By::
 
1813
 
 
1814
Operating system environment.
 
1815
 
 
1816
@subsubheading  Notes::
 
1817
 
 
1818
This information should be of use to maintainers of the @i{implementation}.
 
1819
 
 
1820
@node user-homedir-pathname,  , software-type, Environment Dictionary
 
1821
@subsection user-homedir-pathname                                            [Function]
 
1822
 
 
1823
@code{user-homedir-pathname}  @i{@r{&optional} host} @result{}  @i{pathname}
 
1824
 
 
1825
@subsubheading  Arguments and Values::
 
1826
 
 
1827
@i{host}---a @i{string}, a @i{list} of @i{strings}, or @t{:unspecific}.
 
1828
 
 
1829
@i{pathname}---a @i{pathname}, or @b{nil}.
 
1830
 
 
1831
@subsubheading  Description::
 
1832
 
 
1833
@b{user-homedir-pathname} determines the @i{pathname} that corresponds
 
1834
to the user's home directory on @i{host}.  
 
1835
If @i{host} is not supplied, its value is @i{implementation-dependent}.
 
1836
 
 
1837
For a description of @t{:unspecific}, see @ref{Pathname Components}.
 
1838
 
 
1839
The definition of home directory is @i{implementation-dependent}, 
 
1840
but defined in @r{Common Lisp} to mean the directory where the user
 
1841
keeps personal files such as initialization files and mail.  
 
1842
 
 
1843
@b{user-homedir-pathname} returns a @i{pathname} without any name, 
 
1844
type, or version component (those components are all @b{nil})
 
1845
for the user's home directory on @i{host}.
 
1846
 
 
1847
If it is impossible to determine the user's home directory on @i{host},
 
1848
then @b{nil} is returned.
 
1849
@b{user-homedir-pathname} never returns @b{nil} if @i{host} is not supplied.
 
1850
 
 
1851
@subsubheading  Examples::
 
1852
 
 
1853
@example
 
1854
 (pathnamep (user-homedir-pathname)) @result{}  @i{true}
 
1855
@end example
 
1856
 
 
1857
@subsubheading  Affected By::
 
1858
 
 
1859
The host computer's file system,
 
1860
and the @i{implementation}.
 
1861
 
 
1862
@c end of including dict-environment
 
1863
 
 
1864
@c %**end of chapter
 
1865