home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
FREQ_QA
/
LISP_1.ZIP
/
00000147.TXT
Wrap
Text File
|
1994-03-15
|
66KB
|
1,171 lines
Uï∞ü∞WVìF≡PÜ(αâ─ìF≡PÜ0αâ─Ä┬ï╪ï√îF÷&èO╕╙αëF°&ïGï╚&ïG║ï≥Ö≈■╛<ï┴ï╩ï╨ï┴ëå⌠■ï┬Ö≈■ï╞ï╩≈«⌠■ï≡±╗Ä$6ë₧·■îåⁿ■&╟ ╗~Ä&6ë₧÷■îå°■&ïÄF÷&9EtLÉΦ2╕pP3└P ╢°■ ╢÷■Üαâ─ÄF÷&ïE─₧÷■&ëÄ(6&â>ptÄ*6&â>vt
Ü£┘ÜT┘ÄF÷& E╟F·Ä,6&â>Θ▀ë~⌠╟F■╕⌠╣ùëå≡■ëÄ≥■ëvⁿïFⁿ─₧≡■&─^■ë₧∞■îåε■&9~ΘÖï├î┬ì~öï≤Ä┌╣-≤ÑñèFó*ΣàF°tz8f╥tèF╥─^⌠&8GuiÇ~╤tèF╤─^⌠&8GuWïFⁿ+Fö;Fû| ïFⁿ9Föuâ~ût÷Fÿ@t8èFú─^⌠&8Gt,ïFⁿ+Fö;Fû~<Ä.6&â>t0─^⌠&èG─₧≡■&─ïv■&ê@âF■[ F·ïF·Ä,6&9~Θ2 Θ⌡èFú─^⌠&8Gu÷FÖu╙ïv·Θzïv·─₧·■&ë7╗XÄ06ë₧Φ■îåΩ■&─?& ╡& ╡Ü£┘â─ìDP─₧Φ■&─& ╖╥& ╖╨Ü┌α â─Ä26&â>|uÄ46&╟zÄ66&╟¬─^⌠&èGï╚ï╞╗[≈δï╪Ä86&─>⌠&êIÄ86&─⌠ï°&Ça■ÉΦÇ~¿t;èF¿*ΣP─₧Φ■&─& ╖╓& ╖╘Ü┌α â─Ä46&╟zèF¿*ΣPܵ┘â─ΘvÄ:6&í▓&░uΘdÄ26&â>|uÄ46&╟z─₧Φ■&─& ╖┌& ╖╪Ü┌α â─Ä<6& 6¿& 6ªÜ`┘â─Üû┘ܼα ╕PÜ,╣â─Ä>6&íF&ïHëåΣ■ëûµ■╨t8 ╢µ■Pìå■■PÜ╝
αâ─÷|ìF▒Pìå■■PÜh
αâ─ìå■■PÜ╠┘â─Ä:6& 6▓& 6░ìå■■PÜ╝
αâ─÷|ìF▒Pìå■■PÜh
αâ─ìå■■PÜ╠┘â─Ä*6&â>vtܼα Ü«┘ÜB┘Ül┘░P░PÜ╢] â─Ä@6& 6á& 6₧Ü`┘â──₧Φ■&─& ╖▐& ╖▄Ü┌α â─╕pPÜ╒ â─ÄB6&úR&ëT─₧·■&ë7ïF₧ÄD6&úïFáÄF6&ú Üf┘─₧·■&ë7÷FÿtÄH6&Ç&│ÄJ6&╞ƒδÉÄH6&Ç│ÇÄJ6&╞ƒèfÖ%=└≈╪ÄL6&úïF₧ÄD6&úïFáÄF6&ú ^_ïσ]╦ÉUï∞ü∞▐VÄN6& 6 & 6ìår PÜ╝
αâ─ÄN6& 6 & 6ìå" PÜ╝
αâ─╕vPìår PÜh
αâ─╕éPìå" PÜh
αâ─ìFαPìår PÜXXαâ─@uΘNìF┬Pìå" PÜXXαâ─@uQÄN6& 6 & 6ìå" PÜ╝
αâ─ÄP6& 6(& 6&ìå" PÜh
αâ─ìF┬Pìå" PÜXXαâ─@uΘτïF≥ïV⌠9V╓vΘ┘r9F╘vΘ╧â~≡}Θ╞ â~ε[sΘ╗╕ÇPìår PܬCαâ─ï≡â■ uΘƒ╞år ╕Pìår PVÜj3αâ─ 6d 6bìår PÜ°
αâ─└ud╕pP╕~╣ùQPVÜj3αâ─ìF■PïFε-ÇPÄ86& 6÷& 6⌠VÜPαâ─ÄR6&╟╕[ÖRPïFεïV≡-Çâ┌RPÜ║αÄ,6&úVÜ╚2αâ─^ïσ]╦Uï∞ü∞╘WV+└PPÜ(αâ─ëFⁿëV■ÄN6& 6 & 6ìFäPÜ╝
αâ─ÄN6& 6 & 6ìå4 PÜ╝
αâ─╕ÄPìFäPÜh
αâ─╕ÜPìå4 PÜh
αâ─ìF╘Pìå4 PÜXXαâ─@uQÄN6& 6 & 6ìå4 PÜ╝
αâ─ÄP6& 6(& 6&ìå4 PÜh
αâ─ìF╘Pìå4 PÜXXαâ─@uΘ3ïFµïVΦ9V■w1r9Fⁿs*ëF≥ëV⌠ëF÷ëV°Ä06&─X& ╖Γ& ╖αÜ┌α â─δÉïFⁿïV■ëF≥ëV⌠ëF÷ëV°╕ÇP╕üPìFäPܬCαâ─ï≡â■ uΘ╞╕P 6d 6bVÜh4αâ─╕pP╕~╣ùQPVÜh4αâ─3 ╗Ä,6ë₧0 îå2 &9?~Dëvⁿ3╔ëN■ï±╕ùÄ╪─⌠▐â├ë₧, îå. &÷Gt&÷u&Çg■â╞[G─₧0 &9?╨ïvⁿìF·P╕[─₧0 &≈/PÄ86& 6÷& 6⌠VÜWαâ─VÜ╚2αâ─ìF≥PìFäPÜ«Rαâ─^_ïσ]╦ÉUï∞â∞TWVÄN6& 6 & 6ìF¼PÜ╝
αâ─╕ªPìF¼PÜh
αâ─╕▓PìF¼PÜ¿αâ─ï≡ëV■╨t)ïF■PV╣Q╣pQ╣~║ùRQï°Üxαâ─WVܪαâ─^_ïσ]╦ÉUï∞â∞"WVìFΦPÜ(αâ─ìFΦPÜ0αâ─ï°ëVε╕<Ä┬&≈m&EëF⌠ÄT6&╟ ÄFε&èM╕╙αëF≡╟F÷╕& E╟F·ë~∞Ä,6&íëFµ└Θ╔Ä86&í⌠&ï÷ï╪ëV■Ä$6&íëFΣïN·╕╘Ä╪9NΣuΘïâ~t ÄF■&÷u|─v∞&èDÄF■&8Gtl&èG
*ΣàF≡ta&èG:êFΓ
└tÄFε&èD8FΓuJÄF■&èG9êFα
└tÄFε&èD8Fαu0ÄF■ìwⁿ&ïëF▐;F⌠ÄF■&÷@t┐δï°+~⌠9~÷~ë~÷ëâ├[A9Nµ~Θa ü~÷í}Θ╡╕á+F⌠ëF≥╤f≡â~≡@~╟F≡3╔9NµΘöÄ86&í⌠&ï÷>ï╪ëV■ï~∞╕╘Ä╪â~tÄF■ìw╞&÷uZÄF■ìw╨&è*ΣàF≡tJÄF■&èêFΓ
└t ÄFε&8Eu4ÄF■ìw &èêFα
└t ÄFε&8EuÄF■ìw┬&ïF≥ëF°;F÷}ëF÷ëâ├[A9Nµïü~÷áïV÷δ║áâ~tâ·}║ï┬^_ïσ]╦Éear all searchUï∞ü∞╢WV╕╚Pܬαâ─ï≡ëV■╨t5╕╨PÜ6 â─└u$ïF■PVìåV PÜ╝
αâ─ìåV PÜ┘â─δÉ╞åV ╕▄PìåV PÜh
αâ─ìF╓PìåV PÜXXαâ─└t$ìåV P╕ΦP╕╠(PÜ─αâ─╕·PÜ≤αâ─ï~ΣW╕PÜαâ─ï≡ëV·╨u╕P╕╠(PÜ─αâ─╕·PÜ≤αâ─╕P╕-PìåV PÜ26 â─
ëFⁿëV■╨u$ìåV P╕0P╕╠(PÜ─αâ─╕·PÜ≤αâ─ v■ vⁿW╕P v·VÜαâ─;╟t2ìåV P╕LP╕╠(PÜ─αâ─ v■ vⁿܪαâ─╕·PÜ≤αâ─ v■ vⁿܪαâ─└t$ìåV P╕wP╕╠(PÜ─αâ─╕·PÜ≤αâ─ïF·╗
Ä 3ë₧R îåT &ë7&ëGìL╗XÄ"3ë₧N îåP &ë&ëGÄ└&ï<ü pt#╕pPW╕ÖP╕╠(PÜ─αâ─╕·PÜ≤αâ──₧N &ï&ïWï╧╤ß╤ß┴ï≡ëVⁿ╟F°â ~>║ìM ëV■ëv·ë~÷ï≥ï~·╕ùÄ╪ÄZïX&ï&+╟ïVⁿ&ë&ëPâ╞IuΣïv·─₧N &─ïFⁿ&ë7&ëG─₧R &─&ï╤α╤α&G├î┬ï°ëV÷ï╪&ïÄ$3&ú· â╟ï┬&ë>
&ú
&ï· ╤π╤π▀Ä┬&ïÄ&3&ë║ìOëF÷&ë└&ú┬&ï║╤Γ╤Γ╩ï∙╗HÄ(3ë₧J îåL &ë&ëGâ┴Ä*3&ë┤&ú╢ÄF÷&ï╤Γ╤Γ╩ï±ëFⁿPQÜ"αâ─@≡╟F°─₧J &─&â?~Gë~⌠║ëV■ëv·ï≥ïN°ï~·╕ùÄ╪─┤&ï&+╟ïVⁿ&ë&ëPâ╞A─₧J &─&9┌ï~⌠ïv·Ä*3&─┤ïFⁿ&ë7&ëG─₧J &─&ï@╤α╤α&G°ïF÷Ä,3&ë>ä
&úå
ìMÄ.3&ë▄&ú▐╕^_ïσ]╦É&àÜuΘ0 Uï∞â∞.WVÜ4┘ÄZ9&╟3└Ä\9&ú6Ä^9&ú"Ä`9&ú╓Äb9&úrÄd9&ïbÄf9&ëdÄh9&ïfÄj9&ëh+╔ëN÷ëN⌠ v vÜZ α â─RP╕╠"P╕r╣ùQPÜααâ─╕÷╣ùïVï^ï±Vï°ï≥Ä┴Ä█╣≤Ñ^║╢╣ùëV≡ëN≥Vï·ï≡Ä┴╣≤ÑÄl9&â>nu-Än9&─X& ╖B& ╖@Ü┌α â─╕╧"PÜ|α â─3└Θb╕r╣ùQPÜÆ┘â─└tτï~
Θ╛╕P v≥ v≡PÜ┘â─└t!2└P░PÜ╢] â─Äp9&àÜt¡ÜN┘δªÉ2└P░PÜ╢] â─Äp9&àÜuÜ╬┘╕,
╣ùQPÜ╚┘â─2└P░PÜ╢] â─Äp9&àÜuΘ0 ~+└PPÜ(αâ─ëF⌠ëV÷╕PÜⁿ┘â─+└PPÜ(αâ─ï╚ï┌+F⌠V÷Ä~9&ú║&ë╝SQ v÷ v⌠ï≡ï∙ëvΓëVΣï≤Ürα â─ëFⁿëV■Ä~9&Ω&∞╣d3█SQRPÜåαëF°ëV·╕dÖRP v■ vⁿÜ║αëFⁿëV■ v· v°RP╕<ÖRP╣─ ╗ SQ╕ÖRP vΣ vΓÜ║αRPëF▐ëVαÜTα╣─ ╗ SQ vα v▐ëF┌ëV▄ÜTα╣<3█SQ vΣ vΓëF╓ëV╪Ü║αF╓V╪ïN┌ï^▄+╚┌SQëF╥ëV╘ÜTα╟╓+F⌠V÷RP v╘ v╥ vα v▐ v vÜZ α â─RPÄn9&─X& ╖r& ╖pÜ┌α â─ÜN┘Ä~9& å╗pÄr9ë^µîFΦ&â?tÄt9&â>vtÜ£┘Ü÷┘─^µ&â?t;Ä^9&â>"uÄ\9&â>6uÄ`9&â>╓t╕ P v vÜ╪┘â─ÉΦé─^µ&â?tMÄt9&â>vtA╕P╕PÄv9& 68& 66Ü`┘â─╕PÄx9&áGPÄv9& 68& 66Ü≡┘â─╕Θå tΘ╣╕╘Ä╪╕[≈.ï╪╕ùÄ└&í⌠&ï÷Ä┬╪îFε&÷GÇt1&9}&ïG≈╪╣ùÄ┴&;z
~3└Θ6╕ùÄ└&íz
ÄFε&9G|τ╕╘Ä└&íëFΩ└u╕╘Ä└&â>tÄFε&÷Gu╕ùÄ└&÷Ç
t│â~Ωu╕╘Ä└&â>tÄFε&÷Gt╕ùÄ└&÷Ç
uë╕P v≥ v≡PÜ┘â─└tΘ}ⁿÜ╬┘╗pÄr9ë^µîFΦ&â?tMÄt9&â>vtA╕P╕PÄv9& 68& 66Ü`┘â─╕PÄx9&áJPÄv9& 68& 66Ü≡┘â─+└PPÜ(αâ─ëF⌠ëV÷Äz9&â>|uÄ|9&╟z╕,
╣ùQPÜî┘â─ï≡÷|Θ%ⁿ─^µ&â?tMÄt9&â>vtA╕P╕PÄv9& 68& 66Ü`┘â─╕PÄx9&áGPÄv9& 68& 66Ü≡┘â─╕P v≥ v≡╕PÜ┘â─ï╞ΘÆÄn9&─X& ╖F& ╖DÜ┌α â─╕P v≥ v≡╕PÜ┘â─Är9&â>ptMÄt9&â>vtA╕P╕PÄv9& 68& 66Ü`┘â─╕PÄx9&áGPÄv9& 68& 66Ü≡┘â─Ü÷┘╕^_ïσ]╦Uï∞â∞WV╕P3└ÄZ9&úP╕÷╣ùQPÜαâ─ÄÇ9+└&ú&ú■ï~ u1Äé9&9>"t2└P░PÜ╢] â─Äp9&àÜuÜ|] ÷─uΘ╗Ää9&╟Äå9&íëF·└|#╕[≈n·ï≡Äê9&─⌠&÷@tÄä9&╟2└P░PÜ╢] â─= tΘ╨Äz9&â>|uÄ|9&╟zÄr9&â>ptÄt9&â>vtÜT┘Äé9&â>"t2└P░PÜ╢] â─Äp9&àÜtΘ t╛3 δÉ╕⌠PÜ▐┘â─ï≡â■tΘéÄè9&íN&Lts╕dPÜ╒ â─ëFⁿëV■Ü|] ÷─t6ë~ v■ vⁿÜ`╒ â─└u!╕dPÜ╒ â─ëFⁿëV■Üè] Ü|] ÷─u═Ü°] 3└PÄè9& 6N& 6LÜ└┘â─ΘΩ■â■tm╕pPÜ╒ â─ëFⁿëV■RPÜ`╒ â─└tΘP■ë~Ü|] ÷─tΘ@■2└P░PÜ╢] â─= tΘ*■Ü─α v■ vⁿÜ`╒ â─└t╞Θ■Ü─α 3└δbÉ2└P░PÜ╢] â─Äp9&àÜt;3└PÜⁿ┘â─ÜN┘Ä^9&â>"uÄ\9&â>6uÄ`9&â>╓tÉΦδÜN┘ÉΦ(╕^_ïσ]╦ÉUï∞ü∞·WV╗Äå9ë₧
îå &â?|%╕[&≈/Äê9&⌠&ï÷ì~ñï≡Ä┌╣-≤Ññ─₧
&â?}ΘÄÄ^9&â>"t5Ç~║t/èF║*ΣPÄn9&─X& ╖N& ╖LÜ┌α â─èF║*ΣPÉΦⁿâ─3÷ì~πÄî9&Ç╝&t1èB╗*ΣPWÄn9&─X& ╖R& ╖PÜ┌α â─
èB╗*ΣPÉΦ║â─Fâ╟ìF√;°r╕╗╓Ä`9ë₧ îå &â?uÄ\9&â>6t?─₧
&â?|5Ç~╣t/èF╣*ΣPÄn9&─X& ╖V& ╖TÜ┌α â─èF╣*ΣPÉΦOâ─ÄÄ9&í▓&░uΘ─₧ &â?uÄ\9&â>6uÄ^9&â>"uΘ⌡Än9&─X& ╖Z& ╖XÜ┌α â─ÄÉ9& 6¿& 6ªÜ`┘â─Üû┘ܼα ╕PÜ,╣â─ÄÄ9& 6▓& 6░ìå PÜ╝
αâ──₧
&â?|ìF┴Pìå PÜh
αâ─Ü╥┘ìå PÜ╠┘â─Ü╞┘░P░PÜ╢] â─Än9&─X& ╖^& ╖\Ü┌α â─ÄÆ9& 6á& 6₧Ü`┘â─Ü┘╕pPÜ╒ â─Äö9&úR&ëT3└Ä^9&ú"Ä\9&ú6─₧ &ë^_ïσ]╦ÉUï∞ÜÇ┘╕╨"PÄû9& 6°& 6÷Än9&─X& ╖å& ╖äÜ┌α ïσÄÉ9& 6¿& 6ªÜ`┘ïσÜû┘Ät9&â>vtÄÿ9& 6╕3└PÜ≥] ïσÄÜ9&â>LtÜr╣Ä£9&â>duÜ.] vÜ≤αïσ]╦Uï∞Vïv÷u3└Öδ,Ü─αï╚ï╞Ö+┬╤°ìTï╪ï┴ï╩Ö≈∙ï┬├╣d≈ΘPÜ╒ â─^ïσ]╦ÉUï∞â∞WVï~Ä₧9&íB&ïDÄF&9Eu &9U
uΘ&ïE
&EuΘÄá9&─α&╞Äó9& 6▐& 6▄╕╞KPÜ╝
αâ─╕╞KPÜ"αâ─╞KëF÷î^°╟F■Äñ9&í&uΘ╗ï~■─N╕ùÄ╪ï±ïïW&9Du&9T
tGâ├ïGuΓΘφÉĪ9ï▀╤π╤π&ïç╢&ïù╕ëV⌠╨uΘ╠ïV⌠ï≡ëVⁿÄ┬ï▐&Ç?u$ï~÷Ä¿9&â>t3╕┌"P v°WÜααâ─ΘùÉï~÷Ä^ⁿÄF°ï▐Fèï▀G&êÇ<u≡δ┬É─^& 7╕▄"P v°Wδ_ÉĬ9& 6╓& 6╘╕╞KPÜ╝
αâ─╕╞KPÜ"αâ─╞Kï≡î^°Ä¼9&í≡ÄF&9t&Ä¿9&â>uÄF& 5╕π"PìD v°PÜααâ─
╕╞Kî┌^_ïσ]╦ÉUï∞â∞Ät9&â>vuΘ½Är9&â>puΘ£3└PÜ,╣â─Äå9&í@P╕Ω"P╕r╣ùQPÜαα╕
αP╣QÄ«9& 6·& 6°Ü`┘â─╕r╣ùQPÄ«9& 6·& 6°ÜZ┘â─Ä░9&í£@PÄ▓9& 6╛
╕∩"P╕r╣ùQPÜααâ─╕
P╕PÄ«9& 6·& 6°Ü`┘â─╕r╣ùQPÄ«9& 6·& 6°ÜZ┘â─ÉΦΣÄ┤9&íbëF■└t'PÄ╢9& 6& 6╕·"P╕r╣ùQPÜααâ─δ$ÉÄ╢9& 6& 6╕#P╕r╣ùQPÜααâ─╕P╣QÄ«9& 6·& 6°Ü`┘â─╕#PÄ«9& 6·& 6°ÜZ┘â─╕P╕PÄ«9& 6·& 6°Ü`┘â─╕r╣ùQPÄ«9& 6·& 6°ÜZ┘â─3└PÄ╕9& 6^Üα ïσ]╦ÉÄt9&â>vt&Är9&â>pt╕ PÄ║9& 6û& 6öÜÉ┘â─╦ÉUï∞â∞.WVï~╗FLï≤î^·╞ }Θdï╟╣[≈ΘëF╘╗⌠Äê9ë^╓îF╪&─╪&÷Gt╞FLBï╞î┌@ï≡ëV·â~t Ä┬ï╪F&╞ ─^╓&─^╘&÷GtÄF·ï▐F&╞Câ~t
ÄF·ï▐F&╞ ─^╓&─^╘&÷GtÄF·ï▐F&╞Dâ~t
ÄF·ï▐F&╞ â~t$─^╓&─^╘&÷G@tÄF·ï▐F&╞FÄF·ï▐F&╞ ─^╓&─^╘&÷GtÄF·ï▐F&╞Hâ~t
ÄF·ï▐F&╞ ─^╓&─^╘&÷GtÄF·ï▐F&╞Kâ~t
ÄF·ï▐F&╞ ─^╓&─^╘&÷GÇtyÄF·ï▐F&╞Lâ~ti─^╓&─^╘&ïGëF╥└|@P╕+#δÉ╕ +F╥P╕0#PìF┌PÜααâ─
ìF┌î╥ï╚Ä┌ï╪6Ç?t!ëv°ëNⁿï°ï▀Gè─^° F°&êÇ=uφïv°ï~â~t$─^╓&─^╘&÷GtÄF·ï▐F&╞MÄF·ï▐F&╞ ─^╓&─^╘&÷GtÄF·ï▐F&╞Nâ~t
ÄF·ï▐F&╞ ─^╓&─^╘&÷GtÄF·ï▐F&╞Sâ~t
ÄF·ï▐F&╞ ─^╓&─^╘&÷G tÄF·ï▐F&╞Râ~t
ÄF·ï▐F&╞ â~tï^╘─~╓&─=&÷At
ÄF·ï▐F&╞XÄF·&╞╕FLî┌^_ïσ]├ÉUï∞Ät9&â>vuΘ╚Är9&â>puΘ╣Ä╝9&â>≡uÉΦ²3└PÄå9& 6Φ+²ïσRPÄå9&í@P╕5#P╕r╣ùQPÜααïσ╕
P╣QÄ«9& 6·& 6°Ü`┘ïσ╕r╣ùQPÄ«9& 6·& 6°ÜZ┘ïσ╕
P╕PÄ«9& 6·& 6°Ü`┘ïσ v vÄ«9& 6·& 6°ÜZ┘ïσÜT┘ïσ]╦Uï∞ü∞¼WV3└PÜz┘â─ï°╗Ä╛9ë₧` îåb &â?}ΘTÄt9&â>vuΘEÉΦⁿW─₧` &ï@P╛XÄn9ë╢\ îå^ &─& ╖f& ╖dìåd PÜααâ─╕P╕P╗öÄ║9ë₧X îåZ & w& 7Ü`┘â─ìåd P─₧X & w& 7ÜZ┘â─╕P─₧` & 7Φ╦√â─Ä┬ï╪ï≤îF·&Ç?tTï┬PV─₧\ &─& ╖j& ╖hìåd PÜααâ─╕PP─₧X & w& 7Ü`┘â─ìåd P─₧X & w& 7ÜZ┘â─╗╠Ä└9ë₧T îåV &ïG&uΘ9& w& 7ìåd PÜ╝
αâ─╕A#Pìåd PÜh
αâ─╕P╕J#Pìåd PÜ26 â─
ï≡ëV·╨uΘεïF·PV╣QQìN⌠Qï°Üαâ─ëFⁿWVܪαâ─â~ⁿuΘ┐ïvⁿ╤µïr≥─₧T & w& 7ìåd PÜ╝
αâ─╕M#Pìåd PÜh
αâ─3└PìÄd QìN╚QÜ*6 â─
└uqëv■ìFµPÜóαâ─;╞╕Pìåd PìF╚PÜ*6 â─
└t╘δ@É╕2P╕P─₧X & w& 7Ü`┘â──₧\ &─& ╖n& ╖l─₧X & w& 7ÜZ┘â─ÜT┘^_ïσ]╦R$bàCLS╦░Uï∞â∞.WVÄ╬4╕ù┐µ╛ΦÄ╪╣≤ÑÄ╨4&╟╝
╕&╣╘QPÜ(αâ─Ä╥4+└&ú,&ú*&ú(&ú0&ú.╗pÄ╘4ë^ΣîFµ&9t&Ä╓4&9vtÄ╪4&─X& ╖& ╖Ü£┘â─╟Fⁿ≥Ä┌4ï^ⁿ&â?uΘ╟ï├-╣ùì~Φï≡Ä┘╣≤Ñâ~εt%ïFεëF∞╟FεÄ▄4&íèëFΓ└~ëFΩδÉ╟FΩìFΦPÜ■α â─RPÄ╬4& 6°& 6÷╕Γ
P╕r╣ùQPÜααâ─╕r╣ùQPÜéBαâ─ìFΦPÜ■α â─RP╕δ
P╕r╣ùQPÜααâ─╕r╣ùQPÜéBαâ─âFⁿü~ⁿjsΘ) +└ëF≥ëF≡ëFΦëFΩëF∞ëFε╗εÄ▐4ë^▐îFα&ëÄα4&â>v└%╗ΣÄΓ4ë^┌îF▄&ëÄΣ4&â>x╔≈┘┴─^┌&ëĵ4&í╛
ÄΦ4&9«sÄΩ4&â> t─^┌&Ç3└P╣╢║ùëN╓ëV╪RQ╣QÉΦDâ─â~uΘ╬╕÷╣ùQP╕PÜ╝α â─Üÿ┘└tΘuÜ░┘HtpHtHHtMΘcܬ┘└uΘW─^▐&ï─^┌&àub╕Ä∞4&úhÄε4&údÄ╪4&─X& ╖Æ& ╖ÉÜ┌α â─δñÜñ┘└uΘ─^▐&ï─^┌&àu2δ┤Ä∞4&╟h3└PÜ₧┘ΘΣÄ≡4&╟T ╕Ä∞4&úhΘ┼É╕Θ╛╕t╣ùëF╥ëN╘ÉΦ3 ─^╥&9?~1╛Ä≥4& t& 4╕ª ╣ùQPÜ╠Fαâ─└uΘâ╞G─^╥&9?╥Ü╢┘ï°HuΘ≤HuΘGHtvHuΘ╛â }ΘWÄ⌠4&ít;╟ΘE2└P░PÜ╢] â─Ä÷4&àÜuΘ)ìFΦP╕PÜ╝α â─3└P v╪ v╓╕PÉΦ⌐â─Ä°4╤τ& ╡Ü┌┘ΘφÉÜ╘┘└uΘπ─^▐&ï─^┌&àtΘü╕Äε4&údÄ∞4&úhÄ╪4&─X& ╖Æ& ╖ÉÜ┌α â─Θµ■Ü╬┘└uΘò─^▐&ï─^┌&àtΘπδ░Éâ╟Θ6 2└P░PÜ╢] â─Ä÷4&àÜuΘ_Ä·4&â>tΘPìFΦP╕PÜ╝α â─3└P v╪ v╓╕PÉΦ╨â─Ü╚┘Θ"É2└P░PÜ╢] â─Ä÷4&àÜuΘ╟FΦⁿìFΦP╣QÜ╝α â─╟FΦÄⁿ4& é─^Σ&â?tpÄ╓4&â>vtdÄⁿ4& 6é& 6Ç╕≥
P╕r╣ùQPÜααâ─╕P╕PÄ■4& 6& 6Ü`┘â─╕r╣ùQPÄ■4& 6& 6ÜZ┘â─ÜT┘Ä∞4&╟h3└PÜ┬┘ΘOÉ╕÷╣ùQP╕PÜ╝α â─Äⁿ4& é─^Σ&â?tpÄ╓4&â>vtdÄⁿ4& 6é& 6Ç╕°
P╕r╣ùQPÜααâ─╕P╕PÄ■4& 6& 6Ü`┘â─╕r╣ùQPÄ■4& 6& 6ÜZ┘â─ÜT┘Ä≡4&╟T Ä∞4&╟hΘùÉ╕÷╣ùQP╕PÜ╝α â─Äⁿ4& é─^Σ&â?tpÄ╓4&â>vtdÄⁿ4& 6é& 6Ç╕■
P╕r╣ùQPÜααâ─╕P╕PÄ■4& 6& 6Ü`┘â─╕r╣ùQPÄ■4& 6& 6ÜZ┘â─ÜT┘3└PÜ╝┘â─Ä5&╞ª Ä5&íbÄε4&údÄ5&ífÄ∞4&úh╕P v╪ v╓╕PÉΦfâ─3└P v╪ v╓╕PÉΦQâ─^_ïσ]╦WV╕ùÄ╪+└úú■úⁿú·ú°ú÷╣ùÄ┴&úε╣ùÄ┴&úr╣ùÄ┴&ú╓╣ùÄ┴&ú6╣ùÄ┴&ú"╣╘Ä┴&úµ╣ùÄ┴&ú╝
╣ùÄ┴&ú≥╕ùÄ└╕ù┐µ╛ΦÄ╪╣≤Ñ^_╦ÉUï∞â∞V╕XPÜ╒ â─ëF·ëVⁿRPÜ`╒ â─└uuïv2└P░PÜ╢] â─Ä÷4&àÜtYܵα └uP2└P░PÜ╢] â─÷─ tÄFï▐F&è
└t*<t&PÜ÷] â─δÉÜ─α vⁿ v·Ü`╒ â─└tùδÉ╕δ'É2└P░PÜ╢] â─Ü:] ╕
PÜÄα â─Ü°] 3└^ïσ]╦ÉUï∞ü∞(WV╗bÄ5ë₧▐■îåα■&â?uΘ] v
vÜα┘â─ëFⁿëV■ïF└tHt#HuΘëHuΘòHuΘτ╕Θ)É╟FΘ╫É3÷96F~(┐εD╕P v
vWÜdαâ─
└uΘ÷â╟F;6F|█ï~ÄF
&â}t=& u& u v■ vⁿ╕Pìåb PÜααâ─ÄF
& u╕/PìFΓPÜααâ─
δ2É v■ vⁿìåb PÜ╝
αâ─ÄF
& u& u╕8PìFΓPÜααâ─ïF╤π╟çF─₧▐■& 7ìåb P╕EPìåΓ■PÜααâ─╕TPìåΓ■PÜ¿αâ─ï≡ëV■╨usÄ5&í╪&ï┌ëå┌■ëû▄■╨tZïF╤π╟çF ╢▄■ ╢┌■ìåb PÜ╝
αâ──₧▐■& 7ìåb P╕WPìåΓ■PÜααâ─╕fPìåΓ■PÜ¿αâ─ï≡ëV■ïF■╞u-â~uΘy■ìåΓ■PÄ╪4&─X& ╖>& ╖<Ü┌α â─ΘU■ïF■PVܪαâ─ìFΓPìåb PÜh
αâ─ìåb PìåΓ■PÜ<αâ─└uX9Ft!ìåb PÄ╪4&─X& ╖B& ╖@Ü┌α â─íFï╚╤α┴╤α╤αεDëFⁿî^■ FïFïV
ï≡Ä┌─~ⁿ╣≤ÑΘ≤Éâ~t+ v
vÜZ α â─RPÄ╪4&─X& ╖F& ╖DÜ┌α â─ìåΓ■PÜéBαâ─Θâ²â>FuΘy²3÷96F~%┐εD╕P v
vWÜdαâ─
└t
â╟F;6F|▐96F/â~uΘ=² v
vÜZ α â─RPÄ╪4&─X& ╖J& ╖HΘ╖■ï~ÄF
&â}t=& u& u v■ vⁿ╕iPìåb PÜααâ─ÄF
& u╕yPìFΓPÜααâ─
δ2É v■ vⁿìåb PÜ╝
αâ─ÄF
& u& u╕éPìFΓPÜααâ─ï▐╤πü├Fë₧╪■â?tÄ5& 6┌& 6╪ìåb PÜ╝
αâ─ìFΓPìåb PÜh
αâ─ï₧╪■╟ï■F;6F}rï╞╤αFëF·ï╟╤αFëF°ï╞╤α╞╤α╤αεDëF■ï╟╤α╟╤α╤αεDëFⁿíF+╞ëF÷ë~≥ëv⌠ïF■ï^ⁿï√ï≡╣≤Ñï^·âF·ïï^°âF°ëâFⁿâF■ N÷u╨ Fìåb PÜéBαâ─└u$9FuΘ╗√ìåb PÄ╪4&─X& ╖N& ╖LΘ?²â~uΘ├ìåb PÄ╪4&─X& ╖R& ╖PÜ┌α â─ΘƒÉÄ5&í╪&ï┌ëå┌■ëû▄■╨uΘé─₧▐■& 7 ╢▄■P╕Pìåb PÜααâ─╕Pìåb PÜ¿αâ─RPܪαδDÉÄ5&í╪&ï┌ëå┌■ëû▄■╨t-─₧▐■& 7 ╢▄■P╕Pìåb PÜααâ─ìåb PÜéBαâ─3└^_ïσ]╦Uï∞â∞(╗$Ä
5ë^▐îFα&â?uΘ≡╗╪Ä5ë^┌îF▄&ïG&uΘ╫íÆÉt 6Æ 6ÉÜ`╒ â─└uΘ╖╕dPÜ╒ â─úÉëÆÄ5&íbëF╪└tP─^┌& w& 7╕öP╕NFPÜααâ─δ─^┌& w& 7╕óP╕NFPÜααâ─ìFΓP╕NFPÜXXαâ─└uD╕NFPÜéBαâ──^▐& 7Ä╪4&─X& ╖₧& ╖£Ü┌α â─Ä5&╟z─^▐& 7ܵ┘ïσ]╦3└Ä╪9&úRúzLúxLÄ┌9&9ptIÄ▄9&9vt>╕PPÄ▐9& 6û& 6öÜ`┘â─╕╠#PÄ▐9& 6û& 6öÜZ┘â─ÜT┘δÉ╕ε#PÜ|α â─Ü°] Äα9&á£$■P░PÜ╢] â─╕PΦ½â─└u ÄΓ9&─X& ╖N& ╖LÜ┌α â─3└δnÉÄ┌9&â>ptJÄ▄9&â>vt>╕PPÄ▐9& 6û& 6öÜ`┘â─╕∙#PÄ▐9& 6û& 6öÜZ┘â─ÜT┘δÉ╕$PÜ|α â─╕PΦΣâ─╦V3└Ä╪9&úRúzLúxLÄ┌9&9ptHÄ▄9&9vt=╕PPÄ▐9& 6û& 6öÜ`┘â─╕&$PÄ▐9& 6û& 6öÜZ┘â─ÜT┘δ╕H$PÜ|α â─Ü:] Äα9&á£$■P░PÜ╢] â─3└PΦNâ─└tzÄ┌9&â>ptKÄ▄9&â>vt?╕PPÄ▐9& 6û& 6öÜ`┘â─╕S$PÄ▐9& 6û& 6öÜZ┘â─ÜT┘δÉÉ╕u$PÜ|α â─3└PΦâ─ï≡÷uÜ4┘ï╞^╦ÉUï∞â∞WVÄΣ9&í╕
&ï║
ï°ëV≡ï╚ï┌Ç─ëF≥ëV⌠╕Ç$PSQÜ╝
αâ─╕ç$P v≡WΦöâ─╕÷╣ùQPΦrâ─ĵ9&íµï╚╤α┴╤α╤α≡╣ùQPÜZ α â─RP╕ë$PÜ┌α â─ĵ9&íµï╚╤α┴╤α╤α≡╣ùQPÜZ α â─RP v≡WΦ'â─3└ëF■ëF·ÄΦ9&9Σ~Që~ε╛≡ï°Äµ9&9>µt,╕ù$P v≡ vεΦ≡â─╕ùPVÜZ α â─RP v≡ vεΦ╒â─â╞GÄΦ9&9>Σ║ï~ε╕Ö$P v≡WΦ┤â─╗8ÄΩ9ë^µîFΦ+└&ëG&ë9Ft╕÷╣ùQPÜ:┘â─└'â~uZízLï╚╤α┴╤α╤α0╣ùQPÜ:┘â─└~9─^µ&ïG&t-╕P& w& 7 v⌠ v≥Ü<αâ─
─^≥&╞GS v≡WΦ%â─╕£$P v≡WΦâ─â~t)Ä∞9&â>^uÄε9&â>`t╕ó$δ6╕º$δ1É╕¼$δ+ÉÄ≡9&÷▓t╕▒$P v≡WΦ╠â─Ä≡9&÷│Çu╕╢$P v≡WΦ▒â─╕╗$P v≡WΦóâ─Ä≥9&â>Σ└≈╪¿t+╕ùÄ└&ÇΣâ~u:&íΣ╣ùÄ┘#εëFΣ¿t╛δ&É╕ùÄ└δ┘É÷FΣt╛δÉïv■¿t
╛δ&ï6Σâ■└≈╪¿t╕╛$δ`Éâ~t6≈╞t╕├$P v≡WΦâ─≈╞t╕╚$P v≡WΦ√â─ï╞¿t3╕═$δ"É≈╞t╕╥$δÉ≈╞t╕╫$δ
Éï╞¿t╕▄$P v≡WΦ┬â─Ä≡9&÷│Çtâ~tÄ⌠9&â>zu╕ß$P v≡WΦòâ─╕µ$P v≡WΦåâ─╕ε$P v≡WΦwâ─╕≤$P v≡WΦhâ─Ä÷9&â>j uÄΓ9&─X&ïç╝&ïù╛δ╕⌡$î┌ëFⁿëV■RPÄ°9& 6⌠Ä·9& 6≥╕÷$P╕P╕%P v⌠ v≥Üααâ─ v⌠ v≥ v≡WΦⁿâ─╕%P v≡WΦφâ─Äⁿ9& 6║& 6╕Ä■9& 6╛& 6╝Ä:& 6╢& 6┤╕#%P v⌠ v≥Üααâ─ v⌠ v≥ v≡WΦBâ─Ä:& 6╞& 6─Ä:& 6╩& 6╚Ä:& 6┬& 6└╕0%P v⌠ v≥Üααâ─ v⌠ v≥ v≡WΦ⌡â─╕=%P v≡WΦDâ─Ä:&í&&ï(Ç─0ü╥T|RP╕E%P v⌠ v≥Üααâ─ v⌠ v≥ v≡WΦâ─ v≡WÜ"αâ─ï≡Äα9&á£$■P░PÜ╢] â─╟FΩ╕pPÜ╒ â─ëF÷ëV°ëv∞ë~εïv≥ v∞╕O%P v⌠VÜααâ─
v⌠VÜ"αâ─P v⌠VÜj!α â─ëF■╕P╣Q╣\%QÜJ] â─╕P v⌠VÜ"αâ─P v⌠VÜJ] â─╕P v∞ v≡ vεÜJ] â─╟F·â~∞~;ï~■ïv·Ä^≡ï^εèÿï╪ï╟è─*Σ3╪╤π╕QÄ└ï╟èα*└&3çZï°F;v∞|╓ë~■ïv≥Ü°] v■╕_%P v⌠VÜααâ─
╕P v⌠VÜ"αâ─P v⌠VÜJ] â─ïFΩ FΩ=vΘτ╕╨PÜ╒ â─ëFⁿëV■ v° v÷Ü`╒ â─└tΘ 2└P░PÜ╢] â─Ä
:&àÜuΘ v■ vⁿÜ`╒ â─└tΘº■Ü|] ÷─uܵα └tΘ▒Ü─α δ¥3└PÜ(α â─ï°-*uï╕i%P v⌠VÜ╝
αâ─ v⌠VΦ2â─└uΘi 6`# 6^# v⌠VÜ╠Fαâ─└uΘN 6p# 6n# v⌠ v≥Ü╠Fαâ─└tΘ■╕Θ╩ï~εÄΓ9&─X& ╖Ω& ╖Φ╕e%PïF≡PWï≡Üααâ─ï╞ï≈ëF■ëvⁿΘàÉ2└P░PÜ╢] â─ÄΓ9&─X&ïçá&ïùóï°ëV■δ\2└P░PÜ╢] â─Ä
:&àÜuÄΓ9&─X&ïçÇ&ïùéδ╦ÄΓ9&─X& ╖Ω& ╖Φ╕k%PïF⌠PVï°Üααâ─ï╟ï■ëF■ v■WÜ┌α â─3└^_ïσ]├Uï∞ü∞WV╟Få╟åP ╞å{ ╟å8 o%î₧: ╟å< w%î₧> ╟å@ ~%î₧B ╟åD à%î₧F ╟åH ï%î₧J +└ëåN ëåL ÄΣ9&í╕
&ï║
ëåv ëûx Ç─ï≡ëû~ Ç─ï°ëûp Ç─ëår ëût ╗8ÄΩ9ë₧■îå
■+└&ëG&ëë╛n Ä┌9&9ptHÄ▄9&9vt=╕PPÄ▐9& 6û& 6öÜ`┘â─╕æ%PÄ▐9& 6û& 6öÜZ┘â─ÜT┘δ╕╡%PÜ|α â─╗TÄ:ë₧■îå■&╟╕╨PÜ╒ â─ëF∞ëVε╕pPÜ╒ â─ëF≡ëV≥+└ëF÷ëF⌠èå{ ■å{ <vΘvâ~uZ 6`# 6^#╕└%P ╢~ VÜααâ─╕P ╢~ VÜ"αâ─P ╢~ VÜJ]
"Let's Talk LISP"
Prentice-Hall, NJ, 1976. 237 pages.
Good introduction, but quite out of date.
5. Stuart C. Shapiro
"Common Lisp: An Interactive Approach"
Computer Science Press/W.H. Freeman, New York, 1992.
ISBN 0-7167-8218-9
The errata for the book may be obtained by anonymous ftp from
ftp.cs.buffalo.edu:users/shapiro/clerrata.ps
6. Paul Grahm
On Lisp: Advanced Techniques for Common Lisp
Prentice Hall, 1993.
Other introductions to Lisp include:
1. A. A. Berk.
"LISP, The Language of Artificial Intelligence"
Van Nostrand Reinhold, 1985. 160 pages.
2. Paul Y. Gloess.
"An Alfred handy guide to Understanding LISP"
Alfred Publishers (Sherman Oaks, CA), 1982. 64 pages.
3. Ward D. Maurer.
"The Programmer's Introduction to LISP"
American Elsevier, 1972. 112 pages.
4. Hank Bromley and Richard Lamson.
"LISP Lore: A Guide to Programming the LISP Machine"
Kluwer Academic (Boston), 1987. 337 pages.
5. Sharam Hekmatpour.
"Introduction to LISP and Symbol Manipulation"
Prentice Hall (New York), 1988. 303 pages.
6. Deborah G. Tatar
"A programmer's guide to Common Lisp"
Digital Press, 1987. 327 pages. ISBN 0-932376-87-8.
Good introduction on Common Lisp for programmers familiar
with other programming languages, such as FORTRAN, PASCAL, or C.
7. Timothy Koschmann
"The Common Lisp Companion"
John Wiley & Sons, 1990. ISBN 0-471-503-8-8.
Targeted for those with some programming experience who wish to
learn draft-ANSI Common Lisp, including CLOS and the CL condition
system. Examples progress incrementally from simple numerical
calculation all the way to a logic-programming extension to CL.
More advanced introductions to Lisp and its use in Artificial
Intelligence include:
1. Peter Norvig.
"Paradigms of AI Programming: Case Studies in Common Lisp"
Morgan Kaufmann, 1992. 946 pages. ISBN 1-55860-191-0. $49.95.
Provides an in-depth exposition of advanced AI programming techniques
and includes large-scale detailed examples. The book is the most
advanced AI/Common-Lisp programming text and reference currently
available, and hence is not for the complete novice. It focuses on the
programming techniques necessary for building large AI systems,
including object-oriented programming, and has a strong performance
orientation.
The text is marked by its use of "non-toy" examples to illustrate the
techniques. All of the examples are written in Common Lisp, and copies
of the source code are available by anonymous ftp from
unix.sri.com:pub/norvig and on disk in Macintosh or DOS format from
the publisher. Some of the techniques described include rule-based
pattern matching (GPS, Eliza, a subset of Macsyma, the Emycin expert
system shell), constraint propagation and backtracking (Waltz
line-labelling), alpha-beta search (Othello), natural language
processing (top-down, bottom-up and chart parsing), logic-programming
(unification and Prolog), interpreters and compilers for Scheme, and
object-oriented programming (CLOS).
The examples are also used to illustrate good programming style and
efficiency. There is a guide to trouble-shooting and debugging Lisp
programs, a style guide, and a discussion of portability problems.
Some of the efficiency techniques described include memoization,
data indexing, compilation, delaying computation, proper use of
declarations, avoiding garbage collection, and choosing and using the
correct data structure.
The book also serves as an advanced introduction to Common Lisp, with
sections on the Loop macro, CLOS and sequences, and some coverage of
error handling, series, and the package facility.
2. Eugene Charniak, Christopher K. Riesbeck, Drew V. McDermott
and James R. Meehan.
"Artificial Intelligence Programming", 2nd edition.
Lawrence Erlbaum Associates (Hillsdale, NJ), 1987. 533 pages.
Provides many nice code fragments, all of which are written
in Common Lisp. The first half of the book covers topics
like macros, the reader, data structures, control structures,
and defstructs. The second half of the book describes
programming techniques specific to AI, such as
discrimination nets, production systems, deductive database
retrieval, logic programming, and truth maintenance.
3. Patrick H. Winston and Berthold K. P. Horn.
"LISP", 3rd edition.
Addison-Wesley (Reading, MA), 1989. 611 pages. ISBN 0-201-08319-1
Covers the basic concepts of the language, but also gives a lot
of detail about programming AI topics such as rule-based expert
systems, forward chaining, interpreting transition trees,
compiling transition trees, object oriented programming,
and finding patterns in images. Not a tutorial. Has many
good examples. Source code for the examples is available by
anonymous ftp from ftp.ai.mit.edu:/pub/lisp3/. More
detailed versions are in /pub/ai3/. (The code runs in
Lucid, Allegro, KCL, GCLisp, MCL, Symbolics Genera. Send mail
with subject line "help" to ai3@ai.mit.edu for more information.)
4. John R. Anderson, Albert T. Corbett, and Brian J. Reiser.
"Essential LISP"
Addison-Wesley (Reading, MA), 1987. 352 pages.
Concentrates on how to use Lisp with iteration and recursion.
5. Robert D. Cameron and Anthony H. Dixon
"Symbolic Computing with Lisp"
Prentice-Hall, 1992, 326 pages. ISBN 0-13-877846-9.
The book is intended primarily as a third-year computer science
text. In terms of programming techniques, it emphasizes recursion
and induction, data abstraction, grammar-based definition of Lisp
data structures and functional programming style. It uses
two Lisp languages:
(1) a purely functional subset of Lisp called Small Lisp and
(2) Common Lisp.
An MS-DOS interpreter for Small Lisp (including source) is
provided with the book. It considers applications of Lisp
to formal symbolic data domains: algebraic expressions,
logical formulas, grammars and programming languages.
6. Hasemer and Domingue.
"Common Lisp Programming for Artificial Intelligence"
Addison-Wesley, 1989.
7. Steven Tanimoto
"The Elements of Artificial Intelligence: An Introduction Using Lisp"
Computer Science Press, Rockville, MD, 1987, 530 pages.
8. Patrick R. Harrison
"Common Lisp and Artificial Intelligence"
Prentice Hall, Englewood Clifs, NJ, 1990. 244 pages. ISBN 0-13-155243.
9. Paul Graham
"On Lisp: Advanced Techniques for Common Lisp"
Prentice Hall, Englewood Clifs, NJ, 1994. ISBN 0-13-030552-9.
Emphasizes a bottom-up style of writing programs, which he
claims is natural in Lisp and has advantages over the
traditional way of writing programs in C and Pascal.
Also has in-depth sections on writing macros.
General Lisp reference mp.lang.clos. Similarly, questions about the
programming language Scheme should be directed to the newsgroup
comp.lang.scheme. Discussion of functional programming language issues
should be directed to the newsgroup comp.lang.functional. Discussion
of AI programs implemented in Lisp should sometimes be cross-posted to
the newsgroup comp.ai.
----------------------------------------------------------------
Subject: [1-1] What is the difference between Scheme and Common Lisp?
Scheme is a dialect of Lisp that stresses conceptual elegance and
simplicity. It is specified in R4RS and IEEE standard P1178. (See
the Scheme FAQ for details on standards for Scheme.) Scheme is much
smaller than Common Lisp; the specification is about 50 pages,
compared to Common Lisp's 1300 page draft standard. (See question
[4-10] for details on standards for Common Lisp.) Advocates of Scheme
often find it amusing that the Scheme standard is shorter than the
index to CLtL2.
Scheme is often used in computer science curricula and programming
language research, due to its ability to represent many programming
abstractions with its simple primitives. Common Lisp is often used for
real world programming because of its large library of utility
functions, a standard object-oriented programming facility (CLOS), and
a sophisticated condition handling system.
See the Scheme FAQ for information about object-oriented programming
in Scheme.
In Common Lisp, a simple program would look something like the
following:
(defun fact (n)
(if (< n 2)
1
(* n (fact (1- n)))))
In Scheme, the equivalent program would like like this:
(define fact
(lambda (n)
(if (< n 2)
1
(* n (fact (- n 1))))))
Experienced Lisp programmers might write this program as follows in order
to allow it to run in constant space:
(defun fact (n)
(labels ((tail-recursive-fact (counter accumulator)
(if (> counter n)
accumulator
(tail-recursive-fact (1+ counter)
(* counter accumulator)))))
(tail-recursive-fact 1 1)))
Whereas in Scheme the same computation could be written as follows:
(define fact
(lambda (n)
(letrec ((tail-recursive-fact
(lambda (counter accumulator)
(if (> counter n)
accumulator
(tail-recursive-fact (+ counter 1)
(* counter accumulator))))))
(tail-recursive-fact 1 1))))
or perhaps (using IEEE named LETs):
(define fact
(lambda (n)
(let loop ((counter n)
(accumulator 1))
(if (< counter 2)
accumulator
(loop (- counter 1)
(* accumulator counter))))))
Some Schemes allow one to use the syntax (define (fact n) ...) instead
of (define fact (lambda (n) ...)).
----------------------------------------------------------------
Subject: [1-2] What documentation is available on Lisp?
How can I learn Lisp?
There are several good Lisp introductions and tutorials:
1. David S. Touretzky
"Common Lisp: A Gentle Introduction to Symbolic Computation"
Benjamin/Cummings Publishers, Redwood City, CA, 1990. 592 pages.
ISBN 0-8053-0492-4.
Perhaps the best tutorial introduction to the language. It has
clear and correct explanations, and covers some fairly advanced
topics. The book is an updated Common Lisp version of the 1984
edition published by Harper and Row Publishers.
Three free Lisp educational tools which were used in the book --
Evaltrace, DTRACE and SDRAW -- are available by anonymous ftp from
b.gp.cs.cmu.edu:/usr/dst/public/{lisp,evaltrace}. Evaltrace is a
graphical notation for explaining how evaluation works and is
described in "Visualizing Evaluation in Applicative Languages" by
David S. Touretzky and Peter Lee, CACM 45-59, October 1992. DTRACE
is a "detailed trace" which provides more information than the
tracing tools provided with most Common Lisp implementations. SDRAW
is a read-eval-draw loop that evaluates Lisp expressions
and draws the result as a cons cell diagram (for both X11 and ascii
terminals). Also available is PPMX, a tool for pretty printing
macro expansions.
2. Robert Wilensky
"Common LISPcraft"
W. W. Norton, 1986. 500 pages. ISBN 0-393-95544-3.
3. Wade L. Hennessey
"Common Lisp"
McGraw-Hill, 1989. 395 pages.
Fairly good, but jumps back and forth from the simple to the
complex rather quickly, with no clear progression in difficulty.
4. Laurent Siklossy foundations, and applications"
Springer-Verlag, 1990. 278 pages. ISBN 0-387-97072-X
Self-modifying code, self-reproducing programs, etc.
4. CMU CL User's Manual, Chapter 7, (talks about writing
efficient code). It is available by anonymous ftp from any CMU CS
machine (e.g., ftp.cs.cmu.edu [128.2.206.173]) as the file
/afs/cs.cmu.edu/project/clisp/docs/cmu-user/cmu-user.ps
[when getting this file by anonymous ftp, one must cd to
the directory in one atomic operation, as some of the superior
directories on the path are protected from access by anonymous ftp.]
5. See also Norvig's book, SICP (Abelson & Sussman), SAP
(Springer and Friedman).
6. Hallvard Tretteberg's Lisp Style Guide is available by anonymous
ftp in ftp.think.com:/public/think/lisp/style-guide.text. There is
a fair bit of overlap between Hallvard's style guide and the notes
below and in part 3 of this FAQ.
7. Rajeev Sangal
"Programming Paradigms in Lisp"
McGraw-Hill, 1991. ISBN 0-07-054666-5.
8. Rodney A. Brooks.
"Programming in Common Lisp"
John Wiley & Sons, New York, 1985. 303 pages. ISBN 0-471-81888-7.
Chapter 5 discusses Lisp programming style.
Here are some general suggestions/notes about improving Lisp
programming style, readability, correctness and efficiency:
General Programming Style Rules:
- Write short functions, where each function provides a single,
well-defined operation. Small functions are easier to
read, write, test, debug, and understand.
- Use descriptive variable and function names. If it isn't clear
from the name of a function or variable what its purpose is,
document it with a documentation string and a comment. In fact,
even if the purpose is evident from the name, it is still worth
documenting your code.
- Don't write Pascal (or C) code in Lisp. Use the appropriate
predefined functions -- look in the index to CLtL2, or use the
APROPOS and DESCRIBE functions. Don't put a close parenthesis
on a line by itself -- this can really aggravate programmers
who grew up on Lisp. Lisp-oriented text editors include tools
for ensuring balanced parentheses and for moving across
pairs of balanced parentheses. You don't need to stick
comments on close parentheses to mark which expression they close.
- Use proper indentation -- you should be able to understand
the structure of your definitions without noticing the parentheses.
In general, the way one indents a form is controlled by the
first symbol of the form. In DEFUNs, for example, one puts the
symbol DEFUN, the function name, and the argument list all on
the same line. If the argument list is too long, one can break
it at one of the lambda keywords. Following the argument list,
one inserts a carriage return and lists the expressions in the
body of the definition, with each form starting on its own
line indented three spaces relative to the open parenthesis of
the parent (in this case the DEFUN). This general style -- of
putting all the significant elements of a form on a single
line, followed by a carriage return and the indented body --
holds for many Lisp constructs. There are, of course, variations,
such as keeping the first clause on the same line as the COND
or CASE symbol, and the rules are relaxed in different ways to
keep line lengths to a manageable size. If you find yourself having
trouble fitting everything in even with line breaking and
relaxing the rules, either your function names are too long or your
code isn't very modular. You should perceive this as a signal that
you need to break up your big definitions into smaller chunks, each
with a clearly defined purpose, and possibly replace long function
names with concise but apt shorter ones.
- Use whitespace appropriately. Use whitespace to separate
semantically distinct code segments, but don't use too much
whitespace. For example,
GOOD:
(defun foo (x y)
(let ((z (+ x y 10)))
(* z z)))
BAD:
(defun foo(x y)(let((z(+ x y 10)))(* z z)))
(defun foo ( x y )
(let ( ( z (+ x y 10) ) )
( * z z )
)
)
Although the Lisp reader and compiler don't care which you
use, most experienced Lisp programs find the first example much easier
to read than the last two.
- Don't use line lengths greater than 80 characters. People who
write code using Zmacs on Symbolics Lisp Machines are notoriously
guilty of violating this rule, because the CPT6 font allows
one to squeeze a tremendous amount of code on the display,
especially if one spreads the code out horizontally. This
makes it more difficult to read when printed out or read on
an 80x24 xterm window. In fact, use a line length of 72 characters
because it leaves a strip of white space at the edge of the window.
The following functions often abused or misunderstood by novices.
Think twice before using any of these functions.
- EVAL. Novices almost always misuse EVAL. When experts use
EVAL, they often would be better off using APPLY, FUNCALL, or
SYMBOL-VALUE. Use of EVAL when defining a macro should set off
a warning bell -- macro definitions are already evaluated
during expansion. See also the answer to question 3-12.
The general rule of thumb about EVAL is: if you think you need
to use EVAL, you're probably wrong.
- PROGV. PROGV binds dynamic variables and is often misused in
conjunction with EVAL, which uses the dynamic environment.
In general, avoid unnecessary use of special variables.
PROGV is mainly for writing interpreters for languages embedded
in Lisp. If you want to bind a list of values to a list of
lexical variables, use
(MULTIPLE-VALUE-BIND (..) (VALUES-LIST ..) ..)
or
(MULTIPLE-VALUE-SETQ (..) (VALUES-LIST ..))
instead. Most decent compilers can optimize this expression.
However, use of this idiom is not to be encouraged unless absolutely
necessary.
- CATCH and THROW. Often a named BLOCK and RETURN-FROM are
more appropriate. Use UNWIND-PROTECT when necessary.
- Destructive operations, such as NCONC, SORT, DELETE,
RPLACA, and RPLACD, should be used carefully and sparingly.
In general, trust the garbage collector: allocate new
data structures when you need them.
To improve the readability of your code,
- Don't use any C{A,D}R functions with more than two
letters between the C and the R. When nested, they become
hard to read. If you have complex data structures, you
are often better off describing them with a DEFSTRUCT,
even if the type is LIST. The data abstraction afforded by
DEFSTRUCT makes the code much more readable and its purpose
clearer. If you must use C{A,D}R, try to use
DESTRUCTURING-BIND instead, or at least SECOND, THIRD,
NTH, NTHCDR, etc.
- Use COND instead of IF and PROGN. In general, don't use PROGN if
there is a way to write the code within an implicit
PROGN. For example,
(IF (FOO X)
(PROGN (PRINT "hi there") 23)
34)
should be written using COND instead.
- Never use a 2-argument IF or a 3-argument IF with a second
argument of NIL unless you want to emphasize the return value;
use WHEN and UNLESS instead. You will want to emphasize the
return value when the IF clause is embedded within a SETQ,
such as (SETQ X (IF (EQ Y Z) 2 NIL)). If the second argument
to IF is the same as the first, use OR instead: (OR P Q) rather
than (IF P P Q). Use UNLESS instead of (WHEN (NOT ..) ..)
but not instead of (WHEN (NULL ..) ..).
- Use COND instead of nested IF statements. Be sure to check for
unreachable cases, and eliminate those cond-clauses.
- Use backquote, rather than explicit calls to LIST, CONS, and
APPEND, whenever writing a form which produces a Lisp form, but
not as a general substitute for LIST, CONS and APPEND. LIST,
CONS and APPEND usually allocate new storage, but lists produced
by backquote may involve destructive modification (e.g., ,.).
- Make the names of special (global) variables begin and end
with an asterisk (*): (DEFVAR *GLOBAL-VARIABLE*)
Some programmers will mark the beginning and end of an internal
global variable with a percent (%) or a period (.).
Make the names of constants begin and end with a plus (+):
(DEFCONSTANT +E+ 2.7182818)
This helps distinguish them from lexical variables. Some people
prefer to use macros to define constants, since this avoids
the problem of accidentally trying to bind a symbol declared
with defconstant.
- If your program is built upon an underlying substrate which is
implementation-dependent, consider naming those functions and
macros in a way that visually identifies them, either by placing
them in their own package, or prepending a character like a %, .,
or ! to the function name. Note that many programmers use the
$ as a macro character for slot access, so it should be avoided
unless you're using it for that purpose.
- Don't use property lists. Instead, use an explicit hash table.
This helps avoid problems caused by the symbol being in the wrong
package, accidental reuse of property keys from other
programs, and allows you to customize the structure of the table.
- Use the most specific construct that does the job. This lets
readers of the code see what you intended when writing the code.
For example, don't use SETF if SETQ will do (e.g., for lexical
variables). Use the most specific predicate to test your conditions.
If you intend for a function to be a predicate, have it return T
for true, not just non-NIL.
- When NIL is used as an empty list, use () in your code. When NIL
is used as a boolean, use NIL. Similarly, use NULL to test for an
empty list, NOT to test a logical value. Use ENDP to test for the
end of a list, not NULL.
- Don't use the &AUX lambda-list keyword. It is always clearer to
define local variables using LET or LET*.
- When using RETURN and RETURN-FROM to exit from a block, don't
use (VALUES ..) when returning only one value, except if you
are using it to suppress extra multiple values from the first
argument.
- If you want a function to return no values (i.e., equivalent to
VOID in C), use (VALUES) to return zero values. This signals
to the reader that the function is used mainly for side-effects.
- (VALUES (VALUES 1 2 3)) returns only the first value, 1.
You can use (VALUES (some-multiple-value-function ..)) to suppress
the extra multiple values from the function. Use MULTIPLE-VALUE-PROG1
instead of PROG1 when the multiple values are significant.
- When using MULTIPLE-VALUE-BIND and DESTRUCTURING-BIND, don't rely
on the fact that NIL is used when values are missing. This is
an error in some implementations of DESTRUCTURING-BIND. Instead,
make sure that your function always returns the proper number of
values.
- Type the name of external symbols, functions, and variables
from the COMMON-LISP package in uppercase. This will allow your
code to work properly in a case-sensitive version of Common Lisp,
since the print-names of symbols in the COMMON-LISP package
are uppercase internally. (However, not everybody feels that
being nice to case-sensitive Lisps is a requirement, so this
isn't an absolute style rule, just a suggestion.)
Lisp Idioms:
- MAPCAN is used with a function to return a variable number of
items to be included in an output list. When the function returns zero
or one items, the function serves as a filter. For example,
(mapcan #'(lambda (x) (when (and (numberp x) (evenp x)) (list x)))
'(1 2 3 4 x 5 y 6 z 7))
Documentation:
- Comment your code. Use three semicolons in the left margin before
the definition for major explanations. Use two semicolons that
float with the code to explain the routine that follows. Two
semicolons may also be used to explain the following line when the
comment is too long for the single semicolon treatment. Use
a single semicolon to the right of the code to explain a particular
line with a short comment. The number of semicolons used roughly
corresponds with the length of the comment. Put at least one blank
line before and after top-level expressions.
- Include documentation strings in your code. This lets users
get help while running your program without having to resort to
the source code or printed documentation.
Issues related to macros:
- Never use a macro instead of a function for efficiency reasons.
Declaim the function as inline -- for example,
(DECLAIM (INLINE ..))
This is *not* a magic bullet -- be forewarned that inline
expansions can often increase the code size dramatically. INLINE
should be used only for short functions where the tradeoff is
likely to be worthwhile: inner loops, types that the compiler
might do something smart with, and so on.
- When defining a macro that provides an implicit PROGN, use the
&BODY lambda-list keyword instead of &REST.
- Use gensyms for bindings within a macro, unless the macro lets
the user explicitly specify the variable. For example:
(defmacro foo ((iter-var list) body-form &body body)
(let ((result (gensym "RESULT")))
`(let ((,result nil))
(dolist (,iter-var ,list ,result)
(setq ,result ,body-form)
(when ,result
,@body)))))
This avoids errors caused by collisions during macro expansion
between variable names used in the macro definition and in the
supplied body.
- Use a DO- prefix in the name of a macro that does some kind of
iteration, WITH- when the macro establishes bindings, and
DEFINE- or DEF- when the macro creates some definitions. Don't
use the prefix MAP- in macro names, only in function names.
- Don't create a new iteration macro when an existing function
or macro will do.
- Don't define a macro where a function definition will work just
as well -- remember, you can FUNCALL or MAPCAR a function but
not a macro.
- The LOOP and SERIES macros generate efficient code. If you're
writing a new iteration macro, consider learning to use one
of them instead.
File Modularization:
- If your program involves macros that are used in more than one
file, it is generally a good idea to put such macros in a separate
file that gets loaded before the other files. The same things applies
to primitive functions. If a macro is complicated, the code that
defines the macro should be put into a file by itself. In general, if
a set of definitions form a cohesive and "independent" whole, they
should be put in a file by themselves, and maybe even in their own
package. It isn't unusual for a large Lisp program to have files named
"site-dependent-code", "primitives.lisp", and "macros.lisp". If a file
contains primarily macros, put "-macros" in the name of the file.
Stylistic preferences:
- Use (SETF (CAR ..) ..) and (SETF (CDR ..) ..) in preference to
RPLACA and RPLACD. Likewise (SETF (GET ..) ..) instead of PUT.
- Use INCF, DECF, PUSH and POP instead instead of the corresponding
SETF forms.
- Many programmers religiously avoid using CATCH, THROW, BLOCK,
PROG, GO and TAGBODY. Tags and go-forms should only be necessary
to create extremely unusual and complicated iteration constructs. In
almost every circumstance, a ready-made iteration construct or
recursive implementation is more appropriate.
- Don't use LET* where LET will do. Don't use LABELS where FLET
will do. Don't use DO* where DO will do.
- Don't use DO where DOTIMES or DOLIST will do.
- If you like using MAPCAR instead of DO/DOLIST, use MAPC when
no result is needed -- it's more efficient, since it doesn't
cons up a list. If a single cumulative value is required, use
REDUCE. If you are seeking a particular element, use FIND,
POSITION, or MEMBER.
- If using REMOVE and DELETE to filter a sequence, don't use the
:test-not keyword or the REMOVE-IF-NOT or DELETE-IF-NOT functions.
Use COMPLEMENT to complement the predicate and the REMOVE-IF
or DELETE-IF functions instead.
- Use complex numbers to represent points in a plane.
- Don't use lists where vectors are more appropriate. Accessing the
nth element of a vector is faster than finding the nth element
of a list, since the latter requires pointer chasing while the
former requires simple addition. Vectors also take up less space
than lists. Use adjustable vectors with fill-pointers to
implement a stack, instead of a list -- using a list continually
conses and then throws away the conses.
- When adding an entry to an association list, use ACONS, not
two calls to CONS. This makes it clear that you're using an alist.
- If your association list has more than about 10 entries in it,
consider using a hash table. Hash tables are often more efficient.
(See also [2-2].)
- When you don't need the full power of CLOS, consider using
structures instead. They are often faster, take up less space, and
easier to use.
- Use PRINT-UNREADABLE-OBJECT when writing a print-function.
- Use WITH-OPEN-FILE instead of OPEN and CLOSE.
- When a HANDLER-CASE clause is executed, the stack has already
unwound, so dynamic bindings that existed when the error
occured may no longer exist when the handler is run. Use
HANDLER-BIND if you need this.
- When using CASE and TYPECASE forms, if you intend for the form
to return NIL when all cases fail, include an explicit OTHERWISE
clause. If it would be an error to return NIL when all cases
fail, use ECASE, CCASE, ETYPECASE or CTYPECASE instead.
- Use local variables in preference to global variables whenever
possible. Do not use global variables in lieu of parameter passing.
Global variables can be used in the following circumstances:
* When one function needs to affect the operation of
another, but the second function isn't called by the first.
(For example, *load-pathname* and *break-on-warnings*.)
* When a called function needs to affect the current or future
operation of the caller, but it doesn't make sense to accomplish
this by returning multiple values.
* To provide hooks into the mechanisms of the program.
(For example, *evalhook*, *, /, and +.)
* Parameters which, when their value is changed, represent a
major change to the program.
(For example, *print-level* and *print-readably*.)
* For state that persists between invocations of the program.
Also, for state which is used by more than one major program.
(For example, *package*, *readtable*, *gensym-counter*.)
* To provide convenient information to the user.
(For example, *version* and *features*.)
* To provide customizable defaults.
(For example, *default-pathname-defaults*.)
* When a value affects major portions of a program, and passing
this value around would be extremely awkward. (The example
here is output and input streams for a program. Even when
the program passes the stream around as an argument, if you
want to redirect all output from the program to a different
stream, it is much easier to just rebind the global variable.)
- Beginning students, especially ones accustomed to programming
in C, Pascal, or Fortran, tend to use global variables to hold or pass
information in their programs. This style is considered ugly by
experienced Lisp programmers. Although assignment statements can't
always be avoided in production code, good programmers take advantage
of Lisp's functional programming style before resorting to SETF and
SETQ. For example, they will nest function calls instead of using a
temporary variable and use the stack to pass multiple values. When
first learning to program in Lisp, try to avoid SETF/SETQ and their
cousins as much as possible. And if a temporary variable is necessary,
bind it to its first value in a LET statement, instead of letting it
become a global variable by default. (If you see lots of compiler
warnings about declaring variables to be special, you're probably
making this mistake. If you intend a variable to be global, it should
be defined with a DEFVAR or DEFPARAMETER statement, not left to the
compiler to fix.)
Correctness and efficiency issues:
- In CLtL2, IN-PACKAGE does not evaluate its argument. Use defpackage
to define a package and declare the external (exported)
symbols from the package.
- The ARRAY-TOTAL-SIZE-LIMIT may be as small as 1024, and the
CALL-ARGUMENTS-LIMIT may be as small as 50.
- Novices often mistakenly quote the conditions of a CASE form.
For example, (case x ('a 3) ..) is incorrect. It would return
3 if x were the symbol QUOTE. Use (case x (a 3) ..) instead.
- Avoid using APPLY to flatten lists. Although
(apply #'append list-of-lists)
may look like a call with only two arguments, it becomes a
function call to APPEND, with the LIST-OF-LISTS spread into actual
arguments. As a result it will have as many arguments as there are
elements in LIST-OF-LISTS, and hence may run into problems with the
CALL-ARGUMENTS-LIMIT. Use REDUCE or MAPCAN instead:
(reduce #'append list-of-lists :from-end t)
(mapcan #'copy-list list-of-lists)
The second will often be more efficient (see note below about choosing
the right algorithm). Beware of calls like (apply f (mapcar ..)).
- NTH must cdr down the list to reach the elements you are
interested in. If you don't need the structural flexibility of
lists, try using vectors and the ELT function instead.
- CASE statements can be vectorized if the keys are consecutive
numbers. Such CASE statements can still have OTHERWISE clauses.
To take advantage of this without losing readability, use #. with
symbolic constants:
(eval-when (compile load eval)
(defconstant RED 1)
(defconstant GREEN 2)
(defconstant BLUE 3))
(case color
(#.RED ...)
(#.GREEN ...)
(#.BLUE ...)
...)
- Don't use quoted constants where you might later destructively
modify them. For example, instead of writing '(c d) in
(defun foo ()
(let ((var '(c d)))
..))
write (list 'c 'd) instead. Using a quote here can lead to
unexpected results later. If you later destructively modify the
value of var, this is self-modifying code! Some Lisp compilers
will complain about this, since they like to make constants
read-only. Modifying constants has undefined results in ANSI CL.
See also the answer to question [3-13].
Similarly, beware of shared list structure arising from the use
of backquote. Any sublist in a backquoted expression that doesn't
contain any commas can share with the original source structure.
- Don't proclaim unsafe optimizations, such as
(proclaim '(optimize (safety 0) (speed 3) (space 1)))
since this yields a global effect. Instead, add the
optimizations as local declarations to small pieces of
well-tested, performance-critical code:
(defun well-tested-function ()
(declare (optimize (safety 0) (speed 3) (space 1)))
..)
Such optimizations can remove run-time type-checking; type-checking
is necessary unless you've very carefully checked your code
and added all the appropriate type declarations.
- Some programmers feel that you shouldn't add declarations to
code until it is fully debugged, because incorrect
declarations can be an annoying source of errors. They recommend
using CHECK-TYPE liberally instead while you are developing the code.
On the other hand, if you add declarations to tell the
compiler what you think your code is doing, the compiler can
then tell you when your assumptions are incorrect.
Declarations also make it easier for another programmer to read
your code.
- Declaring the type of variables to be FIXNUM does not
necessarily mean that the results of arithmetic involving the
fixnums will be a fixnum; it could be a BIGNUM. For example,
(declare (type fixnum x y))
(setq z (+ (* x x) (* y y)))
could result in z being a BIGNUM. If you know the limits of your
numbers, use a declaration like
(declare (type (integer 0 100) x y))
instead, since most compilers can then do the appropriate type
inference, leading to much faster code.
- Don't change the compiler optimization with an OPTIMIZE
proclamation or declaration until the code is fully debugged
and profiled. When first writing code you should say
(declare (optimize (safety 3))) regardless of the speed setting.
- Depending on the optimization level of the compiler, type
declarations are interpreted either as (1) a guarantee from
you that the variable is always bound to values of that type,
or (2) a desire that the compiler check that the variable is
always bound to values of that type. Use CHECK-TYPE if (2) is
your intention.
- If you get warnings about unused variables, add IGNORE
declarations if appropriate or fix the problem. Letting such
warnings stand is a sloppy coding practice.
To produce efficient code,
- choose the right algorithm. For example, consider seven possible
implementations of COPY-LIST:
(defun copy-list (list)
(let ((result nil))
(dolist (item list result)
(setf result (append result (list item))))))
(defun copy-list (list)
(let ((result nil))
(dolist (item list (nreverse result))
(push item result))))
(defun copy-list (list)
(mapcar #'identity list))
(defun copy-list (list)
(let ((result (make-list (length list))))
(do ((original list (cdr original))
(new result (cdr new)))
((null original) result)
(setf (car new) (car original)))))
(defun copy-list (list)
(when list
(let* ((result (list (car list)))
(tail-ptr result))
(dolist (item (cdr list) result)
(setf (cdr tail-ptr) (list item))
(setf tail-ptr (cdr tail-ptr))))))
(defun copy-list (list)
(loop for item in list collect item))
(defun copy-list (list)
(if (consp list)
(cons (car list)
(copy-list (cdr list)))
list))
The first uses APPEND to tack the elements onto the end of the list.
Since APPEND must traverse the entire partial list at each step, this
yields a quadratic running time for the algorithm. The second
implementation improves on this by iterating down the list twice; once
to build up the list in reverse order, and the second time to reverse
it. The efficiency of the third depends on the Lisp implementation,
but it is usually similar to the second, as is the fourth. The fifth
algorithm, however, iterates down the list only once. It avoids the
extra work by keeping a pointer (reference) to the last cons of the
list and RPLACDing onto the end of that. Use of the fifth algorithm
may yield a speedup. Note that this contradicts the earlier dictum to
avoid destructive functions. To make more efficient code one might
selectively introduce destructive operations in critical sections of
code. Nevertheless, the fifth implementation may be less efficient in
Lisps with cdr-coding, since it is more expensive to RPLACD cdr-coded
lists. Depending on the implementation of nreverse, however,
the fifth and second implementations may be doing the same
amount of work. The sixth example uses the Loop macro, which usually
expands into code similar to the third. The seventh example copies
dotted lists, and runs in linear time, but isn't tail-recursive.
- use type declarations liberally in time-critical code, but
only if you are a seasoned Lisp programmer. Appropriate type
declarations help the compiler generate more specific and
optimized code. It also lets the reader know what assumptions
were made. For example, if you only use fixnum arithmetic,
adding declarations can lead to a significant speedup. If you
are a novice Lisp programmer, you should use type declarations
sparingly, as there may be no checking to see if the
declarations are correct, and optimized code can be harder to
debug. Wrong declarations can lead to errors in otherwise
correct code, and can limit the reuse of code in other
contexts. Depending on the Lisp compiler, it may also
be necessary to declare the type of results using THE, since
some compilers don't deduce the result type from the inputs.
- check the code produced by the compiler by using the
disassemble function
----------------------------------------------------------------
Subject: [1-4] Where can I learn about implementing Lisp interpreters
and compilers?
Books about Lisp implementation include:
1. John Allen
"Anatomy of Lisp"
McGraw-Hill, 1978. 446 pages. ISBN 0-07-001115-X
Discusses some of the fundamental issues involved in
the implemention of Lisp.
2. Samuel Kamin
"Programming Languages, An Interpreter-Based Approach"
Addison-Wesley, Reading, Mass., 1990. ISBN 0-201-06824-9
Includes sources to several interpreters for Lisp-like
languages, and a pointer to sources via anonymous ftp.
3. Sharam Hekmatpour
"Lisp: A Portable Implementation"
Prentice Hall, 1985. ISBN 0-13-537490-X.
Describes a portable implementation of a small dynamic
Lisp interpreter (including C source code).
4. Peter Henderson
"Functional Programming: Application and Implementation"
Prentice-Hall (Englewood Cliffs, NJ), 1980. 355 pages.
5. Peter M. Kogge
"The Architecture of Symbolic Computers"
McGraw-Hill, 1991. ISBN 0-07-035596-7.
Includes sections on memory management, the SECD and
Warren Abstract Machines, and overviews of the various
Lisp Machine architectures.
6. Daniel P. Friedman, Mitchell Wand, and Christopher T. Haynes
"Essentials of Programming Languages"
MIT Press, 1992, 536 pages. ISBN 0-262-06145-7.
Teaches fundamental concepts of programming language
design by using small interpreters as examples. Covers
most of the features of Scheme. Includes a discussion
of parameter passing techniques, object oriented languages,
and techniques for transforming interpreters to allow
their implementation in terms of any low-level language.
Also discusses scanners, parsers, and the derivation of
a compiler and virtual machine from an interpreter.
Source files available by anonymous ftp from cs.indiana.edu
in the directory /pub/eopl (129.79.254.191).
7. Peter Lee, editor, "Topics in Advanced Language Implementation",
The MIT Press, Cambridge, Mass., 1991.
Articles relevant to the implementation of functional
programming languages.
8. Also see the proceedings of the biannual ACM Lisp and Functional
Programming conferences, the implementation notes for CMU Common Lisp,
Norvig's book, and SICP (Abelson & Sussman).
----------------------------------------------------------------
Subject: [1-5] What is the "minimal" set of primitives needed for a Lisp
interpreter?
Many Lisp functions can be defined in terms of other Lisp functions.
For example, CAAR can be defined in terms of CAR as
(defun caar (list) (car (car list)))
It is then natural to ask whether there is a "minimal" or smallest set
of primitives necessary to implement the language.
There is no single "best" minimal set of primitives; it all depends on
the implementation. For example, even something as basic as numbers
need not be primitive, and can be represented as lists. One possible
set of primitives might include CAR, CDR, and CONS for manipulation of
S-expressions, READ and PRINT for the input/output of S-expressions
and APPLY and EVAL for the guts of an interpreter. But then you might
want to add LAMBDA for functions, EQ for equality, COND for
conditionals, SET for assignment, and DEFUN for definitions. QUOTE
might come in handy as well. If you add more specialized datatypes,
such as integers, floats, arrays, characters, and structures, you'll
need to add primitives to construct and access each.
AWKLisp is a Lisp interpreter written in Lisp, available by anonymous
ftp from ftp.cs.cmu.edu:user/ai/lang/lisp/impl/awk/. It has thirteen
built-in functions: CAR, CDR, CONS, EQ, ATOM, SET, EVAL, ERROR, QUOTE,
COND, AND, OR, LIST.
A more practical notion of a "minimal" set of primitives might be to
look at the implementation of Scheme. While many Scheme functions can
be derived from others, the language is much smaller than Common Lisp.
See Dybvig's PhD thesis,
R. Kent Dybvig, "Three Implementation Models for Scheme", Department
of Computer Science Technical Report #87-011, University of North
Carolina at Chapel Hill, Chapel Hill, North Carolina, April 1987.
for a justification of a particularly practical minimal set of
primitives for Scheme.
In a language like Common Lisp, however, there are a lot of low-level
primitive functions that cannot be written in terms of the others,
such as GET-UNIVERSAL-TIME, READ-CHAR, WRITE-CHAR, OPEN, and CLOSE,
for starters. Moreover, real Common Lisp implementations are often
built upon primitives that aren't part of the language, per se, and
certainly not intended to be user-accessible, such as SYS:%POINTER-REF.
Beside the references listed in [1-4], some other relevant references
include:
McCarthy, John, "Recursive Functions of Symbolic Expressions and
their Computation by Machine, Part I", CACM 3(4):185-195, April 1960.
[Defines five elementary functions on s-expressions.]
McCarthy, John, "A Micro-Manual for Lisp -- not the whole Truth",
ACM SIGPLAN Notices, 13(8):215-216, August 1978.
[Defines the Lisp programming language in 10 rules and gives
a small interpreter (eval) written in this Lisp.]
McCarthy, John, et al., "LISP 1.5 Programmer's Manual", 2nd edition,
MIT Press, 1965, ISBN 0-262-13011-4 (paperback).
[Gives five basic functions, CAR, CDR, CONS, EQ, and ATOM.
Using composition, conditional expressions (COND), and
recursion, LAMBDA, and QUOTE, these basic functions may be used
to construct the entire class of computable functions of
S-expressions. Gives the functions EVAL and APPLY in
M-expression syntax.]
Abelson and Sussman's SICP, especially chapters 4 and 5 on the
implementation of meta-circular aUï∞ü∞WVìF≡PÜ(αâ─ìF≡PÜ0αâ─Ä┬ï╪ï√îF÷&èO╕╙αëF°&ïGï╚&ïG║ï≥Ö≈■╛<ï┴ï╩ï╨ï┴ëå⌠■ï┬Ö≈■ï╞ï╩≈«⌠■ï≡±╗Ä$6ë₧·■îåⁿ■&╟ ╗~Ä&6ë₧÷■îå°■&ïÄF÷&9EtLÉΦ2╕pP3└P ╢°■ ╢÷■Üαâ─ÄF÷&ïE─₧÷■&ëÄ(6&â>ptÄ*6&â>vt
Ü£┘ÜT┘ÄF÷& E╟F·Ä,6&â>Θ▀ë~⌠╟F■╕⌠╣ùëå≡■ëÄ≥■ëvⁿïFⁿ─₧≡■&─^■ë₧∞■îåε■&9~ΘÖï├î┬ì~öï≤Ä┌╣-≤ÑñèFó*ΣàF°tz8f╥tèF╥─^⌠&8GuiÇ~╤tèF╤─^⌠&8GuWïFⁿ+Fö;Fû| ïFⁿ9Föuâ~ût÷Fÿ@t8èFú─^⌠&8Gt,ïFⁿ+Fö;Fû~<Ä.6&â>t0─^⌠&èG─₧≡■&─ïv■&ê@âF■[ F·ïF·Ä,6&9~Θ2 Θ⌡èFú─^⌠&8Gu÷FÖu╙ïv·Θzïv·─₧·■&ë7╗XÄ06ë₧Φ■îåΩ■&─?& ╡& ╡Ü£┘â─ìDP─₧Φ■&─& ╖╥& ╖╨Ü┌α â─Ä26&â>|uÄ46&╟zÄ66&╟¬─^⌠&èGï╚ï╞╗[≈δï╪Ä86&─>⌠&êIÄ86&─⌠ï°&Ça■ÉΦÇ~¿t;èF¿*ΣP─₧Φ■&─& ╖╓& ╖╘Ü┌α â─Ä46&╟zèF¿*ΣPܵ┘â─ΘvÄ:6&í▓&░uΘdÄ26&â>|uÄ46&╟z─₧Φ■&─& ╖┌& ╖╪Ü┌α â─Ä<6& 6¿& 6ªÜ`┘â─Üû┘ܼα ╕PÜ,╣â─Ä>6&íF&ïHëåΣ■ëûµ■╨t8 ╢µ■Pìå■■PÜ╝
αâ─÷|ìF▒Pìå■■PÜh
αâ─ìå■■PÜ╠┘â─Ä:6& 6▓& 6░ìå■■PÜ╝
αâ─÷|ìF▒Pìå■■PÜh
αâ─ìå■■PÜ╠┘â─Ä*6&â>vtܼα Ü«┘ÜB┘Ül┘░P░PÜ╢] â─Ä@6& 6á& 6₧Ü`┘â──₧Φ■&─& ╖▐& ╖▄Ü┌α â─╕pPÜ╒ â─ÄB6&úR&ëT─₧·■&ë7ïF₧ÄD6&úïFáÄF6&ú Üf┘─₧·■&ë7÷FÿtÄH6&Ç&│ÄJ6&╞ƒδÉÄH6&Ç│ÇÄJ6&╞ƒèfÖ%=└≈╪ÄL6&úïF₧ÄD6&úïFáÄF6&ú ^_ïσ]╦ÉUï∞ü∞▐VÄN6& 6 & 6ìår PÜ╝
αâ─ÄN6& 6 & 6ìå" PÜ╝
αâ─╕vPìår PÜh
αâ─╕éPìå" PÜh
αâ─ìFαPìår PÜXXαâ─@uΘNìF┬Pìå" PÜXXαâ─@uQÄN6& 6 & 6ìå" PÜ╝
αâ─ÄP6& 6(& 6&ìå" PÜh
αâ─ìF┬Pìå" PÜXXαâ─@uΘτïF≥ïV⌠9V╓vΘ┘r9F╘vΘ╧â~≡}Θ╞ â~ε[sΘ╗╕ÇPìår PܬCαâ─ï≡â■ uΘƒ╞år ╕Pìår PVÜj3αâ─ 6d 6bìår PÜ°
αâ─└ud╕pP╕~╣ùQPVÜj3αâ─ìF■PïFε-ÇPÄ86& 6÷& 6⌠VÜPαâ─ÄR6&╟╕[ÖRPïFεïV≡-Çâ┌RPÜ║αÄ,6&úVÜ╚2αâ─^ïσ]╦Uï∞ü∞╘WV+└PPÜ(αâ─ëFⁿëV■ÄN6& 6 & 6ìFäPÜ╝
αâ─ÄN6& 6 & 6ìå4 PÜ╝
αâ─╕ÄPìFäPÜh
αâ─╕ÜPìå4 PÜh
αâ─ìF╘Pìå4 PÜXXαâ─@uQÄN6& 6 & 6ìå4 PÜ╝
αâ─ÄP6& 6(& 6&ìå4 PÜh
αâ─ìF╘Pìå4 PÜXXαâ─@uΘ3ïFµïVΦ9V■w1r9Fⁿs*ëF≥ëV⌠ëF÷ëV°Ä06&─X& ╖Γ& ╖αÜ┌α â─δÉïFⁿïV■ëF≥ëV⌠ëF÷ëV°╕ÇP╕üPìFäPܬCαâ─ï≡â■ uΘ╞╕P 6d 6bVÜh4αâ─╕pP╕~╣ùQPVÜh4αâ─3 ╗Ä,6ë₧0 îå2 &9?~Dëvⁿ3╔ëN■ï±╕ùÄ╪─⌠▐â├ë₧, îå. &÷Gt&÷u&Çg■â╞[G─₧0 &9?╨ïvⁿìF·P╕[─₧0 &≈/PÄ86& 6÷& 6⌠VÜWαâ─VÜ╚2αâ─ìF≥PìFäPÜ«Rαâ─^_ïσ]╦ÉUï∞â∞TWVÄN6& 6 & 6ìF¼PÜ╝
αâ─╕ªPìF¼PÜh
αâ─╕▓PìF¼PÜ¿αâ─ï≡ëV■╨t)ïF■PV╣Q╣pQ╣~║ùRQï°Üxαâ─WVܪαâ─^_ïσ]╦ÉUï∞â∞"WVìFΦPÜ(αâ─ìFΦPÜ0αâ─ï°ëVε╕<Ä┬&≈m&EëF⌠ÄT6&╟ ÄFε&èM╕╙αëF≡╟F÷╕& E╟F·ë~∞Ä,6&íëFµ└Θ╔Ä86&í⌠&ï÷ï╪ëV■Ä$6&íëFΣïN·╕╘Ä╪9NΣuΘïâ~t ÄF■&÷-------------------------------------
;;; *EOF*