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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- Generated by Swindle/html (http://www.barzilay.org/Swindle/) -->
<html>
<head>
<title>Documentation for 'swindle/tiny-clos.ss'</title>
</head>
<body bgcolor="#C0C0FF" text="#000000" link="#B00000" vlink="#600000" alink="#FF0000">
<h1 align="center">Documentation for '<tt>swindle/tiny-clos.ss</tt>'</h1>
<hr>
<p>
This module is the core object system. It is a heavily hacked version
of the original Tiny-CLOS code from Xerox, but it has been fitted to
MzScheme, optimized and extended. See the source file for a lot of
details about how the CLOS magic is created.
</p>
<p>
[There is one difference between Swindle and Tiny-CLOS: the meta object
hierarchy is assumed to be using only single inheritance, or if there is
multiple inheritance then the built in meta objects should come first to
make the slots allocated in the same place. This should not be a
problem in realistic situations.]
</p>
<hr>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="166"><tt><b>???</b></tt></a></td>
<td align="right"> [value]</td>
</tr>
</table>
<pre> This is MzScheme's '<tt>unspecified</tt>' value which is used as the default
value for unbound slots. It is provided so you can check if a slot is
unbound.
</pre>
<h3>Low level functionality</h3>
<pre>(These functions should be used with caution, since they make shooting
legs in exotic ways extremely easy.)
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="167"><tt><b>(change-class! object new-class initargs ...)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> This operation changes the class of the given '<tt>object</tt>' to the given
'<tt>new-class</tt>'. The way this is done is by creating a fresh instance of
'<tt>new-class</tt>', then copying all slot values from '<tt>object</tt>' to the new
instance for all shared slot names. Finally, the new instance's set
of slots is used for the original object with the new class, so it
preserves its identity.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="168"><tt><b>(set-instance-proc! object proc)</b></tt></a></td>
<td align="right"> [syntax]</td>
</tr>
</table>
<pre> This function sets the procedure of an entity object. It is useful
only for making new entity classes.
</pre>
<h3>Basic functionality</h3>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="169"><tt><b>(instance? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="170"><tt><b>(object? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> These two are synonyms: a predicate that returns #t for objects that
are allocated and managed by Swindle.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="171"><tt><b>(class-of x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Return the class object of '<tt>x</tt>'. This will either be a Swindle class
for objects, or a built-in class for other Scheme values.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="172"><tt><b>(slot-ref obj slot)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Pull out the contents of the slot named '<tt>slot</tt>' in the given '<tt>obj</tt>'.
Note that slot names are usually symbols, but can be other values as
well.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="173"><tt><b>(slot-set! obj slot new)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Change the contents of the '<tt>slot</tt>' slot of '<tt>obj</tt>' to the given '<tt>new</tt>'
value.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="174"><tt><b>(set-slot-ref! obj slot new)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> An alias for '<tt>slot-set!</tt>', to enable using '<tt>setf!</tt>' on it.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="175"><tt><b>(slot-bound? object slot)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Checks if the given '<tt>slot</tt>' is bound in '<tt>object</tt>'. See also '<tt>???</tt>'
above.
</pre>
<hr>
<a name="176"><h2>Singleton and Struct Specifiers</h2></a>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="177"><tt><b>(singleton x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Returns a singleton specification. Singletons can be used as type
specifications that have only one element in them so you can
specialize methods on unique objects.
This is actually just a list with the symbol '<tt>singleton</tt>' in its head
and the value, but this function uses a hash table to always return
the same object for the same value. For example:
=> (singleton 1)
(singleton 1)
=> (eq? (singleton 1) (singleton 1))
#t
but if the input objects are not '<tt>eq?</tt>', the result isn't either:
=> (eq? (singleton "1") (singleton "1"))
#f
Only '<tt>eq?</tt>' is used to compare objects.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="178"><tt><b>(singleton? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Determines if something is a singleton specification (which is any
list with a head containing the symbol '<tt>singleton</tt>').
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="179"><tt><b>(singleton-value x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Pulls out the value of a singleton specification.
</pre>
<pre>Also note that MzScheme struct types are converted to appropriate
Swindle classes. This way, it is possible to have Swindle generic
functions that work with struct type specializers.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="180"><tt><b>(struct-type->class struct-type)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> This function is used to convert a struct-type to a corresponding
Swindle subclass of '<tt><struct></tt>'. See the MzScheme manual for details
on struct types.
</pre>
<h3>Common accessors</h3>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="181"><tt><b>(class-direct-slots class)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="182"><tt><b>(class-direct-supers class)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="183"><tt><b>(class-slots class)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="184"><tt><b>(class-cpl class)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="185"><tt><b>(class-name class)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="186"><tt><b>(class-initializers class)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Accessors for class objects (look better than using '<tt>slot-ref</tt>').
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="187"><tt><b>(generic-methods generic)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="188"><tt><b>(generic-arity generic)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="189"><tt><b>(generic-name generic)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="190"><tt><b>(generic-combination generic)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Accessors for generic function objects.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="191"><tt><b>(method-specializers method)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="192"><tt><b>(method-procedure method)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="193"><tt><b>(method-qualifier method)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="194"><tt><b>(method-name method)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="195"><tt><b>(method-arity method)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Accessors for method objects. '<tt>method-arity</tt>' is not really an
accessor, it is deduced from the arity of the procedure (minus one for
the '<tt>call-next-method</tt>' argument).
</pre>
<h3>Basic classes</h3>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="196"><tt><b><tt><class></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> This is the "mother of all classes": every Swindle class is an
instance of '<tt><class></tt>'.
Slots:
* direct-supers: direct superclasses
* direct-slots: direct slots, each a list of a name and options
* cpl: class precedence list (classes list this to <top>)
* slots: all slots (like direct slots)
* nfields: number of fields
* field-initializers: a list of functions to initialize slots
* getters-n-setters: an alist of slot-names, getters, and setters
* name: class name (usually the defined identifier)
* initializers: procedure list that perform additional initializing
See the '<tt>clos</tt>' documentation for available class and slot keyword
arguments and their effect.
</pre>
<pre> Instance of '<tt><class></tt>', subclass of '<tt><object></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="197"><tt><b><tt><top></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> This is the "mother of all values": every value is an instance of
'<tt><top></tt>' (including standard Scheme values).
</pre>
<pre> Instance of '<tt><class></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="198"><tt><b><tt><object></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> This is the "mother of all objects": every Swindle object is an
instance of '<tt><object></tt>'.
</pre>
<pre> Instance of '<tt><class></tt>', subclass of '<tt><top></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="199"><tt><b><tt><procedure-class></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of all procedures classes, both standard Scheme procedures
classes and entity (Swindle procedure objects) classes. (Note that
this is a class of *classes*).
</pre>
<pre> Instance of '<tt><class></tt>', subclass of '<tt><class></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="200"><tt><b><tt><entity-class></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of entity classes -- generic functions and methods. An
entity is a procedural Swindle object, something that you can apply as
a function but it is still a Swindle object. Note that this is the
class of entity *classes* not of entities themselves.
</pre>
<pre> Instance of '<tt><class></tt>', subclass of '<tt><procedure-class></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="201"><tt><b><tt><function></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of all applicable values: methods, generic functions, and
standard closures.
</pre>
<pre> Instance of '<tt><class></tt>', subclass of '<tt><top></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="202"><tt><b><tt><generic></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of generic functions: objects that contain method objects
and calls the appropriate ones when applied.
Slots:
* methods: a list of <method> objects
* arity: the generic arity (same for all of its methods)
* name: generic name
* combination: a method combination function or #f, see
'<tt>make-generic-combination</tt>' below for details
</pre>
<pre> Instance of '<tt><entity-class></tt>', subclass of '<tt><object></tt>', '<tt><function></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="203"><tt><b><tt><method></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of methods: objects that are similar to Scheme closures,
except that they have type specifiers attached. Note that in contrast
to Tiny CLOS, methods are applicable objects in Swindle -- they check
supplied argument types when applied.
Slots:
* specializers: a list of class (and singleton) specializers
* procedure: the function (never call directly!)
* qualifier: some qualifier tag, used when applying a generic
* name: method name
</pre>
<pre> Instance of '<tt><entity-class></tt>', subclass of '<tt><object></tt>', '<tt><function></tt>'.
</pre>
<h3>Convenience functions</h3>
<pre>
These are some convenience functions -- no new syntax, just function
wrappers for '<tt>make</tt>' with some class and some slot values. See '<tt>clos</tt>'
for a more sophisticated (and convenient) approach.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="204"><tt><b>(make-class direct-supers direct slots)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Creates a class object -- an instance of <class>.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="205"><tt><b>(make-generic-function [name/arity])</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Creates a generic function object -- an instance of <generic>. The
argument can specify name and/or arguments number.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="206"><tt><b>(make-method specializers procedure)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Creates a method object -- an instance of <method>, using the given
specializer list and procedure. The procedure should have a first
argument which is being used to access a '<tt>call-next-method</tt>' call.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="207"><tt><b>(no-next-method generic method [args ...])</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
<tr>
<td><a name="208"><tt><b>(no-applicable-method generic [args ...])</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> These two generic functions are equivalents to the ones in CL. The
first one is applied on a generic and a method in case there was no
next method and '<tt>call-next-method</tt>' was used. The second is used when
a generic was called but no matching primary methods were found. The
only difference is that in Swindle methods can be applied directly,
and if '<tt>call-next-method</tt>' is used, then '<tt>no-next-method</tt>' gets '<tt>#f</tt>' for
the generic argument.
</pre>
<hr>
<a name="209"><h2>Generics in the instance initialization protocol</h2></a>
<pre>The following generic functions are used as part of the protocol of
instantiating an instance, and some are used specifically to instantiate
class objects.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="210"><tt><b>(allocate-instance class initargs)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic function is called to allocate an instance of a class.
It is applied on the class object, and is expected to return the new
instance object of that class.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="211"><tt><b>(initialize instance initargs)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic is called to initialize an instance. It is applied on
the newly allocated object and the given initargs, and is not expected
to return any meaningful value -- only do some side effects on the
instance to initialize it. When overriding this for a some class, it
is not a good idea to skip '<tt>call-next-method</tt>' since it is responsible
for initializing slot values.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="212"><tt><b>(compute-getter-and-setter class slot allocator)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic is used to get a getter and setter functions for a given
slot. It is passed the class object, the slot information (a list of
a slot name and options), and an allocator function. The allocator is
a function that gets an initializer function and returns an index
position for the new slot. The return value should be a list of two
elements -- a getter and a setter functions.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="213"><tt><b>(compute-cpl class)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic is used to get the class-precedence-list for a class
object. The standard <class> object uses the '<tt>compute-std-cpl</tt>' (see
in the code) which flattens the class ancestors using a topological
sort that resolve ambiguities left-to-right.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="214"><tt><b>(compute-slots class)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic is used to compute all slot information for a given
class, after its precedence list has been computed. The standard
<class> collects information from all preceding classes.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="215"><tt><b>(compute-apply-method method)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic is used to compute the procedure that will get executed
when a method is applied directly.
</pre>
<hr>
<a name="216"><h2>Generics in the generic invocation protocol</h2></a>
<pre>These generics are used for invocation of generic functions. See the
code to see how this circularity is achieved.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="217"><tt><b>((compute-apply-generic generic) args ...)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic is used to compute the object (a closure) that is
actually applied to execute the generic call. The standard version
uses '<tt>compute-method</tt>' and '<tt>compute-apply-methods</tt>' below, and caches
the result.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="218"><tt><b>(compute-methods generic args)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> Computes the methods that should be applied for this generic
invocation with args. The standard code filters applicable methods
and sorts them according to their specificness. The return value is
expected to depend only on the types of the arguments (and values if
there are singleton specializers).
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="219"><tt><b>((compute-method-more-specific? generic) mthd1 mthd2 args)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> Get a generic and return a function that gets two methods and a list
of arguments and decide which of the two methods is more specific.
This decision should only be based on the argument types, or values
only in case of singletons.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="220"><tt><b>((compute-apply-methods generic methods) args ...)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> Gets a generic and returns a function that gets the given arguments
for this call. This function which it returns is the combination of
all given methods. The standard one arranges them by default using
the '<tt>call-next-method</tt>' argument that methods have. Swindle extends
this with qualified methods and applies '<tt>before</tt>', '<tt>after</tt>', and
'<tt>around</tt>' methods in a similar way to CLOS: first the '<tt>around</tt>' methods
are applied (and they usually call their '<tt>call-next-method</tt>' to
continue but can return a different value), then all the '<tt>before</tt>'
methods are applied (with no '<tt>call-next-method</tt>'), then all '<tt>primary</tt>'
methods as usual (remembering the return value), and finally the
'<tt>after</tt>' methods (similar to the '<tt>before</tt>', but in reverse specificness
order). If the generic has a '<tt>combination</tt>' slot value, then it is a
procedure that is used to combine the primary methods, but the
auxiliary ones are still applied in the same way. This is unlike CLOS
where the standard combinations run only '<tt>around</tt>' methods, and there
is generally more control with method combinations, but in Swindle
'<tt>compute-apply-methods</tt>' should be overridden for this. See
'<tt>make-generic-combination</tt>' for details about method combinations.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="221"><tt><b>(add-method generic method)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> This generic function is called to add a method to a generic function
object. This is an other change from the original Tiny CLOS where it
was a normal function.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="222"><tt><b>(((make-generic-combination keys...) generic) tail args)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> This function can be used to construct simple method combinations that
can be used with the '<tt>combination</tt>' slot of generic functions. The
combination itself is a function that gets a generic and returns a
function that gets a list of method/procedure pairs (for optimization
the method-procedures are pre taken) and the arguments and performs
the call -- but this is only interesting if there's any need to
implement a method combination directly, otherwise, the
'<tt>make-generic-combination</tt>' interface should allow enough freedom.
Note that when a method combination is used, '<tt>around</tt>', '<tt>before</tt>', and
'<tt>after</tt>' are called around the primary call as usual, but the primaries
are never called with a valid '<tt>call-next-method</tt>' argument.
The keyword arguments that can be taken determine the behavior of this
combination. Overall, it is roughly like a customizable version of a
fold operation on the method calls.
* :init
- The initial value for this computation. Defaults to null.
* :combine
- A function to be called on a method call result and the old value,
and produces a new value. The default is '<tt>cons</tt>', which with an
initial null value will collect the results into a reversed list.
* :process-methods
- A function that can be called on the initial list of
method/procedure pairs to change it -- for example, it can be
reversed to apply the methods from the least specific to the most
specific. No default.
* :process-result
- A function that can be called on the final resulting value to
produce the actual return value. For example, it can reverse back
a list of accumulated values. No default.
* :control
- If this parameter is specified, then the '<tt>:combine</tt>' argument is
ignored. The value given to '<tt>:control</tt>' should be a function of
four arguments:
1. a '<tt>loop</tt>' function that should be called on some new value and
some new tail;
2. a '<tt>val</tt>' argument that gets the current accumulated value;
3. a '<tt>this</tt>' thunk that can be called to apply the current method
and return its result;
4. a '<tt>tail</tt>' value that holds the rest of the method/procedure list
which can be sent to '<tt>loop</tt>'.
It should be clear now, that a '<tt>:control</tt>' argument can have a lot
of control on the computation, it can abort, change arbitrary
values and skip calling methods. Note that if it won't call
'<tt>loop</tt>' with an empty list, then a '<tt>:process-result</tt>' function will
not be used as well. See the pre-defined combinations in the
source code to see examples of using this function.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="223"><tt><b>generic-+-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="224"><tt><b>generic-list-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="225"><tt><b>generic-min-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="226"><tt><b>generic-max-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="227"><tt><b>generic-append-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="228"><tt><b>generic-append!-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="229"><tt><b>generic-begin-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="230"><tt><b>generic-and-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="231"><tt><b>generic-or-combination</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> These are all functions that can be used as a '<tt>combination</tt>' value for
a generic function. They work in the same way as the standard method
combinations of CL. Most of them do the obvious thing based on some
function to combine the result. The '<tt>begin</tt>' combination simply
executes all methods one by one and returns the last value, the '<tt>and</tt>'
and '<tt>or</tt>' combinations will call them one by one until a false or true
result is returned. The source of these can be used as templates for
defining more combinations.
</pre>
<h3>More class functionality</h3>
<pre>(In the following, a '<tt>class</tt>' can be a class, a singleton specifier, or a
struct type.)
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="232"><tt><b>(subclass? class1 class2)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Is '<tt>class1</tt>' a subclass of '<tt>class2</tt>'?
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="233"><tt><b>(instance-of? x class)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Checks if '<tt>x</tt>' is an instance of '<tt>class</tt>' (or one of its subclasses).
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="234"><tt><b>(class? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Determines whether '<tt>x</tt>' is a class.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="235"><tt><b>(specializer? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Determines whether '<tt>x</tt>' is a class, a singleton, or a struct-type.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="236"><tt><b>(more-specific? class1 class2 x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Is '<tt>class1</tt>' more specific than '<tt>class2</tt>' for the given value?
</pre>
<hr>
<a name="237"><h2>Swindle Customization Parameters</h2></a>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="238"><tt><b>*default-method-class*</b></tt></a></td>
<td align="right"> [parameter]</td>
</tr>
<tr>
<td><a name="239"><tt><b>*default-generic-class*</b></tt></a></td>
<td align="right"> [parameter]</td>
</tr>
<tr>
<td><a name="240"><tt><b>*default-class-class*</b></tt></a></td>
<td align="right"> [parameter]</td>
</tr>
<tr>
<td><a name="241"><tt><b>*default-entityclass-class*</b></tt></a></td>
<td align="right"> [parameter]</td>
</tr>
</table>
<pre> These parameters specify default classes for the many constructor
macros in '<tt>clos</tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="242"><tt><b>*default-object-class*</b></tt></a></td>
<td align="right"> [parameter]</td>
</tr>
</table>
<pre> This parameter contains a value which is automatically made a
superclass for all classes. Defaults to '<tt><object></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="243"><tt><b>*make-safely*</b></tt></a></td>
<td align="right"> [parameter]</td>
</tr>
</table>
<pre> Setting this parameter to #t will make Swindle perform sanity checks
on given initargs for creating an object. This will make things
easier for debugging, but also slower. Defaults to '<tt>#f</tt>'. Note that
the sanity checks are done in '<tt>initialize</tt>'.
</pre>
<hr>
<a name="244"><h2>Creating Instances</h2></a>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="245"><tt><b>(make class initargs ...)</b></tt></a></td>
<td align="right"> [generic]</td>
</tr>
</table>
<pre> Create an instance of '<tt>class</tt>', which can be any Swindle class (except
for some special top-level classes and built-in classes).
See the `Object Initialization Protocol' below for a description of
generic functions that are involved in creating a Swindle object.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="246"><tt><b>(rec-make (name class arg ...) ...)</b></tt></a></td>
<td align="right"> [syntax]</td>
</tr>
</table>
<pre> This is similar to:
(letrec ([name (make class arg ...)] ...)
(values name ...))
except that the names are first bound to allocated instances with no
initargs, and then they are initialized with all these bindings. This
is useful for situations where creating some instances needs other
instances as values. One sample usage is the way '<tt>defclass</tt>' makes the
class binding available for slot specifications like '<tt>:type</tt>'. Note
that this is a special form, which invokes '<tt>allocate-instance</tt>' and
'<tt>initialize</tt>' directly, so specializing '<tt>make</tt>' on some input will not
change the way '<tt>rec-make</tt>' works.
</pre>
<hr>
<a name="247"><h2>Built-in Classes</h2></a>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="248"><tt><b><tt><primitive-class></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of all built-on classes.
</pre>
<pre> Instance of '<tt><class></tt>', subclass of '<tt><class></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="249"><tt><b><tt><builtin></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The superclass of all built-in classes.
</pre>
<pre> Instance of '<tt><class></tt>', subclass of '<tt><top></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="250"><tt><b><tt><sequence></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> Instance of '<tt><primitive-class></tt>', subclass of '<tt><builtin></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="251"><tt><b><tt><mutable></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="252"><tt><b><tt><immutable></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="253"><tt><b><tt><improper-list></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="254"><tt><b><tt><pair></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="255"><tt><b><tt><mutable-pair></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="256"><tt><b><tt><immutable-pair></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="257"><tt><b><tt><list></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="258"><tt><b><tt><nonempty-list></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="259"><tt><b><tt><mutable-nonempty-list></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="260"><tt><b><tt><immutable-nonempty-list></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="261"><tt><b><tt><null></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="262"><tt><b><tt><vector></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="263"><tt><b><tt><char></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="264"><tt><b><tt><string-like></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="265"><tt><b><tt><mutable-string-like></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="266"><tt><b><tt><immutable-string-like></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="267"><tt><b><tt><string></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="268"><tt><b><tt><mutable-string></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="269"><tt><b><tt><immutable-string></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="270"><tt><b><tt><bytes></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="271"><tt><b><tt><mutable-bytes></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="272"><tt><b><tt><immutable-bytes></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="273"><tt><b><tt><path></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="274"><tt><b><tt><symbol></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="275"><tt><b><tt><keyword></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="276"><tt><b><tt><real-keyword></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="277"><tt><b><tt><boolean></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="278"><tt><b><tt><number></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="279"><tt><b><tt><exact></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="280"><tt><b><tt><inexact></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="281"><tt><b><tt><complex></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="282"><tt><b><tt><real></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="283"><tt><b><tt><rational></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="284"><tt><b><tt><integer></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="285"><tt><b><tt><exact-complex></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="286"><tt><b><tt><inexact-complex></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="287"><tt><b><tt><exact-real></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="288"><tt><b><tt><inexact-real></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="289"><tt><b><tt><exact-rational></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="290"><tt><b><tt><inexact-rational></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="291"><tt><b><tt><exact-integer></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="292"><tt><b><tt><inexact-integer></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="293"><tt><b><tt><end-of-file></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="294"><tt><b><tt><port></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="295"><tt><b><tt><input-port></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="296"><tt><b><tt><output-port></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="297"><tt><b><tt><stream-port></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="298"><tt><b><tt><input-stream-port></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="299"><tt><b><tt><output-stream-port></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="300"><tt><b><tt><void></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="301"><tt><b><tt><box></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="302"><tt><b><tt><weak-box></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="303"><tt><b><tt><regexp></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="304"><tt><b><tt><byte-regexp></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="305"><tt><b><tt><parameter></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="306"><tt><b><tt><promise></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="307"><tt><b><tt><exn></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="308"><tt><b><tt><exn:fail></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="309"><tt><b><tt><exn:break></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="310"><tt><b><tt><semaphore></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="311"><tt><b><tt><hash-table></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="312"><tt><b><tt><subprocess></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="313"><tt><b><tt><thread></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="314"><tt><b><tt><syntax></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="315"><tt><b><tt><identifier-syntax></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="316"><tt><b><tt><namespace></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="317"><tt><b><tt><custodian></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="318"><tt><b><tt><tcp-listener></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="319"><tt><b><tt><security-guard></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="320"><tt><b><tt><will-executor></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="321"><tt><b><tt><struct-type></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="322"><tt><b><tt><inspector></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="323"><tt><b><tt><pseudo-random-generator></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="324"><tt><b><tt><compiled-expression></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
<tr>
<td><a name="325"><tt><b><tt><unknown-primitive></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> These classes represent built-in objects. See the class hierarchy
below for a complete description of the relations between these
classes.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="326"><tt><b><tt><struct></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> Instance of '<tt><primitive-class></tt>', subclass of '<tt><builtin></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="327"><tt><b><tt><opaque-struct></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> These are also classes for built-in objects, but they are classes for
MzScheme structs -- which can be used like Swindle classes since they
will get converted to appropriate Swindle subclasses of '<tt><struct></tt>'.
'<tt><opaque-struct></tt>' is a class of structs that are hidden -- see the
documentation for '<tt>struct-info</tt>' and the '<tt>skipped?</tt>' result. Note that
structs can be used as long as they can be inspected -- otherwise, we
can't even know that they are structs with '<tt>struct?</tt>' (this means that
<opaque-struct> can only appear in the cpl of a struct class that
inherits from a struct which is not under the current inspector).
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="328"><tt><b><tt><procedure></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of all Scheme procedures.
</pre>
<pre> Instance of '<tt><procedure-class></tt>', subclass of '<tt><builtin></tt>', '<tt><function></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="329"><tt><b><tt><primitive-procedure></tt></b></tt></a></td>
<td align="right"> [class]</td>
</tr>
</table>
<pre> The class of all primitive MzScheme procedures.
</pre>
<pre> Instance of '<tt><procedure-class></tt>', subclass of '<tt><procedure></tt>'.
</pre>
<table width="100%" cellpadding="3" cellspacing="0" border="1" vspace="3" frame="border" rules="rows" bgcolor="#D0A0D0" bordercolor="#806080">
<tr>
<td><a name="330"><tt><b>(builtin? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="331"><tt><b>(function? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="332"><tt><b>(generic? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
<tr>
<td><a name="333"><tt><b>(method? x)</b></tt></a></td>
<td align="right"> [procedure]</td>
</tr>
</table>
<pre> Predicates for instances of <builtin>, <function>, <generic>, and
<method>.
</pre>
<hr>
<a name="334"><h2>Class Hierarchy</h2></a>
<pre>In the following, every class's class is specified after a colon. Also,
some classes appear in more than once place due to multiple-inheritance.
<top> : <class>
<object> : <class>
<class> : <class>
<procedure-class> : <class>
<entity-class> : <class>
<primitive-class> : <class>
<generic> : <entity-class>
<method> : <entity-class>
<function> : <class>
<generic> : <entity-class>
<method> : <entity-class>
<procedure> : <procedure-class>
<primitive-procedure> : <procedure-class>
<builtin> : <class>
<sequence> : <primitive-class>
<improper-list> : <primitive-class>
<pair> : <primitive-class>
<mutable-pair> : <primitive-class>
<immutable-pair> : <primitive-class>
<nonempty-list> : <primitive-class>
<mutable-nonempty-list> : <primitive-class>
<immutable-nonempty-list> : <primitive-class>
<list> : <primitive-class>
<nonempty-list> : <primitive-class>
<mutable-nonempty-list> : <primitive-class>
<immutable-nonempty-list> : <primitive-class>
<null> : <primitive-class>
<vector> : <primitive-class>
<string-like> : <primitive-class>
<string> : <primitive-class>
<mutable-string> : <primitive-class>
<immutable-string> : <primitive-class>
<bytes> : <primitive-class>
<mutable-bytes> : <primitive-class>
<immutable-bytes> : <primitive-class>
<path> : <primitive-class>
<mutable> : <primitive-class>
<mutable-pair> : <primitive-class>
<mutable-nonempty-list> : <primitive-class>
<mutable-string-like> : <primitive-class>
<mutable-string> : <primitive-class>
<mutable-bytes> : <primitive-class>
<vector>
<box>
<immutable> : <primitive-class>
<immutable-nonempty-list> : <primitive-class>
<immutable-pair> : <primitive-class>
<immutable-string-like> : <primitive-class>
<immutable-string> : <primitive-class>
<immutable-bytes> : <primitive-class>
<path> : <primitive-class>
<char> : <primitive-class>
<symbol> : <primitive-class>
<keyword> : <primitive-class>
<real-keyword> : <primitive-class>
<boolean> : <primitive-class>
<number> : <primitive-class>
<complex> : <primitive-class>
<exact-complex> : <primitive-class>
<inexact-complex> : <primitive-class>
<real> : <primitive-class>
<exact-real> : <primitive-class>
<inexact-real> : <primitive-class>
<rational> : <primitive-class>
<integer> : <primitive-class>
<exact-rational> : <primitive-class>
<inexact-rational> : <primitive-class>
<exact-integer> : <primitive-class>
<inexact-integer> : <primitive-class>
<exact> : <primitive-class>
<exact-complex> : <primitive-class>
<exact-real> : <primitive-class>
<exact-rational> : <primitive-class>
<exact-integer> : <primitive-class>
<inexact> : <primitive-class>
<inexact-complex> : <primitive-class>
<inexact-real> : <primitive-class>
<inexact-rational> : <primitive-class>
<inexact-integer> : <primitive-class>
<end-of-file> : <primitive-class>
<port> : <primitive-class>
<input-port> : <primitive-class>
<input-stream-port> : <primitive-class>
<output-port> : <primitive-class>
<output-stream-port> : <primitive-class>
<stream-port> : <primitive-class>
<input-stream-port> : <primitive-class>
<output-stream-port> : <primitive-class>
<void> : <primitive-class>
<box> : <primitive-class>
<weak-box> : <primitive-class>
<regexp> : <primitive-class>
<byte-regexp> : <primitive-class>
<parameter> : <primitive-class>
<promise> : <primitive-class>
<exn> : <primitive-class>
<exn:fail> : <primitive-class>
<exn:break> : <primitive-class>
<semaphore> : <primitive-class>
<hash-table> : <primitive-class>
<subprocess> : <primitive-class>
<thread> : <primitive-class>
<syntax> : <primitive-class>
<identifier-syntax> : <primitive-class>
<namespace> : <primitive-class>
<custodian> : <primitive-class>
<tcp-listener> : <primitive-class>
<security-guard> : <primitive-class>
<will-executor> : <primitive-class>
<inspector> : <primitive-class>
<pseudo-random-generator> : <primitive-class>
<compiled-expression> : <primitive-class>
<unknown-primitive> : <primitive-class>
<procedure> : <procedure-class>
<primitive-procedure> : <procedure-class>
<struct> : <primitive-class>
<opaque-struct> : <primitive-class>
... struct type classes ...
</pre>
<hr>
<a name="335"><h2>Object Initialization Protocol</h2></a>
<pre>This is the initialization protocol. All of these are generic
functions (unlike the original Tiny CLOS). See the individual
descriptions above for more details.
make
allocate-instance
initialize
class initialization only:
compute-cpl
compute-slots
compute-getter-and-setter
method initialization only:
compute-apply-method
add-method
compute-apply-generic
compute-methods
compute-method-more-specific?
compute-apply-methods
</pre>
</body>
</html>
<!-- Generated by Swindle/html -->
|