Common Lisp package code and symbol conversions Ron Fischer [This document is for developers only. It is not intended to be part of any external software release.] The package code can behave mighty strangely if not operated "just so." Please read this document carefully. Loading The package code is now loaded in the full.sysout. It lives in {Eris}Library> on CMLSYMBOL.DCOM CMLPACKAGE.DCOM Initializing Packages, as you might expect, must be bootstrapped carefully. At its simplest, initialization is accomplished by calling just one function: (package-init t) simple startup (package-init &optional (convert? nil)) [Function] Clear, make structures of, initialize & convert symbols (if convert? is t) to, and enable use of the symbol package system. On a DandeTiger this takes about 25 minutes. The bootstrap actually takes place in three steps. The first one creates all the package structure needed. The second passes over all the atoms in the sysout to "tag" them with packages. The third enables the package world. step 1: make system packages (package-make) [Function] Create, but do not fill with symbols, the base packages that need to exist. Also enables the package qualifier characters in the readtables and saves the old definitions of \READ.SYMBOL and \MKATOM. step 2: convert existing symbols (package-hierarchy-init &optional (convert? nil)) [Function] Fill all the initial system packages with their proper symbols, moving litatoms into appropriate places and such. If convert? is non-nil then symbols whose pnames have fake package qualifiers, like cl:length, will be converted IN PLACE to remove the qualifier. If conversion takes place you cannot fully disable the package system. step 3: enable package system, remove old hacks The third part of the bootstrap enables the use of packages by the reader, printer and friends. This involves redefining \MKATOM and \READ.SYMBOL. Also, if *package* is set to nil things will not go well. Please use package-enable and package-disable to start and stop, as these fellows know what they're doing. These faithful functions are availible on a menu by calling package-menu. (package-enable &optional (package *interlisp-package*)) [Function] Turn on the package system, making package the current one and redefining \READ.SYMBOL and \MKATOM appropriatly. (package-disable) [Function] Turn off the package system and restore the old definitions of \READ.SYMBOL and \MKATOM. After disabling, symbols interned under the package system will not be eq to symbols of the same name reread. (package-menu) [Function] Make a menu that allows turning the package system on or off without using the reader. (package-hacks-disable) [Function] Eliminates package simulation hacks when loading over an old sysout. These hacks cannot be re-enabled. (pkgconvert-enable) [Function] Enables a change in the behavior of the function \\READ.SYMBOL (using the function check-symbol-namestring), which converts symbols being read based on their "looking like" a pacakge prefixed symbol name. "Looking like" is defined by a table in the global litatom-package-conversion-table. litatom-package-conversion-table [Variable] a global variable containing a list of clauses used by the functions package-hierarchy-init and check-symbol-namestring to determine if a symbol "looks like" is trying to be package qualified. The list contains clauses with the following structure: (prefix-string list-of-exception-strings package-name-string where) prefix-string - string containing the prefix of symbols which this clause converts, eg "CL:" list-of-exception-strings - list of strings naming symbols which this clause should leave alone, eg ("CL:FLG") package-name-string - string containing the name of the package that symbols converted by this clause should wind up in, eg "LISP" where - either :INTERNAL or :EXTERNAL, indicates whether symbols converted by this clause should be external or internal in their package. The initial value of this variable is: ( ("CL:" ("CL:FLG" "CL:MAKE-SYMBOL" "CL:COPY-SYMBOL" "CL:INTERN" "CL:MAKE-KEYWORD" "CL:GENTEMP" "CL:KEYWORDP") "LISP" :external) (":" nil "KEYWORD" :external) ) Notes & cautions The read functions may return strings if you use package qualifier syntax and *package* does not contain a package. This is part of debugging code that Bill put into them. Beware especially of making *package* NIL without calling package-disable. The list of conversion clauses is searched linearly, hence longer prefixes should come before shorter ones with the same chars in them, ie put a clause for "CL::" before one for "CL:". Missing features Cannot be placed early into loadup due to dependancies on CL files. Apropos (and other Interlisp litatom functions) are not redefined to operate with packages. Performance There have been some small improvements since these timings were taken. FILEDATES : (("21-Jul-86 14:12:17" . {ERIS}CML>LAB>CMLPACKAGES.;129)) Testing symbol / litatom creation. Old array package. There are 6 random symbols made (new ones). intern is a factor of 16 slower, conses heavily, makes 3 strings for each call. 85#(TIMEALL (TIME.MKATOM)) Elapsed Time = .336 seconds SWAP time = .32 seconds CPU Time = .016 seconds PAGEFAULTS = 8 LISTP 9 86#(TIMEALL (TIME.INTERN)) Elapsed Time = .449 seconds SWAP time = .188 seconds CPU Time = .261 seconds PAGEFAULTS = 5 LISTP STRINGP 423 18 Breakdown spy graph follows: глџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџ§џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрпяџўоƒяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрмХvvЮя~ьяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрлm­ЖжяoџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрмmЌ>кя~эЏџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрлmнўмя~эЯџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџриЅо6ояэяџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџїџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрР`Р`Рџџџџџџ№?џџџџџџџџџџџџџџџџџџрРџџџџџџ№?џџџџџџџџџџџџџџџџџџрР`00`Р~ zLќА?œс":>“Щ3№ ЦD—!рРb CR$А1R’Ђ pд‰-K!)JдЁ`Рb ˆCа$А1R’Ђ №є /CJєЁ`Рф ˆsж'Пџџџђ\т•щМѓ /3џџџџ hЪєЁрРd Bв$А2єЇШ АА‰+  (_ДЁ`Р h ˆBв$А42”H 0Д‰+K@ )"QДЁ`Рџџџџџџџџр0h<zN$А42”H:>“Щ3@ц"Q—=рРџџџџџџџџрР`00`Р``00`Р`џџџџџџ№?џџџџџџџџџџџџџџџџџџрР`џџџџџџ№?џџџџџџџџџџџџџџџџџџрР```Р`€`Р``Р``РcNp ŒxШ`0џџџџџџџќџџџџџџР`Р”€ЉHŽх(`РџџџџџџџќџџџџџџР`Р€ЉHх(c` Р`Р!ЉKЬUy(l~#2‘#ьРŒ™ў:LР`Р@љH%e(рbЃЙJвЗ @н$IRР`Р „H$e(lџ€b#љJђП @ў IаР`Р ѓp $xЯcф^JђЋЯџџџќ€ЎNжР`Р`Рd‰YJЗы €­JвР`Чџџџџџџџ`0h‰JДc ŒЄIвР`Чџџџџџџџ#`h 3Р”cь ŒXI:NР`Ц#`` Р`ЦC`€` Р`ЦC``џџџџџџџќџџџџџџР`Цƒ`џџџџџџџќџџџџџџР`Цƒ`DDDD`Ц`DDDD`ЦџџџџџџџџрР`Цџџџџџџџџр0=`Ц BЁД`ЦBЁє`Ц„9P`Ц!P`ЦHЁ`ЦHН`Ц `Ц `Ц@DDDD`Ц@DDDD`Ц€`Ц€џџџќ`ЦџџџќDDDD@`Ц @`ЦџџџџџўџџџџџџџџџџќР'=ьР8Ц`Цџџџџџўџџџџџџџџџџќ @TЁ @‚Ѕ)`Ц @TЁ @BЅ @`Ц <€W9Яџџџє€BЙm@`Ц Ь€§! €'щ)`Ц  ŒЁ $e)`Ц ŒН dц@`Ц p @`Ц  € `Ц@ џџџќ`Ц@ џџџќDDDD@`Ц€ ``Ц€ €`ЦcЩqžfЦ>gйР2\g˜ `Ц”)JP–)0‘% JR”$L0`Ц J–+p% BR„%\РџџџџџџРDDDDD@`Ц&€Щqœ—џџџўM|%Я2\g$яџџџџџџР`Ц3€)HP–)P%@ R%\Р Р`ЦУ”)JP–)а‘% JR”$L8 Р@`ЦcЦqžfЦža 1œg˜  Р@`Ц0F € Р`ЦР& p Р`Ц Р@`Ц 0 € Р@`ЦF0—§Щ!Р ` ŒяњRРР@œc`ЦЩHб!-N RЅBZР% AR”`ЦKXё!/Wp  BЁB^РD !R…€`ўMhё9Я;Р Ь„™Тr^РH@!\Ж€`ЦIHБ!KW@ =ХBVџџџџ є”`ЦIHБ!+@ eBVР! 2”`Цц0‘=)  ЬYтA’Р|Р 2s`Ц  Р@`Цџџџџџўџџџџџџџџџџќ Р`Цџџџџџўџџџџџџџџџџќ Р`Ц Р@`Ц Р@`Ц Р`Ц Р`Ц Р@`Ц Р@`ЦџџџџџџР`Ц€џџџџџџР`Ц€`Ц@`Ц@`Ц `Ц џџџџџјDD`ЦџџџџџјDD`Ц `Ц `Ц `Ц žI y˜<`Ц U BX `Ц œе B8`Ц ‚е q˜`Ц ЊЊЊЊ€ЊЊЊЊЊЊЊЈ‚П @_џџџс`Ц€UUUUUUUUUUUT,’Ѓ BX$`Ц€ ЊЊЊЊ€ЊЊЊЊЊЊЊЈMЬ#цy˜˜`Ц@UUUUUUUUUUUTŒ`Ц@ € ( `Ц @ `Ц џџџџџџџџџј € ( `Цџџџџџџџџџј@ `Ц € ( џџџџџјDD`Ц@@џџџџџј`Ц € (€ ЊЊЊЊЊ `Ц@UUUUUP`Ц € ( ЊЊЊЊЊ `Ц@ UUUUUP`Ц € (  `Ц@ P`Цƒ € (@  `Цƒ@€P`ЦC € (  `ЦC@P`Ц# € (  `Ц#@P`Ц € (0  `ЧџџџџџџџcчK€dcЦ@fžF`?ЩI„џ”@P`Чџџџџџџџ ”j@”w)@˜ ЉPк€Њ )jJ$(€  `Р z@„)BИЈP§J€ )z $P`Р#Тz^bЋЩAпџџџы.œЊџџџўВр Щz '*  `РZ@+)BИљ­_ IZ$P`Р”Z@‘#)@˜ )PŠ€Ђ )ZQ$(€  `РcK€a#Цx&^B` &I‘'”`P`Р € (  `Р@P`Р € (  `Р@P`Р € (  `Р@РP`Р € (  `Р@P`Р € (  `Р@P`Р € (  `Р@P`Р € (Р  `Р@ P`Р € (  `Р@P`Рџџџџџџџџџј € (  `Рџџџџџџџџџј@P`Р € (ŠѓqŒ `Р@EJRP`Р ЊЊЊЊ€ЊЊЊЊЊЊЊЈ*…J `РUUUUUUUUUUUT'…rкP`Р ЊЊЊЊ€ЊЊЊЊЊЊЊЈ $€OвR `РUUUUUUUUUUUTD€HЪRP`Р C(ЩЬ `Р P`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р  `РP`Р ЊЊЊЊЊ `РUUUUUP`Р ЊЊЊЊЊ `РUUUUUP`Р`Р`џџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџрџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџџр.ј.HH((TERMINAL  TIMESROMAN  TIMESROMAN  TIMESROMAN GACHA 0 in@ Ž' <aу Ш!1 vа0z    &‰8 J  ? J% X i 1 —   њ  JK i   f'A2 N s œD\ HPЕ"""44"""3` BMOBJ.GETFN3I‚0zК