File: chap-10.texi

package info (click to toggle)
gclinfo 2.2-9
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,928 kB
  • ctags: 15
  • sloc: sed: 1,681; makefile: 127; lisp: 58; sh: 40
file content (1344 lines) | stat: -rw-r--r-- 40,776 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344


@node Symbols, Packages, Conditions, Top
@chapter Symbols

@menu
* Symbol Concepts::		
* Symbols Dictionary::		
@end menu

@node Symbol Concepts, Symbols Dictionary, Symbols, Symbols
@section Symbol Concepts

@c including concept-symbols

Figure 10--1 lists some
@i{defined names} that are applicable to the @i{property lists} of @i{symbols}.

@group
@noindent
@w{  get  remprop  symbol-plist  }

@noindent
@w{  Figure 10--1: Property list defined names}

@end group

Figure 10--2 lists some @i{defined names} that are applicable 
to the creation of and inquiry about @i{symbols}.

@group
@noindent
@w{  copy-symbol  keywordp     symbol-package  }
@w{  gensym       make-symbol  symbol-value    }
@w{  gentemp      symbol-name                  }

@noindent
@w{  Figure 10--2: Symbol creation and inquiry defined names}

@end group

@c end of including concept-symbols

@node Symbols Dictionary,  , Symbol Concepts, Symbols
@section Symbols Dictionary

@c including dict-symbols

@menu
* symbol::			
* keyword::			
* symbolp::			
* keywordp::			
* make-symbol::			
* copy-symbol::			
* gensym::			
* *gensym-counter*::		
* gentemp::			
* symbol-function::		
* symbol-name::			
* symbol-package::		
* symbol-plist::		
* symbol-value::		
* get::				
* remprop::			
* boundp::			
* makunbound::			
* set::				
* unbound-variable::		
@end menu

@node symbol, keyword, Symbols Dictionary, Symbols Dictionary
@subsection symbol                                                       [System Class]

@subsubheading  Class Precedence List::
@b{symbol},
@b{t}

@subsubheading  Description::

@i{Symbols} are used for their @i{object} identity to name various entities
in @r{Common Lisp}, including (but not limited to) linguistic entities such as
@i{variables} and @i{functions}.

@i{Symbols} can be collected together into @i{packages}.
A @i{symbol} is said to be @i{interned} in a @i{package} 
if it is @i{accessible} in that @i{package};
the same @i{symbol} can be @i{interned} in more than one @i{package}.
If a @i{symbol} is not @i{interned} in any @i{package}, 
it is called @i{uninterned}.

An @i{interned} @i{symbol} is uniquely identifiable by its @i{name} from 
any @i{package} in which it is @i{accessible}.

@i{Symbols} have the following attributes. For historically reasons,
these are sometimes referred to as @i{cells}, although the actual
internal representation of @i{symbols} and their attributes is
@i{implementation-dependent}.

@table @asis

@item @b{Name}  
The @i{name} of a @i{symbol} is a @i{string} used to identify the @i{symbol}.
Every @i{symbol} has a @i{name}, 

and the consequences are undefined if that @i{name} is altered.  

The @i{name} is used as part of the external, printed representation of
the @i{symbol}; see @ref{Character Syntax}.
The @i{function} @b{symbol-name} returns the @i{name} of a given @i{symbol}.

A @i{symbol} may have any @i{character} in its @i{name}.

@item @b{Package}  
The @i{object} in this @i{cell} is called the @i{home package} 
of the @i{symbol}.  If the @i{home package} is @b{nil}, the @i{symbol}
is sometimes said to have no @i{home package}.

When a @i{symbol} is first created, it has no @i{home package}.
When it is first @i{interned}, the @i{package} in which it is
initially @i{interned} becomes its @i{home package}.
The @i{home package} of a @i{symbol} can be @i{accessed}
by using the @i{function} @b{symbol-package}.

If a @i{symbol} is @i{uninterned} from the @i{package} 
which is its @i{home package}, its @i{home package} is set to @b{nil}.
Depending on whether there is another @i{package} in which the @i{symbol}
is @i{interned}, the symbol might or might not really be an @i{uninterned} @i{symbol}.
A @i{symbol} with no @i{home package} is therefore called 
@i{apparently uninterned}.

The consequences are undefined if an attempt is made to alter the @i{home package}
of a @i{symbol} 
external
in the @t{COMMON-LISP} @i{package} or the @t{KEYWORD} @i{package}.

@item @b{Property list}  
The @i{property list} of a @i{symbol} provides a mechanism for
associating named attributes with that @i{symbol}.
The operations for adding and removing entries are @i{destructive}
to the @i{property list}.  @r{Common Lisp} provides @i{operators} both for
direct manipulation of @i{property list} @i{objects} 
 (@i{e.g.}, see @b{getf}, @b{remf}, and @b{symbol-plist})
and for implicit manipulation of a @i{symbol}'s @i{property list} 
by reference to the @i{symbol} 
 (@i{e.g.}, see @b{get} and @b{remprop}).
The @i{property list} associated with a @i{fresh} @i{symbol} is 
initially @i{null}.

@item @b{Value}  
If a symbol has a value attribute, it is said to be @i{bound},
and that fact can be detected by the @i{function} @b{boundp}.
The @i{object} contained in the @i{value cell} of a @i{bound} @i{symbol}
is the @i{value} of the @i{global variable} named by that @i{symbol}, 
and can be @i{accessed} by the @i{function} @b{symbol-value}.
A @i{symbol} can be made to be @i{unbound} by the @i{function} @b{makunbound}.

The consequences are undefined if an attempt is made to change the @i{value}
of a @i{symbol} that names a @i{constant variable}, or to make such a 
@i{symbol} be @i{unbound}.

@item @b{Function}  
If a symbol has a function attribute, it is said to be @i{fbound},
and that fact can be detected by the @i{function} @b{fboundp}.
If the @i{symbol} is the @i{name} of a @i{function} in the @i{global environment},
the @i{function cell} contains the @i{function}, 
and can be @i{accessed} by the @i{function} @b{symbol-function}.
If the @i{symbol} is the @i{name} of either
   a @i{macro} in the @i{global environment} (see @b{macro-function})
or a @i{special operator} (see @b{special-operator-p}),
the @i{symbol} is @i{fbound}, 
and can be @i{accessed} by the @i{function} @b{symbol-function},
but the @i{object} which the @i{function cell}
contains is of @i{implementation-dependent} @i{type} and purpose.
A @i{symbol} can be made to be @i{funbound} by the @i{function} @b{fmakunbound}.

The consequences are undefined if an attempt is made to change the @i{functional value}
of a @i{symbol} that names a @i{special form}.

@end table

Operations on a @i{symbol}'s @i{value cell} and @i{function cell} are
sometimes described in terms of their effect on the @i{symbol} itself, but 
the user should keep in mind that there is an intimate relationship between the
contents of those @i{cells} and the @i{global variable} or 
global @i{function} definition, respectively.

@i{Symbols} are used as identifiers for @i{lexical variables} and 
lexical @i{function} definitions, but in that role, only their @i{object}
identity is significant.  @r{Common Lisp} provides no operation on a @i{symbol} that
can have any effect on a @i{lexical variable} or 
on a lexical @i{function} definition.

@subsubheading  See Also::

@ref{Symbols as Tokens},
@ref{Potential Numbers as Tokens},
@ref{Printing Symbols}

@node keyword, symbolp, symbol, Symbols Dictionary
@subsection keyword                                                              [Type]

@subsubheading  Supertypes:: 

@b{keyword},
@b{symbol},
@b{t}

@subsubheading  Description::

The @i{type} @b{keyword} includes all @i{symbols} @i{interned} the @t{KEYWORD} @i{package}.

@i{Interning} a @i{symbol} in the @t{KEYWORD} @i{package} has three automatic effects:

@table @asis

@item 1.  
It causes the @i{symbol} to become @i{bound} to itself.
@item 2.  
It causes the @i{symbol} to become an @i{external symbol}
	  of the @t{KEYWORD} @i{package}.
@item 3.  
It causes the @i{symbol} to become a @i{constant variable}.
@end table

@subsubheading  See Also::

@ref{keywordp}

@node symbolp, keywordp, keyword, Symbols Dictionary
@subsection symbolp                                                          [Function]

@code{symbolp}  @i{object} @result{}  @i{generalized-boolean}

@subsubheading  Arguments and Values:: 

@i{object}---an @i{object}.

@i{generalized-boolean}---a @i{generalized boolean}.

@subsubheading  Description::

Returns @i{true} if @i{object} is of @i{type} @b{symbol};
otherwise, returns @i{false}.

@subsubheading  Examples::

@example
 (symbolp 'elephant) @result{}  @i{true}
 (symbolp 12) @result{}  @i{false}
 (symbolp nil) @result{}  @i{true}
 (symbolp '()) @result{}  @i{true}
 (symbolp :test) @result{}  @i{true}
 (symbolp "hello") @result{}  @i{false}
@end example

@subsubheading  See Also::

@ref{keywordp}
,
@b{symbol},
@ref{typep}

@subsubheading  Notes::

@example
 (symbolp @i{object}) @equiv{} (typep @i{object} 'symbol)
@end example

@node keywordp, make-symbol, symbolp, Symbols Dictionary
@subsection keywordp                                                         [Function]

@code{keywordp}  @i{object} @result{}  @i{generalized-boolean}

@subsubheading  Arguments and Values:: 

@i{object}---an @i{object}.

@i{generalized-boolean}---a @i{generalized boolean}.

@subsubheading  Description::

Returns @i{true} if @i{object} is a @i{keyword}_1;
otherwise, returns @i{false}.

@subsubheading  Examples::

@example
 (keywordp 'elephant) @result{}  @i{false}
 (keywordp 12) @result{}  @i{false}
 (keywordp :test) @result{}  @i{true}
 (keywordp ':test) @result{}  @i{true}
 (keywordp nil) @result{}  @i{false}
 (keywordp :nil) @result{}  @i{true}
 (keywordp '(:test)) @result{}  @i{false}
 (keywordp "hello") @result{}  @i{false}
 (keywordp ":hello") @result{}  @i{false}
 (keywordp '&optional) @result{}  @i{false}
@end example

@subsubheading  See Also::

@ref{constantp}
,
@ref{keyword}
,
@ref{symbolp}
,
@ref{symbol-package}

@node make-symbol, copy-symbol, keywordp, Symbols Dictionary
@subsection make-symbol                                                      [Function]

@code{make-symbol}  @i{name} @result{}  @i{new-symbol}

@subsubheading  Arguments and Values:: 

@i{name}---a @i{string}.

@i{new-symbol}---a @i{fresh}, @i{uninterned} @i{symbol}.

@subsubheading  Description::

@b{make-symbol} creates and returns a @i{fresh}, @i{uninterned}
@i{symbol} whose @i{name} is the given @i{name}.
The @i{new-symbol} is neither @i{bound} nor @i{fbound} 
and has a @i{null} @i{property list}.

It is @i{implementation-dependent} whether the @i{string} 
that becomes the @i{new-symbol}'s @i{name} is the given
@i{name} or a copy of it.  Once a @i{string}
has been given as the @i{name} @i{argument} to
@i{make-symbol}, the consequences are undefined if a
subsequent attempt is made to alter that @i{string}.

@subsubheading  Examples::

@example
 (setq temp-string "temp") @result{}  "temp"
 (setq temp-symbol (make-symbol temp-string)) @result{}  #:|temp|
 (symbol-name temp-symbol) @result{}  "temp"
 (eq (symbol-name temp-symbol) temp-string) @result{}  @i{implementation-dependent}
 (find-symbol "temp") @result{}  NIL, NIL
 (eq (make-symbol temp-string) (make-symbol temp-string)) @result{}  @i{false}
@end example

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{name} is not a @i{string}.

@subsubheading  See Also::

@ref{copy-symbol}

@subsubheading  Notes::

No attempt is made by @b{make-symbol} to convert the case
of the @i{name} to uppercase.  The only case conversion which ever 
occurs for @i{symbols} is done by the @i{Lisp reader}.
The program interface to @i{symbol} creation retains case,
and the program interface to interning symbols is case-sensitive.

@node copy-symbol, gensym, make-symbol, Symbols Dictionary
@subsection copy-symbol                                                      [Function]

@code{copy-symbol}  @i{symbol {&optional} copy-properties} @result{}  @i{new-symbol}

@subsubheading  Arguments and Values::

@i{symbol}---a @i{symbol}.

@i{copy-properties}---a @i{generalized boolean}.
  The default is @i{false}.

@i{new-symbol}---a @i{fresh}, @i{uninterned} @i{symbol}.

@subsubheading  Description::

@b{copy-symbol} returns a @i{fresh}, @i{uninterned} @i{symbol},
the @i{name} of which is @b{string=} to and possibly the @i{same} as
the @i{name} of the given @i{symbol}.

If @i{copy-properties} is @i{false},
the @i{new-symbol} is neither @i{bound} nor @i{fbound} 
and has a @i{null} @i{property list}.
If @i{copy-properties} is @i{true}, then
the initial @i{value} of @i{new-symbol} is
 the @i{value} of @i{symbol},
the initial @i{function} definition of @i{new-symbol} is
 the @i{functional value} of @i{symbol},
and the @i{property list} of @i{new-symbol} is

 a @i{copy}_2 of the @i{property list} of @i{symbol}.

@subsubheading  Examples::

@example
 (setq fred 'fred-smith) @result{}  FRED-SMITH
 (setf (symbol-value fred) 3) @result{}  3
 (setq fred-clone-1a (copy-symbol fred nil)) @result{}  #:FRED-SMITH
 (setq fred-clone-1b (copy-symbol fred nil)) @result{}  #:FRED-SMITH
 (setq fred-clone-2a (copy-symbol fred t))   @result{}  #:FRED-SMITH
 (setq fred-clone-2b (copy-symbol fred t))   @result{}  #:FRED-SMITH
 (eq fred fred-clone-1a) @result{}  @i{false}
 (eq fred-clone-1a fred-clone-1b) @result{}  @i{false}
 (eq fred-clone-2a fred-clone-2b) @result{}  @i{false}
 (eq fred-clone-1a fred-clone-2a) @result{}  @i{false}
 (symbol-value fred) @result{}  3
 (boundp fred-clone-1a) @result{}  @i{false}
 (symbol-value fred-clone-2a) @result{}  3
 (setf (symbol-value fred-clone-2a) 4) @result{}  4
 (symbol-value fred) @result{}  3
 (symbol-value fred-clone-2a) @result{}  4
 (symbol-value fred-clone-2b) @result{}  3
 (boundp fred-clone-1a) @result{}  @i{false}
 (setf (symbol-function fred) #'(lambda (x) x)) @result{}  #<FUNCTION anonymous>
 (fboundp fred) @result{}  @i{true}
 (fboundp fred-clone-1a) @result{}  @i{false}
 (fboundp fred-clone-2a) @result{}  @i{false}
@end example

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@subsubheading  See Also::

@ref{make-symbol}

@subsubheading  Notes::

Implementors are encouraged not to copy the @i{string} 
which is the @i{symbol}'s @i{name} unnecessarily.  
Unless there is a good reason to do so, the normal implementation
strategy is for the @i{new-symbol}'s @i{name} to
be @i{identical} to the given @i{symbol}'s @i{name}.

@node gensym, *gensym-counter*, copy-symbol, Symbols Dictionary
@subsection gensym                                                           [Function]

@code{gensym}  @i{{&optional} x} @result{}  @i{new-symbol}

@subsubheading  Arguments and Values::

@i{x}---a @i{string} or a non-negative @i{integer}.
	    Complicated defaulting behavior; see below.

@i{new-symbol}---a @i{fresh}, @i{uninterned} @i{symbol}.

@subsubheading  Description::

Creates and returns a @i{fresh}, @i{uninterned} @i{symbol},
as if by calling @b{make-symbol}.  (The only difference between
@b{gensym} and @b{make-symbol} is in how the @i{new-symbol}'s 
@i{name} is determined.)

The @i{name} of the @i{new-symbol} is the concatenation 
of a prefix, which defaults to @t{"G"}, and

a suffix, which is the decimal representation of a number that
defaults to the @i{value} of @b{*gensym-counter*}.

If @i{x} is supplied, and is a @i{string}, then that @i{string} 
is used as a prefix instead of @t{"G"} for this call to @b{gensym} only.

If @i{x} is supplied, and is an @i{integer}, then that @i{integer},
instead of the @i{value} of @b{*gensym-counter*}, is used as the suffix
for this call to @b{gensym} only.

If and only if no explicit suffix is supplied,
@b{*gensym-counter*} is incremented after it is used.

@subsubheading  Examples::

@example
 (setq sym1 (gensym)) @result{}  #:G3142
 (symbol-package sym1) @result{}  NIL
 (setq sym2 (gensym 100)) @result{}  #:G100
 (setq sym3 (gensym 100)) @result{}  #:G100
 (eq sym2 sym3) @result{}  @i{false}
 (find-symbol "G100") @result{}  NIL, NIL
 (gensym "T") @result{}  #:T3143
 (gensym) @result{}  #:G3144
@end example

@subsubheading  Side Effects::

Might increment @b{*gensym-counter*}.

@subsubheading  Affected By::

@b{*gensym-counter*}

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{x} is not a @i{string} or a non-negative @i{integer}.

@subsubheading  See Also::

@ref{gentemp}
,
@b{*gensym-counter*}

@subsubheading  Notes::

The ability to pass a numeric argument to @b{gensym} has been deprecated;
explicitly @i{binding} @b{*gensym-counter*} is now stylistically preferred.
(The somewhat baroque conventions for the optional argument are historical
in nature, and supported primarily for compatibility with older dialects
of @r{Lisp}.   In modern code, it is recommended that the only kind of argument
used be a string prefix.  In general, though, to obtain more flexible control
of the @i{new-symbol}'s @i{name}, consider using @b{make-symbol} instead.)

@node *gensym-counter*, gentemp, gensym, Symbols Dictionary
@subsection *gensym-counter*                                                 [Variable]

@subsubheading  Value Type::

a non-negative @i{integer}.

@subsubheading  Initial Value::

@i{implementation-dependent}.

@subsubheading  Description::

A number which will be used in constructing the @i{name} of 
the next @i{symbol} generated by the @i{function} @b{gensym}.

@b{*gensym-counter*} can be either @i{assigned} or @i{bound}
at any time, but its value must always be a non-negative @i{integer}.

@subsubheading  Affected By::

@b{gensym}.

@subsubheading  See Also::

@ref{gensym}

@subsubheading  Notes::

The ability to pass a numeric argument to @b{gensym} has been deprecated;
explicitly @i{binding} @b{*gensym-counter*} is now stylistically preferred.

@node gentemp, symbol-function, *gensym-counter*, Symbols Dictionary
@subsection gentemp                                                          [Function]

@code{gentemp}  @i{{&optional} prefix package} @result{}  @i{new-symbol}

@subsubheading  Arguments and Values::

@i{prefix}---a @i{string}.
 The default is @t{"T"}.

@i{package}---a @i{package designator}.
 The default is the @i{current package}.

@i{new-symbol}---a @i{fresh}, @i{interned} @i{symbol}.

@subsubheading  Description::

@b{gentemp} creates and returns a @i{fresh} @i{symbol},
@i{interned} in the indicated @i{package}.
The @i{symbol} is guaranteed to be one that was not previously
@i{accessible} in @i{package}.
It is neither @i{bound} nor @i{fbound}, and has a @i{null}
@i{property list}.

The @i{name} of the @i{new-symbol} is the concatenation 
of the @i{prefix} and a suffix, which is taken from an internal
counter used only by @b{gentemp}.  (If a @i{symbol} by that name
is already @i{accessible} in @i{package}, the counter is incremented as
many times as is necessary to produce a @i{name} that is not already the
@i{name} of a @i{symbol} @i{accessible} in @i{package}.)

@subsubheading  Examples::

@example
 (gentemp) @result{}  T1298
 (gentemp "FOO") @result{}  FOO1299
 (find-symbol "FOO1300") @result{}  NIL, NIL
 (gentemp "FOO") @result{}  FOO1300
 (find-symbol "FOO1300") @result{}  FOO1300, :INTERNAL
 (intern "FOO1301") @result{}  FOO1301, :INTERNAL
 (gentemp "FOO") @result{}  FOO1302
 (gentemp) @result{}  T1303
@end example

@subsubheading  Side Effects::

Its internal counter is incremented one or more times.

@i{Interns} the @i{new-symbol} in @i{package}.

@subsubheading  Affected By::

The current state of its internal counter, and
the current state of the @i{package}.

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{prefix} is not a @i{string}.
Should signal an error of @i{type} @b{type-error}
			      if @i{package} is not a @i{package designator}.

@subsubheading  See Also::

@ref{gensym}

@subsubheading  Notes::

The function @b{gentemp} is deprecated.

If @i{package} is the @t{KEYWORD} @i{package},
the result is an @i{external symbol} of @i{package}.
Otherwise, the result is an @i{internal symbol} of @i{package}.

The @b{gentemp} internal counter is independent of
@b{*gensym-counter*}, the counter used by @b{gensym}.  
There is no provision for accessing the @b{gentemp} internal counter.

Just because @b{gentemp} creates a @i{symbol} which did not
previously exist does not mean that such a @i{symbol} might not be
seen in the future (@i{e.g.}, in a data file---perhaps even created by the
same program in another session).  As such, this symbol is not truly
unique in the same sense as a @i{gensym} would be.  In particular,
programs which do automatic code generation should be careful not to
attach global attributes to such generated @i{symbols} (@i{e.g.}, @b{special} @i{declarations}) and then write them into a file
because such global attributes might, in a different session, end up
applying to other @i{symbols} that were automatically generated on
another day for some other purpose.

@node symbol-function, symbol-name, gentemp, Symbols Dictionary
@subsection symbol-function                                                  [Accessor]

@code{symbol-function}  @i{symbol} @result{}  @i{contents}

(setf (@code{         symbol-function} @i{symbol}) new-contents)@*

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{contents}---

If the @i{symbol} is globally defined as a @i{macro} or a @i{special operator},
an @i{object} of @i{implementation-dependent} nature and identity is returned.
If the @i{symbol} is not globally defined as 
 either a @i{macro} or a @i{special operator},
and
 if the @i{symbol} is @i{fbound},
a @i{function} @i{object} is returned.

@i{new-contents}---a @i{function}.

@subsubheading  Description::

@i{Accesses} the @i{symbol}'s @i{function cell}.

@subsubheading  Examples::

@example
 (symbol-function 'car) @result{}  #<FUNCTION CAR>
 (symbol-function 'twice) is an error   ;because TWICE isn't defined.
 (defun twice (n) (* n 2)) @result{}  TWICE
 (symbol-function 'twice) @result{}  #<FUNCTION TWICE>
 (list (twice 3)
       (funcall (function twice) 3)
       (funcall (symbol-function 'twice) 3))
@result{}  (6 6 6)
 (flet ((twice (x) (list x x)))
   (list (twice 3)
         (funcall (function twice) 3)
         (funcall (symbol-function 'twice) 3)))
@result{}  ((3 3) (3 3) 6)   
 (setf (symbol-function 'twice) #'(lambda (x) (list x x)))
@result{}  #<FUNCTION anonymous>
 (list (twice 3)
       (funcall (function twice) 3)
       (funcall (symbol-function 'twice) 3))
@result{}  ((3 3) (3 3) (3 3))
 (fboundp 'defun) @result{}  @i{true}
 (symbol-function 'defun)
@result{}  @i{implementation-dependent}
 (functionp (symbol-function 'defun))
@result{}  @i{implementation-dependent}
 (defun symbol-function-or-nil (symbol)
   (if (and (fboundp symbol) 
            (not (macro-function symbol))
            (not (special-operator-p symbol)))
       (symbol-function symbol)
       nil)) @result{}  SYMBOL-FUNCTION-OR-NIL
 (symbol-function-or-nil 'car) @result{}  #<FUNCTION CAR>
 (symbol-function-or-nil 'defun) @result{}  NIL
@end example

@subsubheading  Affected By::

@b{defun}

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

Should signal @b{undefined-function} if @i{symbol} is not @i{fbound}
and an attempt is made to @i{read} its definition.  (No such error is signaled
on an attempt to @i{write} its definition.)

@subsubheading  See Also::

@ref{fboundp}
,
@ref{fmakunbound}
,
@ref{macro-function}
,

@ref{special-operator-p}

@subsubheading  Notes::
@b{symbol-function} cannot @i{access} the value of a lexical function name
produced by @b{flet} or @b{labels}; it can @i{access} only
the global function value.

@b{setf} may be used with 
@b{symbol-function} to replace a global function
definition when the @i{symbol}'s function definition 
does not represent a @i{special operator}.

@example
(symbol-function @i{symbol}) @equiv{} (fdefinition @i{symbol})
@end example

However, @b{fdefinition} accepts arguments other than just @i{symbols}.

@node symbol-name, symbol-package, symbol-function, Symbols Dictionary
@subsection symbol-name                                                      [Function]

@code{symbol-name}  @i{symbol} @result{}  @i{name}

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{name}---a @i{string}.

@subsubheading  Description::

@b{symbol-name} returns the @i{name} of @i{symbol}.

The consequences are undefined if @i{name} is ever modified.

@subsubheading  Examples::

@example
 (symbol-name 'temp) @result{}  "TEMP" 
 (symbol-name :start) @result{}  "START"
 (symbol-name (gensym)) @result{}  "G1234" ;for example
@end example

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@node symbol-package, symbol-plist, symbol-name, Symbols Dictionary
@subsection symbol-package                                                   [Function]

@code{symbol-package}  @i{symbol} @result{}  @i{contents}

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{contents}---a @i{package} @i{object} or @b{nil}.

@subsubheading  Description::

Returns the @i{home package} of @i{symbol}.

@subsubheading  Examples::

@example
 (in-package "CL-USER") @result{}  #<PACKAGE "COMMON-LISP-USER">
 (symbol-package 'car) @result{}  #<PACKAGE "COMMON-LISP">
 (symbol-package 'bus) @result{}  #<PACKAGE "COMMON-LISP-USER">
 (symbol-package :optional) @result{}  #<PACKAGE "KEYWORD">
 ;; Gensyms are uninterned, so have no home package.
 (symbol-package (gensym)) @result{}  NIL
 (make-package 'pk1) @result{}  #<PACKAGE "PK1">
 (intern "SAMPLE1" "PK1") @result{}  PK1::SAMPLE1, NIL
 (export (find-symbol "SAMPLE1" "PK1") "PK1") @result{}  T
 (make-package 'pk2 :use '(pk1)) @result{}  #<PACKAGE "PK2">
 (find-symbol "SAMPLE1" "PK2") @result{}  PK1:SAMPLE1, :INHERITED
 (symbol-package 'pk1::sample1) @result{}  #<PACKAGE "PK1">
 (symbol-package 'pk2::sample1) @result{}  #<PACKAGE "PK1">
 (symbol-package 'pk1::sample2) @result{}  #<PACKAGE "PK1">
 (symbol-package 'pk2::sample2) @result{}  #<PACKAGE "PK2">
 ;; The next several forms create a scenario in which a symbol
 ;; is not really uninterned, but is "apparently uninterned",
 ;; and so SYMBOL-PACKAGE still returns NIL.
 (setq s3 'pk1::sample3) @result{}  PK1::SAMPLE3
 (import s3 'pk2) @result{}  T
 (unintern s3 'pk1) @result{}  T
 (symbol-package s3) @result{}  NIL
 (eq s3 'pk2::sample3) @result{}  T
@end example

@subsubheading  Affected By::

@b{import},
@b{intern},
@b{unintern}

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@subsubheading  See Also::

@ref{intern}

@node symbol-plist, symbol-value, symbol-package, Symbols Dictionary
@subsection symbol-plist                                                     [Accessor]

@code{symbol-plist}  @i{symbol} @result{}  @i{plist}

(setf (@code{         symbol-plist} @i{symbol}) new-plist)@*

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{plist}, @i{new-plist}---a @i{property list}.

@subsubheading  Description::

@i{Accesses} the @i{property list} of @i{symbol}.

@subsubheading  Examples::

@example
 (setq sym (gensym)) @result{}  #:G9723
 (symbol-plist sym) @result{}  ()
 (setf (get sym 'prop1) 'val1) @result{}  VAL1
 (symbol-plist sym) @result{}  (PROP1 VAL1)
 (setf (get sym 'prop2) 'val2) @result{}  VAL2
 (symbol-plist sym) @result{}  (PROP2 VAL2 PROP1 VAL1)
 (setf (symbol-plist sym) (list 'prop3 'val3)) @result{}  (PROP3 VAL3)
 (symbol-plist sym) @result{}  (PROP3 VAL3)
@end example

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@subsubheading  See Also::

@ref{get}
,
@ref{remprop}

@subsubheading  Notes::

The use of @b{setf} should be avoided, since a @i{symbol}'s
@i{property list} is a global resource that can contain information 
established and depended upon by unrelated programs in the same @i{Lisp image}.

@node symbol-value, get, symbol-plist, Symbols Dictionary
@subsection symbol-value                                                     [Accessor]

@code{symbol-value}  @i{symbol} @result{}  @i{value}

(setf (@code{         symbol-value} @i{symbol}) new-value)@*

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol} that must have a @i{value}.

@i{value}, @i{new-value}---an @i{object}.

@subsubheading  Description::

@i{Accesses} the @i{symbol}'s @i{value cell}.

@subsubheading  Examples::

@example
 (setf (symbol-value 'a) 1) @result{}  1
 (symbol-value 'a) @result{}  1
 ;; SYMBOL-VALUE cannot see lexical variables.
 (let ((a 2)) (symbol-value 'a)) @result{}  1
 (let ((a 2)) (setq a 3) (symbol-value 'a)) @result{}  1
 ;; SYMBOL-VALUE can see dynamic variables.
 (let ((a 2)) 
   (declare (special a)) 
   (symbol-value 'a)) @result{}  2
 (let ((a 2)) 
   (declare (special a)) 
   (setq a 3)
   (symbol-value 'a)) @result{}  3
 (let ((a 2))
   (setf (symbol-value 'a) 3)
   a) @result{}  2
 a @result{}  3
 (symbol-value 'a) @result{}  3
 (let ((a 4))
   (declare (special a))
   (let ((b (symbol-value 'a)))
     (setf (symbol-value 'a) 5)
     (values a b))) @result{}  5, 4
 a @result{}  3
 (symbol-value :any-keyword) @result{}  :ANY-KEYWORD
 (symbol-value 'nil) @result{}  NIL
 (symbol-value '()) @result{}  NIL
 ;; The precision of this next one is @i{implementation-dependent}.
 (symbol-value 'pi) @result{}  3.141592653589793d0  
@end example

@subsubheading  Affected By::

@b{makunbound},
@b{set},
@b{setq}

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

Should signal @b{unbound-variable} if @i{symbol} is @i{unbound}
and an attempt is made to @i{read} its @i{value}.  (No such error is signaled
on an attempt to @i{write} its @i{value}.)

@subsubheading  See Also::

@ref{boundp}
, 
@ref{makunbound}
, 
@ref{set}
, 
@ref{setq}

@subsubheading  Notes::

@b{symbol-value} can be used to get the value of a @i{constant variable}.
@b{symbol-value} cannot @i{access} the value of a @i{lexical variable}.

@node get, remprop, symbol-value, Symbols Dictionary
@subsection get                                                              [Accessor]

@code{get}  @i{symbol indicator {&optional} default} @result{}  @i{value}

(setf (@code{         get} @i{symbol indicator {&optional} default}) new-value)@*

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{indicator}---an @i{object}.

@i{default}---an @i{object}.
 The default is @b{nil}.

@i{value}---if the indicated property exists,
		   the @i{object} that is its @i{value};
		otherwise, the specified @i{default}.

@i{new-value}---an @i{object}.

@subsubheading  Description::

@b{get} finds a @i{property} 
on the @i{property list}_2 of @i{symbol} 
whose @i{property indicator} is @i{identical} to @i{indicator},
and returns its corresponding @i{property value}.

If there are multiple @i{properties}_1 with that @i{property indicator},
@b{get} uses the first such @i{property}.

If there is no @i{property} with that @i{property indicator},
@i{default} is returned.

@b{setf} of @b{get} may be used to associate a new @i{object}
with an existing indicator already on the @i{symbol}'s @i{property list},
or to create a new assocation if none exists.

If there are multiple @i{properties}_1 with that @i{property indicator},
@b{setf} of @b{get} associates the @i{new-value} 
with the first such @i{property}.

When a @b{get} @i{form} is used as a @b{setf} @i{place},
any @i{default} which is supplied is evaluated according to normal
left-to-right evaluation rules, but its @i{value} is ignored.

@subsubheading  Examples::

@example
 (defun make-person (first-name last-name)
   (let ((person (gensym "PERSON")))
     (setf (get person 'first-name) first-name)
     (setf (get person 'last-name) last-name)
     person)) @result{}  MAKE-PERSON
 (defvar *john* (make-person "John" "Dow")) @result{}  *JOHN*
 *john* @result{}  #:PERSON4603
 (defvar *sally* (make-person "Sally" "Jones")) @result{}  *SALLY*
 (get *john* 'first-name) @result{}  "John"
 (get *sally* 'last-name) @result{}  "Jones"
 (defun marry (man woman married-name)
   (setf (get man 'wife) woman)
   (setf (get woman 'husband) man)
   (setf (get man 'last-name) married-name)
   (setf (get woman 'last-name) married-name)
   married-name) @result{}  MARRY
 (marry *john* *sally* "Dow-Jones") @result{}  "Dow-Jones"
 (get *john* 'last-name) @result{}  "Dow-Jones"
 (get (get *john* 'wife) 'first-name) @result{}  "Sally"
 (symbol-plist *john*)
@result{}  (WIFE #:PERSON4604 LAST-NAME "Dow-Jones" FIRST-NAME "John")
 (defmacro age (person &optional (default ''thirty-something)) 
   `(get ,person 'age ,default)) @result{}  AGE
 (age *john*) @result{}  THIRTY-SOMETHING
 (age *john* 20) @result{}  20
 (setf (age *john*) 25) @result{}  25
 (age *john*) @result{}  25
 (age *john* 20) @result{}  25
@end example

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@subsubheading  See Also::

@ref{getf}
,
@ref{symbol-plist}
,
@ref{remprop}

@subsubheading  Notes::

@example
 (get x y) @equiv{} (getf (symbol-plist x) y)
@end example

@i{Numbers} and @i{characters} are not recommended for use 
as @i{indicators} in portable code since @b{get} tests 
with @b{eq} rather than @b{eql}, and consequently 
the effect of using such @i{indicators} is 
@i{implementation-dependent}.

There is no way using @b{get} to distinguish an absent property from
one whose value is @i{default}.  However, see @b{get-properties}.

@node remprop, boundp, get, Symbols Dictionary
@subsection remprop                                                          [Function]

@code{remprop}  @i{symbol indicator} @result{}  @i{generalized-boolean}

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{indicator}---an @i{object}.

@i{generalized-boolean}---a @i{generalized boolean}.

@subsubheading  Description::

@b{remprop} removes from the @i{property list}_2 of @i{symbol}
a @i{property}_1 with a @i{property indicator}
@i{identical} to @i{indicator}.

If there are multiple @i{properties}_1 with the @i{identical} key,
@b{remprop} only removes the first such @i{property}.

@b{remprop} returns @i{false} if no such @i{property} was found,
or @i{true} if a property was found.

The @i{property indicator} 
and the corresponding @i{property value} 
are removed in an undefined order
by destructively splicing the property list.  

The permissible side-effects correspond to those permitted for @b{remf},
such that:

@example
 (remprop @i{x} @i{y}) @equiv{} (remf (symbol-plist @i{x}) @i{y})
@end example

@subsubheading  Examples::

@example
 (setq test (make-symbol "PSEUDO-PI")) @result{}  #:PSEUDO-PI
 (symbol-plist test) @result{}  ()
 (setf (get test 'constant) t) @result{}  T
 (setf (get test 'approximation) 3.14) @result{}  3.14
 (setf (get test 'error-range) 'noticeable) @result{}  NOTICEABLE
 (symbol-plist test) 
@result{}  (ERROR-RANGE NOTICEABLE APPROXIMATION 3.14 CONSTANT T)
 (setf (get test 'approximation) nil) @result{}  NIL
 (symbol-plist test) 
@result{}  (ERROR-RANGE NOTICEABLE APPROXIMATION NIL CONSTANT T)
 (get test 'approximation) @result{}  NIL
 (remprop test 'approximation) @result{}  @i{true}
 (get test 'approximation) @result{}  NIL
 (symbol-plist test)
@result{}  (ERROR-RANGE NOTICEABLE CONSTANT T)
 (remprop test 'approximation) @result{}  NIL
 (symbol-plist test)
@result{}  (ERROR-RANGE NOTICEABLE CONSTANT T)
 (remprop test 'error-range) @result{}  @i{true}
 (setf (get test 'approximation) 3) @result{}  3
 (symbol-plist test)
@result{}  (APPROXIMATION 3 CONSTANT T)
@end example

@subsubheading  Side Effects::

The @i{property list} of @i{symbol} is modified.

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@subsubheading  See Also::

@ref{remf}
, 
@ref{symbol-plist}

@subsubheading  Notes::

@i{Numbers} and @i{characters} are not recommended for use as
@i{indicators} in portable code since @b{remprop} tests with
@b{eq} rather than @b{eql}, and consequently the effect of
using such @i{indicators} is @i{implementation-dependent}.  
Of course, if you've gotten as far as needing to remove such a
@i{property}, you don't have much choice---the time to have been
thinking about this was when you used @b{setf} of @b{get} to
establish the @i{property}.

@node boundp, makunbound, remprop, Symbols Dictionary
@subsection boundp                                                           [Function]

@code{boundp}  @i{symbol} @result{}  @i{generalized-boolean}

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{generalized-boolean}---a @i{generalized boolean}.

@subsubheading  Description::

Returns @i{true} if @i{symbol} is @i{bound};
otherwise, returns @i{false}.

@subsubheading  Examples::

@example
 (setq x 1) @result{}  1
 (boundp 'x) @result{}  @i{true}
 (makunbound 'x) @result{}  X
 (boundp 'x) @result{}  @i{false}
 (let ((x 2)) (boundp 'x)) @result{}  @i{false}
 (let ((x 2)) (declare (special x)) (boundp 'x)) @result{}  @i{true}
@end example

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@subsubheading  See Also::

@ref{set}
,
@ref{setq}
,
@ref{symbol-value}
,
@ref{makunbound}

@subsubheading  Notes::

The @i{function} @b{bound} determines only whether a @i{symbol} has a
value in the @i{global environment}; any @i{lexical bindings}
are ignored.

@node makunbound, set, boundp, Symbols Dictionary
@subsection makunbound                                                       [Function]

@code{makunbound}  @i{symbol} @result{}  @i{symbol}

@subsubheading  Arguments and Values::

@i{symbol}---a @i{symbol}

@subsubheading  Description::

Makes the @i{symbol} be @i{unbound},
regardless of whether it was previously @i{bound}.

@subsubheading  Examples::

@example
 (setf (symbol-value 'a) 1)
 (boundp 'a) @result{}  @i{true}
 a @result{}  1
 (makunbound 'a) @result{}  A
 (boundp 'a) @result{}  @i{false}
@end example

@subsubheading  Side Effects::

The @i{value cell} of @i{symbol} is modified.

@subsubheading  Exceptional Situations::

Should signal an error of @i{type} @b{type-error}
			      if @i{symbol} is not a @i{symbol}.

@subsubheading  See Also::

@ref{boundp}
, 
@ref{fmakunbound}

@node set, unbound-variable, makunbound, Symbols Dictionary
@subsection set                                                              [Function]

@code{set}  @i{symbol value} @result{}  @i{value}

@subsubheading  Arguments and Values:: 

@i{symbol}---a @i{symbol}.

@i{value}---an @i{object}.

@subsubheading  Description::

@b{set} changes the contents of the @i{value cell} of @i{symbol}
to the given @i{value}.

@example
(set @i{symbol} @i{value}) @equiv{} (setf (symbol-value @i{symbol}) @i{value})
@end example

@subsubheading  Examples::

@example
 (setf (symbol-value 'n) 1) @result{}  1
 (set 'n 2) @result{}  2
 (symbol-value 'n) @result{}  2
 (let ((n 3))
   (declare (special n))
   (setq n (+ n 1))
   (setf (symbol-value 'n) (* n 10))
   (set 'n (+ (symbol-value 'n) n))
   n) @result{}  80
 n @result{}  2
 (let ((n 3))
   (setq n (+ n 1))
   (setf (symbol-value 'n) (* n 10))
   (set 'n (+ (symbol-value 'n) n))
   n) @result{}  4
 n @result{}  44
 (defvar *n* 2)
 (let ((*n* 3))
   (setq *n* (+ *n* 1))
   (setf (symbol-value '*n*) (* *n* 10))
   (set '*n* (+ (symbol-value '*n*) *n*))
   *n*) @result{}  80
  *n* @result{}  2
 (defvar *even-count* 0) @result{}  *EVEN-COUNT*
 (defvar *odd-count* 0) @result{}  *ODD-COUNT*
 (defun tally-list (list)
   (dolist (element list)
     (set (if (evenp element) '*even-count* '*odd-count*)
          (+ element (if (evenp element) *even-count* *odd-count*)))))
 (tally-list '(1 9 4 3 2 7)) @result{}  NIL
 *even-count* @result{}  6
 *odd-count* @result{}  20
@end example

@subsubheading  Side Effects::

The @i{value} of @i{symbol} is changed.

@subsubheading  See Also::

@ref{setq}
, 
@ref{progv}
, 
@ref{symbol-value}

@subsubheading  Notes::

The function @b{set} is deprecated.

@b{set} cannot change the value of a @i{lexical variable}.

@node unbound-variable,  , set, Symbols Dictionary
@subsection unbound-variable                                           [Condition Type]

@subsubheading  Class Precedence List::
@b{unbound-variable},
@b{cell-error},
@b{error},
@b{serious-condition},
@b{condition},
@b{t}

@subsubheading  Description::

The @i{type} @b{unbound-variable} consists of @i{error} @i{conditions}
that represent attempts to @i{read} the @i{value} of an @i{unbound variable}.

The name of the cell (see @b{cell-error}) is the @i{name} of the 
@i{variable} that was @i{unbound}.

@subsubheading  See Also::

@ref{cell-error-name}

@c end of including dict-symbols

@c %**end of chapter