home *** CD-ROM | disk | FTP | other *** search
Unknown | 1984-10-20 | 8.2 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Follin Player Module (music/follinPlayer)
| ext
| Supported |
100%
| file
| data
| default
| |
100%
| gt2
| Kopftext: 'FASL FILE
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 41 53 4c 20 46 49 4c | 45 0d 0a 43 6f 70 79 72 |FASL FIL|E..Copyr|
|00000010| 69 67 68 74 20 28 63 29 | 20 31 39 38 34 20 53 61 |ight (c)| 1984 Sa|
|00000020| 6e 20 4d 61 72 63 6f 20 | 41 73 73 6f 63 69 61 74 |n Marco |Associat|
|00000030| 65 73 0d 0a 09 41 6c 6c | 20 72 69 67 68 74 73 20 |es...All| rights |
|00000040| 72 65 73 65 72 76 65 64 | 2e 0d 0a 1a ff 07 04 55 |reserved|.......U|
|00000050| 53 45 52 0e 0d 00 00 00 | 00 07 04 4c 49 53 50 0e |SER.....|...LISP.|
|00000060| 0b 01 04 53 45 54 46 07 | 0a 47 45 54 2d 4c 45 53 |...SETF.|.GET-LES|
|00000070| 53 4f 4e 0b 01 05 51 55 | 4f 54 45 07 07 44 45 46 |SON...QU|OTE..DEF|
|00000080| 55 4e 2d 49 04 10 02 04 | 10 02 0b 01 05 51 55 4f |UN-I....|.....QUO|
|00000090| 54 45 07 06 4c 45 53 53 | 4f 4e 07 07 44 45 46 55 |TE..LESS|ON..DEFU|
|000000a0| 4e 2d 49 0b 01 04 4e 41 | 4d 45 07 07 44 45 46 55 |N-I...NA|ME..DEFU|
|000000b0| 4e 2d 49 04 10 01 07 04 | 4e 45 58 54 07 07 49 4e |N-I.....|NEXT..IN|
|000000c0| 53 45 52 54 31 04 10 01 | 07 08 50 52 45 56 49 4f |SERT1...|..PREVIO|
|000000d0| 55 53 07 07 49 4e 53 45 | 52 54 32 04 10 01 07 0b |US..INSE|RT2.....|
|000000e0| 4c 45 53 53 4f 4e 2d 4e | 41 4d 45 26 18 4d 61 6b |LESSON-N|AME&.Mak|
|000000f0| 69 6e 67 20 4c 69 74 74 | 6c 65 20 50 72 6f 63 65 |ing Litt|le Proce|
|00000100| 64 75 72 65 73 04 10 01 | 04 10 08 07 05 53 4c 49 |dures...|.....SLI|
|00000110| 44 45 07 0a 45 58 50 4f | 53 49 54 49 4f 4e 23 01 |DE..EXPO|SITION#.|
|00000120| 00 00 00 04 07 0a 45 58 | 50 4f 53 49 54 49 4f 4e |......EX|POSITION|
|00000130| 26 ef 0a 4c 49 53 50 20 | 65 6e 63 6f 75 72 61 67 |&..LISP |encourag|
|00000140| 65 73 20 79 6f 75 20 74 | 6f 20 63 72 65 61 74 65 |es you t|o create|
|00000150| 20 73 6d 61 6c 6c 2c 20 | 65 61 73 69 6c 79 20 64 | small, |easily d|
|00000160| 65 62 75 67 67 65 64 20 | 70 72 6f 63 65 64 75 72 |ebugged |procedur|
|00000170| 65 73 2e 20 0a 44 45 46 | 55 4e 20 69 73 20 4c 49 |es. .DEF|UN is LI|
|00000180| 53 50 27 73 20 70 72 6f | 63 65 64 75 72 65 2d 63 |SP's pro|cedure-c|
|00000190| 72 65 61 74 69 6e 67 20 | 70 72 69 6d 69 74 69 76 |reating |primitiv|
|000001a0| 65 2e 0a 0a 41 64 76 61 | 6e 63 65 64 20 75 73 65 |e...Adva|nced use|
|000001b0| 72 73 20 6f 66 74 65 6e | 20 75 73 65 20 74 68 69 |rs often| use thi|
|000001c0| 6e 67 73 20 63 61 6c 6c | 65 64 20 6f 70 74 69 6f |ngs call|ed optio|
|000001d0| 6e 61 6c 20 70 61 72 61 | 6d 65 74 65 72 73 20 6f |nal para|meters o|
|000001e0| 72 0a 63 72 65 61 74 65 | 20 6e 61 6d 65 6c 65 73 |r.create| nameles|
|000001f0| 73 20 70 72 6f 63 65 64 | 75 72 65 73 2c 20 66 65 |s proced|ures, fe|
|00000200| 61 74 75 72 65 73 20 64 | 65 73 63 72 69 62 65 64 |atures d|escribed|
|00000210| 20 69 6e 20 6f 74 68 65 | 72 20 74 72 61 79 73 2e | in othe|r trays.|
|00000220| 0a 23 07 00 00 00 10 01 | 04 27 03 00 00 00 2e 27 |.#......|.'.....'|
|00000230| 05 00 00 00 2e 07 05 53 | 4c 49 44 45 07 0a 45 58 |.......S|LIDE..EX|
|00000240| 50 4f 53 49 54 49 4f 4e | 23 02 00 00 00 04 07 0a |POSITION|#.......|
|00000250| 45 58 50 4f 53 49 54 49 | 4f 4e 25 db 01 00 00 0a |EXPOSITI|ON%.....|
|00000260| 53 75 70 70 6f 73 65 20 | 79 6f 75 20 77 61 6e 74 |Suppose |you want|
|00000270| 20 74 6f 20 6d 61 6b 65 | 20 61 20 6e 65 77 20 6c | to make| a new l|
|00000280| 69 73 74 20 6f 75 74 20 | 6f 66 20 74 68 65 20 66 |ist out |of the f|
|00000290| 69 72 73 74 20 61 6e 64 | 20 6c 61 73 74 0a 65 6c |irst and| last.el|
|000002a0| 65 6d 65 6e 74 73 20 6f | 66 20 61 6e 20 6f 6c 64 |ements o|f an old|
|000002b0| 20 6c 69 73 74 2e 00 02 | 53 75 70 70 6f 73 65 2c | list...|Suppose,|
|000002c0| 20 66 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 74 68 | for exa|mple, th|
|000002d0| 61 74 20 74 68 65 20 6f | 6c 64 20 6c 69 73 74 0a |at the o|ld list.|
|000002e0| 69 73 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |is the v|alue of |
|000002f0| 4c 3a 0a 0a 2a 20 4c 0a | 28 41 20 42 20 43 20 44 |L:..* L.|(A B C D|
|00000300| 20 45 29 0a 0a 54 68 65 | 6e 20 74 68 65 20 6e 65 | E)..The|n the ne|
|00000310| 77 2c 20 64 65 73 69 72 | 65 64 20 6c 69 73 74 20 |w, desir|ed list |
|00000320| 69 73 20 28 41 20 45 29 | 2e 0a 0a 4e 6f 77 20 72 |is (A E)|...Now r|
|00000330| 65 63 61 6c 6c 20 74 68 | 61 74 20 4c 41 53 54 20 |ecall th|at LAST |
|00000340| 69 73 20 61 20 70 72 69 | 6d 69 74 69 76 65 20 74 |is a pri|mitive t|
|00000350| 68 61 74 20 72 65 6d 6f | 76 65 73 20 61 6c 6c 20 |hat remo|ves all |
|00000360| 62 75 74 20 74 68 65 0a | 6c 61 73 74 20 65 6c 65 |but the.|last ele|
|00000370| 6d 65 6e 74 20 66 72 6f | 6d 20 61 20 6c 69 73 74 |ment fro|m a list|
|00000380| 3a 0a 0a 2a 20 28 4c 41 | 53 54 20 4c 29 0a 28 45 |:..* (LA|ST L).(E|
|00000390| 29 0a 0a 43 6f 6e 73 65 | 71 75 65 6e 74 6c 79 2c |)..Conse|quently,|
|000003a0| 20 79 6f 75 20 63 61 6e | 20 6d 61 6b 65 20 74 68 | you can| make th|
|000003b0| 65 20 64 65 73 69 72 65 | 64 20 6c 69 73 74 20 74 |e desire|d list t|
|000003c0| 68 69 73 20 77 61 79 3a | 0a 0a 2a 20 28 43 4f 4e |his way:|..* (CON|
|000003d0| 53 20 28 46 49 52 53 54 | 20 4c 29 20 28 4c 41 53 |S (FIRST| L) (LAS|
|000003e0| 54 20 4c 29 29 00 02 3b | 28 4c 41 53 54 20 4c 29 |T L))..;|(LAST L)|
|000003f0| 20 72 65 74 75 72 6e 73 | 20 28 45 29 2e 0a 28 41 | returns| (E)..(A|
|00000400| 20 45 29 00 18 3b 28 46 | 49 52 53 54 20 4c 29 20 | E)..;(F|IRST L) |
|00000410| 72 65 74 75 72 6e 73 20 | 41 2e 0a 00 1d 3b 43 4f |returns |A....;CO|
|00000420| 4e 53 20 6f 66 20 41 20 | 61 6e 64 20 28 45 29 20 |NS of A |and (E) |
|00000430| 69 73 20 28 41 20 45 29 | 2e 0a 23 16 00 00 00 10 |is (A E)|..#.....|
|00000440| 01 04 27 03 00 00 00 2e | 27 05 00 00 00 2e 07 05 |..'.....|'.......|
|00000450| 53 4c 49 44 45 07 0a 45 | 58 50 4f 53 49 54 49 4f |SLIDE..E|XPOSITIO|
|00000460| 4e 23 03 00 00 00 04 07 | 0a 45 58 50 4f 53 49 54 |N#......|.EXPOSIT|
|00000470| 49 4f 4e 26 e4 0a 4f 66 | 20 63 6f 75 72 73 65 2c |ION&..Of| course,|
|00000480| 20 74 68 65 20 63 6f 6d | 62 69 6e 61 74 69 6f 6e | the com|bination|
|00000490| 20 6f 66 20 43 4f 4e 53 | 2c 20 46 49 52 53 54 2c | of CONS|, FIRST,|
|000004a0| 20 61 6e 64 20 4c 41 53 | 54 20 77 69 6c 6c 20 77 | and LAS|T will w|
|000004b0| 6f 72 6b 20 6e 6f 0a 6d | 61 74 74 65 72 20 77 68 |ork no.m|atter wh|
|000004c0| 61 74 2c 20 61 73 20 6c | 6f 6e 67 20 61 73 20 4c |at, as l|ong as L|
|000004d0| 20 69 73 20 61 20 6c 69 | 73 74 3a 0a 0a 2a 20 28 | is a li|st:..* (|
|000004e0| 53 45 54 46 20 4c 20 27 | 28 53 54 41 52 54 20 4c |SETF L '|(START L|
|000004f0| 20 4d 20 4e 20 46 49 4e | 49 53 48 29 29 0a 28 53 | M N FIN|ISH)).(S|
|00000500| 54 41 52 54 20 4c 20 4d | 20 4e 20 46 49 4e 49 53 |TART L M| N FINIS|
|00000510| 48 29 0a 0a 2a 20 4c 0a | 28 53 54 41 52 54 20 4c |H)..* L.|(START L|
|00000520| 20 4d 20 4e 20 46 49 4e | 49 53 48 29 0a 0a 2a 20 | M N FIN|ISH)..* |
|00000530| 28 43 4f 4e 53 20 28 46 | 49 52 53 54 20 4c 29 20 |(CONS (F|IRST L) |
|00000540| 28 4c 41 53 54 20 4c 29 | 29 0a 28 53 54 41 52 54 |(LAST L)|).(START|
|00000550| 20 46 49 4e 49 53 48 29 | 0a 23 0d 00 00 00 10 01 | FINISH)|.#......|
|00000560| 04 27 03 00 00 00 2e 27 | 05 00 00 00 2e 07 05 53 |.'.....'|.......S|
|00000570| 4c 49 44 45 07 0a 45 58 | 50 4f 53 49 54 49 4f 4e |LIDE..EX|POSITION|
|00000580| 23 04 00 00 00 04 07 0a | 45 58 50 4f 53 49 54 49 |#.......|EXPOSITI|
|00000590| 4f 4e 25 57 01 00 00 0a | 4e 6f 77 20 73 75 70 70 |ON%W....|Now supp|
|000005a0| 6f 73 65 20 79 6f 75 20 | 6f 66 74 65 6e 20 77 61 |ose you |often wa|
|000005b0| 6e 74 20 74 6f 20 70 69 | 63 6b 20 74 68 65 20 66 |nt to pi|ck the f|
|000005c0| 69 72 73 74 20 61 6e 64 | 20 6c 61 73 74 20 65 6c |irst and| last el|
|000005d0| 65 6d 65 6e 74 20 6f 75 | 74 0a 6f 66 20 61 20 6c |ement ou|t.of a l|
|000005e0| 69 73 74 2e 00 02 59 6f | 75 20 77 69 73 68 20 74 |ist...Yo|u wish t|
|000005f0| 68 65 72 65 20 77 65 72 | 65 20 61 20 70 72 6f 63 |here wer|e a proc|
|00000600| 65 64 75 72 65 2c 20 42 | 4f 54 48 2d 45 4e 44 53 |edure, B|OTH-ENDS|
|00000610| 2c 20 73 75 63 68 20 74 | 68 61 74 0a 79 6f 75 20 |, such t|hat.you |
|00000620| 77 6f 75 6c 64 6e 27 74 | 20 68 61 76 65 20 74 6f |wouldn't| have to|
|00000630| 20 72 65 6d 65 6d 62 65 | 72 20 74 68 65 20 43 4f | remembe|r the CO|
|00000640| 4e 53 2d 46 49 52 53 54 | 2d 4c 41 53 54 20 63 6f |NS-FIRST|-LAST co|
|00000650| 6d 62 69 6e 61 74 69 6f | 6e 3a 0a 0a 2a 20 28 53 |mbinatio|n:..* (S|
|00000660| 45 54 46 20 4c 20 27 28 | 41 20 42 20 43 20 44 20 |ETF L '(|A B C D |
|00000670| 45 29 29 0a 28 41 20 42 | 20 43 20 44 20 45 29 0a |E)).(A B| C D E).|
|00000680| 0a 2a 20 28 42 4f 54 48 | 2d 45 4e 44 53 20 4c 29 |.* (BOTH|-ENDS L)|
|00000690| 0a 28 41 20 45 29 0a 0a | 2a 20 28 53 45 54 46 20 |.(A E)..|* (SETF |
|000006a0| 4c 20 27 28 53 54 41 52 | 54 20 4c 20 4d 20 4e 20 |L '(STAR|T L M N |
|000006b0| 46 49 4e 49 53 48 29 29 | 0a 28 53 54 41 52 54 20 |FINISH))|.(START |
|000006c0| 4c 20 4d 20 4e 20 46 49 | 4e 49 53 48 29 0a 0a 2a |L M N FI|NISH)..*|
|000006d0| 20 28 42 4f 54 48 2d 45 | 4e 44 53 20 4c 29 0a 28 | (BOTH-E|NDS L).(|
|000006e0| 53 54 41 52 54 20 46 49 | 4e 49 53 48 29 0a 23 11 |START FI|NISH).#.|
|000006f0| 00 00 00 10 01 04 27 03 | 00 00 00 2e 27 05 00 00 |......'.|....'...|
|00000700| 00 2e 07 05 53 4c 49 44 | 45 07 0a 45 58 50 4f 53 |....SLID|E..EXPOS|
|00000710| 49 54 49 4f 4e 23 05 00 | 00 00 04 07 0a 45 58 50 |ITION#..|.....EXP|
|00000720| 4f 53 49 54 49 4f 4e 25 | ee 01 00 00 0a 48 61 70 |OSITION%|.....Hap|
|00000730| 70 69 6c 79 2c 20 79 6f | 75 20 63 61 6e 20 63 72 |pily, yo|u can cr|
|00000740| 65 61 74 65 20 61 20 42 | 4f 54 48 2d 45 4e 44 53 |eate a B|OTH-ENDS|
|00000750| 20 70 72 6f 63 65 64 75 | 72 65 20 62 79 20 74 65 | procedu|re by te|
|00000760| 6c 6c 69 6e 67 20 4c 49 | 53 50 0a 77 68 61 74 20 |lling LI|SP.what |
|00000770| 79 6f 75 20 77 61 6e 74 | 20 42 4f 54 48 2d 45 4e |you want| BOTH-EN|
|00000780| 44 53 20 74 6f 20 64 6f | 2e 00 03 48 65 72 65 20 |DS to do|...Here |
|00000790| 69 73 20 77 68 61 74 20 | 79 6f 75 20 6e 65 65 64 |is what |you need|
|000007a0| 20 74 6f 20 73 61 79 3a | 0a 0a 59 6f 75 20 74 65 | to say:|..You te|
|000007b0| 6c 6c 20 4c 49 53 50 20 | 74 68 61 74 20 77 68 65 |ll LISP |that whe|
|000007c0| 6e 65 76 65 72 20 69 74 | 20 73 65 65 73 20 0a 0a |never it| sees ..|
|000007d0| 28 42 4f 54 48 2d 45 4e | 44 53 20 3c 61 72 67 75 |(BOTH-EN|DS <argu|
|000007e0| 6d 65 6e 74 3e 29 0a 0a | 74 68 65 20 72 65 73 75 |ment>)..|the resu|
|000007f0| 6c 74 20 6d 75 73 74 20 | 62 65 20 65 78 61 63 74 |lt must |be exact|
|00000800| 6c 79 20 61 73 20 69 66 | 20 74 68 65 72 65 20 77 |ly as if| there w|
|00000810| 65 72 65 20 74 68 65 73 | 65 20 66 6f 75 72 20 73 |ere thes|e four s|
|00000820| 74 65 70 73 3a 0a 0a 31 | 2e 20 4d 61 6b 65 20 4c |teps:..1|. Make L|
|00000830| 27 73 20 76 61 6c 75 65 | 20 62 65 20 74 68 65 20 |'s value| be the |
|00000840| 76 61 6c 75 65 20 6f 66 | 20 3c 61 72 67 75 6d 65 |value of| <argume|
|00000850| 6e 74 3e 20 74 65 6d 70 | 6f 72 61 72 69 6c 79 2e |nt> temp|orarily.|
|00000860| 0a 0a 32 2e 20 45 76 61 | 6c 75 61 74 65 20 28 43 |..2. Eva|luate (C|
|00000870| 4f 4e 53 20 28 46 49 52 | 53 54 20 4c 29 20 28 4c |ONS (FIR|ST L) (L|
|00000880| 41 53 54 20 4c 29 29 20 | 61 6e 64 20 72 65 6d 65 |AST L)) |and reme|
|00000890| 6d 62 65 72 20 74 68 65 | 20 72 65 73 75 6c 74 2e |mber the| result.|
|000008a0| 0a 0a 33 2e 20 52 65 73 | 74 6f 72 65 20 4c 27 73 |..3. Res|tore L's|
|000008b0| 20 76 61 6c 75 65 20 74 | 6f 20 77 68 61 74 20 69 | value t|o what i|
|000008c0| 74 20 75 73 65 64 20 74 | 6f 20 62 65 2c 20 69 66 |t used t|o be, if|
|000008d0| 20 61 6e 79 74 68 69 6e | 67 2e 0a 0a 34 2e 20 52 | anythin|g...4. R|
|000008e0| 65 74 75 72 6e 20 74 68 | 65 20 72 65 73 75 6c 74 |eturn th|e result|
|000008f0| 20 6f 66 20 65 76 61 6c | 75 61 74 69 6e 67 20 28 | of eval|uating (|
|00000900| 43 4f 4e 53 20 28 46 49 | 52 53 54 20 4c 29 20 28 |CONS (FI|RST L) (|
|00000910| 4c 41 53 54 20 4c 29 29 | 2e 0a 23 12 00 00 00 10 |LAST L))|..#.....|
|00000920| 01 04 27 03 00 00 00 2e | 27 05 00 00 00 2e 07 05 |..'.....|'.......|
|00000930| 53 4c 49 44 45 07 0a 45 | 58 50 4f 53 49 54 49 4f |SLIDE..E|XPOSITIO|
|00000940| 4e 23 06 00 00 00 04 07 | 0a 45 58 50 4f 53 49 54 |N#......|.EXPOSIT|
|00000950| 49 4f 4e 25 0a 02 00 00 | 0a 4e 6f 77 20 6c 65 74 |ION%....|.Now let|
|00000960| 27 73 20 67 6f 20 74 68 | 72 6f 75 67 68 20 74 68 |'s go th|rough th|
|00000970| 65 20 73 74 65 70 73 20 | 61 67 61 69 6e 3a 0a 0a |e steps |again:..|
|00000980| 57 68 65 6e 65 76 65 72 | 20 4c 49 53 50 20 73 65 |Whenever| LISP se|
|00000990| 65 73 0a 0a 28 42 4f 54 | 48 2d 45 4e 44 53 20 3c |es..(BOT|H-ENDS <|
|000009a0| 61 72 67 75 6d 65 6e 74 | 3e 29 0a 0a 69 74 20 6d |argument|>)..it m|
|000009b0| 75 73 74 20 61 63 74 20 | 61 73 20 69 66 20 69 74 |ust act |as if it|
|000009c0| 20 73 65 65 73 20 74 68 | 65 73 65 20 69 6e 73 74 | sees th|ese inst|
|000009d0| 72 75 63 74 69 6f 6e 73 | 3a 0a 0a 31 2e 20 4d 61 |ructions|:..1. Ma|
|000009e0| 6b 65 20 4c 27 73 20 76 | 61 6c 75 65 20 62 65 20 |ke L's v|alue be |
|000009f0| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 3c 61 72 |the valu|e of <ar|
|00000a00| 67 75 6d 65 6e 74 3e 20 | 74 65 6d 70 6f 72 61 72 |gument> |temporar|
|00000a10| 69 6c 79 2e 0a 0a 57 65 | 20 64 6f 6e 27 74 20 77 |ily...We| don't w|
|00000a20| 61 6e 74 20 74 6f 20 63 | 68 61 6e 67 65 20 4c 27 |ant to c|hange L'|
|00000a30| 73 20 76 61 6c 75 65 20 | 70 65 72 6d 61 6e 65 6e |s value |permanen|
|00000a40| 74 6c 79 20 6a 75 73 74 | 20 62 65 63 61 75 73 65 |tly just| because|
|00000a50| 20 69 74 20 69 73 0a 61 | 20 73 79 6d 62 6f 6c 20 | it is.a| symbol |
|00000a60| 75 73 65 64 20 77 68 65 | 6e 20 64 65 66 69 6e 69 |used whe|n defini|
|00000a70| 6e 67 20 42 4f 54 48 2d | 45 4e 44 53 2e 00 02 53 |ng BOTH-|ENDS...S|
|00000a80| 79 6d 62 6f 6c 73 20 77 | 68 6f 73 65 20 76 61 6c |ymbols w|hose val|
|00000a90| 75 65 73 20 61 72 65 0a | 75 73 65 64 20 69 6e 20 |ues are.|used in |
|00000aa0| 74 68 69 73 20 74 65 6d | 70 6f 72 61 72 79 20 77 |this tem|porary w|
|00000ab0| 61 79 20 61 72 65 20 63 | 61 6c 6c 65 64 20 50 41 |ay are c|alled PA|
|00000ac0| 52 41 4d 45 54 45 52 53 | 2e 0a 0a 32 2e 20 45 76 |RAMETERS|...2. Ev|
|00000ad0| 61 6c 75 61 74 65 20 28 | 43 4f 4e 53 20 28 46 49 |aluate (|CONS (FI|
|00000ae0| 52 53 54 20 4c 29 20 28 | 4c 41 53 54 20 4c 29 29 |RST L) (|LAST L))|
|00000af0| 20 61 6e 64 20 72 65 6d | 65 6d 62 65 72 20 72 65 | and rem|ember re|
|00000b00| 73 75 6c 74 2e 0a 0a 52 | 65 63 61 6c 6c 20 74 68 |sult...R|ecall th|
|00000b10| 61 74 20 65 78 70 72 65 | 73 73 69 6f 6e 73 20 74 |at expre|ssions t|
|00000b20| 68 61 74 20 6c 6f 6f 6b | 20 6c 69 6b 65 20 74 68 |hat look| like th|
|00000b30| 65 79 20 61 72 65 20 73 | 75 70 70 6f 73 65 64 20 |ey are s|upposed |
|00000b40| 74 6f 20 62 65 0a 65 76 | 61 6c 75 61 74 65 64 20 |to be.ev|aluated |
|00000b50| 61 72 65 20 63 61 6c 6c | 65 64 20 46 4f 52 4d 53 |are call|ed FORMS|
|00000b60| 2e 0a 23 14 00 00 00 10 | 01 04 27 03 00 00 00 2e |..#.....|..'.....|
|00000b70| 27 05 00 00 00 2e 07 05 | 53 4c 49 44 45 07 0a 45 |'.......|SLIDE..E|
|00000b80| 58 50 4f 53 49 54 49 4f | 4e 23 07 00 00 00 04 07 |XPOSITIO|N#......|
|00000b90| 0a 45 58 50 4f 53 49 54 | 49 4f 4e 25 69 01 00 00 |.EXPOSIT|ION%i...|
|00000ba0| 0a 31 2e 20 41 74 74 61 | 63 68 20 61 72 67 75 6d |.1. Atta|ch argum|
|00000bb0| 65 6e 74 20 76 61 6c 75 | 65 20 74 6f 20 70 61 72 |ent valu|e to par|
|00000bc0| 61 6d 65 74 65 72 2e 00 | 09 3b 52 65 76 69 65 77 |ameter..|.;Review|
|00000bd0| 2e 0a 0a 32 2e 20 45 76 | 61 6c 75 61 74 65 20 66 |...2. Ev|aluate f|
|00000be0| 6f 72 6d 2e 00 1e 3b 52 | 65 76 69 65 77 2e 0a 0a |orm...;R|eview...|
|00000bf0| 33 2e 20 52 65 73 74 6f | 72 65 20 4c 27 73 20 76 |3. Resto|re L's v|
|00000c00| 61 6c 75 65 20 74 6f 20 | 77 68 61 74 20 69 74 20 |alue to |what it |
|00000c10| 75 73 65 64 20 74 6f 20 | 62 65 2e 0a 0a 48 65 72 |used to |be...Her|
|00000c20| 65 20 69 73 20 77 68 65 | 72 65 20 77 65 20 63 6c |e is whe|re we cl|
|00000c30| 65 61 6e 20 75 70 2e 00 | 02 49 66 20 4c 20 68 61 |ean up..|.If L ha|
|00000c40| 64 20 61 20 76 61 6c 75 | 65 20 62 65 66 6f 72 65 |d a valu|e before|
|00000c50| 2c 20 72 65 73 74 6f 72 | 65 20 69 74 2e 20 0a 49 |, restor|e it. .I|
|00000c60| 66 20 69 74 20 68 61 64 | 20 6e 6f 6e 65 2c 20 6d |f it had| none, m|
|00000c70| 61 6b 65 20 69 74 20 68 | 61 76 65 20 6e 6f 6e 65 |ake it h|ave none|
|00000c80| 20 6e 6f 77 2e 0a 0a 34 | 2e 20 52 65 74 75 72 6e | now...4|. Return|
|00000c90| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 65 | the res|ult of e|
|00000ca0| 76 61 6c 75 61 74 69 6e | 67 20 28 43 4f 4e 53 20 |valuatin|g (CONS |
|00000cb0| 28 46 49 52 53 54 20 4c | 29 20 28 4c 41 53 54 20 |(FIRST L|) (LAST |
|00000cc0| 4c 29 29 2e 0a 0a 54 68 | 69 73 20 69 73 20 77 68 |L))...Th|is is wh|
|00000cd0| 65 72 65 20 4c 49 53 50 | 20 64 65 6c 69 76 65 72 |ere LISP| deliver|
|00000ce0| 73 20 77 68 61 74 20 42 | 4f 54 48 2d 45 4e 44 53 |s what B|OTH-ENDS|
|00000cf0| 20 69 73 20 73 75 70 70 | 6f 73 65 64 20 74 6f 20 | is supp|osed to |
|00000d00| 72 65 74 75 72 6e 2e 0a | 0a 23 0f 00 00 00 10 01 |return..|.#......|
|00000d10| 04 27 03 00 00 00 2e 27 | 05 00 00 00 2e 07 05 53 |.'.....'|.......S|
|00000d20| 4c 49 44 45 07 0a 45 58 | 50 4f 53 49 54 49 4f 4e |LIDE..EX|POSITION|
|00000d30| 23 08 00 00 00 04 07 0a | 45 58 50 4f 53 49 54 49 |#.......|EXPOSITI|
|00000d40| 4f 4e 26 b0 0a 4e 6f 77 | 20 77 65 20 6e 65 65 64 |ON&..Now| we need|
|00000d50| 20 61 20 77 61 79 20 74 | 6f 20 74 65 6c 6c 20 4c | a way t|o tell L|
|00000d60| 49 53 50 20 65 78 61 63 | 74 6c 79 20 77 68 61 74 |ISP exac|tly what|
|00000d70| 20 74 6f 20 64 6f 20 69 | 6e 20 74 68 65 20 66 6f | to do i|n the fo|
|00000d80| 75 72 20 73 74 65 70 73 | 3a 0a 0a 31 2e 20 41 74 |ur steps|:..1. At|
|00000d90| 74 61 63 68 20 61 72 67 | 75 6d 65 6e 74 20 76 61 |tach arg|ument va|
|00000da0| 6c 75 65 20 74 6f 20 70 | 61 72 61 6d 65 74 65 72 |lue to p|arameter|
|00000db0| 2e 0a 0a 32 2e 20 45 76 | 61 6c 75 61 74 65 20 66 |...2. Ev|aluate f|
|00000dc0| 6f 72 6d 2e 0a 0a 33 2e | 20 52 65 73 74 6f 72 65 |orm...3.| Restore|
|00000dd0| 20 70 61 72 61 6d 65 74 | 65 72 20 76 61 6c 75 65 | paramet|er value|
|00000de0| 2e 0a 0a 34 2e 20 52 65 | 74 75 72 6e 20 76 61 6c |...4. Re|turn val|
|00000df0| 75 65 2e 0a 23 0b 00 00 | 00 10 01 04 27 03 00 00 |ue..#...|....'...|
|00000e00| 00 2e 27 05 00 00 00 2e | 07 05 53 4c 49 44 45 07 |..'.....|..SLIDE.|
|00000e10| 0a 45 58 50 4f 53 49 54 | 49 4f 4e 23 09 00 00 00 |.EXPOSIT|ION#....|
|00000e20| 04 07 0a 45 58 50 4f 53 | 49 54 49 4f 4e 25 19 01 |...EXPOS|ITION%..|
|00000e30| 00 00 0a 57 65 20 74 65 | 6c 6c 20 4c 49 53 50 20 |...We te|ll LISP |
|00000e40| 77 68 61 74 20 74 6f 20 | 64 6f 20 75 73 69 6e 67 |what to |do using|
|00000e50| 20 74 68 65 20 70 72 69 | 6d 69 74 69 76 65 20 44 | the pri|mitive D|
|00000e60| 45 46 55 4e 2e 00 02 57 | 68 65 6e 20 75 73 65 64 |EFUN...W|hen used|
|00000e70| 2c 0a 44 45 46 55 4e 20 | 74 65 6c 6c 73 20 4c 49 |,.DEFUN |tells LI|
|00000e80| 53 50 3a 0a 0a 31 2e 20 | 54 68 65 20 6e 61 6d 65 |SP:..1. |The name|
|00000e90| 73 20 6f 66 20 74 68 65 | 20 70 61 72 61 6d 65 74 |s of the| paramet|
|00000ea0| 65 72 73 20 61 6e 64 20 | 68 6f 77 20 74 68 65 79 |ers and |how they|
|00000eb0| 20 6d 75 73 74 20 62 65 | 20 61 73 73 69 67 6e 65 | must be| assigne|
|00000ec0| 64 20 74 6f 0a 00 03 61 | 72 67 75 6d 65 6e 74 20 |d to...a|rgument |
|00000ed0| 76 61 6c 75 65 73 2e 0a | 0a 32 2e 20 54 68 65 20 |values..|.2. The |
|00000ee0| 66 6f 72 6d 73 20 74 6f | 20 62 65 20 65 76 61 6c |forms to| be eval|
|00000ef0| 75 61 74 65 64 2e 0a 0a | 4c 49 53 50 20 6b 6e 6f |uated...|LISP kno|
|00000f00| 77 73 20 69 74 20 6d 75 | 73 74 20 61 6c 77 61 79 |ws it mu|st alway|
|00000f10| 73 20 72 65 73 74 6f 72 | 65 20 70 61 72 61 6d 65 |s restor|e parame|
|00000f20| 74 65 72 20 76 61 6c 75 | 65 73 20 61 6e 64 20 72 |ter valu|es and r|
|00000f30| 65 74 75 72 6e 20 74 68 | 65 0a 76 61 6c 75 65 20 |eturn th|e.value |
|00000f40| 6f 66 20 61 20 66 6f 72 | 6d 2e 0a 23 0c 00 00 00 |of a for|m..#....|
|00000f50| 10 01 04 27 03 00 00 00 | 2e 27 05 00 00 00 2e 07 |...'....|.'......|
|00000f60| 05 53 4c 49 44 45 07 0a | 45 58 50 4f 53 49 54 49 |.SLIDE..|EXPOSITI|
|00000f70| 4f 4e 23 0a 00 00 00 04 | 07 0a 45 58 50 4f 53 49 |ON#.....|..EXPOSI|
|00000f80| 54 49 4f 4e 25 12 02 00 | 00 0a 57 68 65 6e 20 75 |TION%...|..When u|
|00000f90| 73 65 64 2c 20 61 20 73 | 69 6d 70 6c 65 20 44 45 |sed, a s|imple DE|
|00000fa0| 46 55 4e 20 6c 6f 6f 6b | 73 20 6c 69 6b 65 20 74 |FUN look|s like t|
|00000fb0| 68 69 73 3a 0a 0a 28 44 | 45 46 55 4e 20 3c 70 72 |his:..(D|EFUN <pr|
|00000fc0| 6f 63 65 64 75 72 65 20 | 6e 61 6d 65 3e 00 02 3b |ocedure |name>..;|
|00000fd0| 54 65 6c 6c 73 20 4c 49 | 53 50 20 74 68 65 20 6e |Tells LI|SP the n|
|00000fe0| 61 6d 65 20 6f 66 20 74 | 68 65 20 6e 65 77 20 70 |ame of t|he new p|
|00000ff0| 72 6f 63 65 64 75 72 65 | 2e 0a 00 02 28 3c 70 61 |rocedure|....(<pa|
|00001000| 72 61 6d 65 74 65 72 3e | 29 00 0a 3b 54 65 6c 6c |rameter>|)..;Tell|
|00001010| 73 20 4c 49 53 50 20 74 | 68 65 20 6e 61 6d 65 20 |s LISP t|he name |
|00001020| 6f 66 20 74 68 65 20 70 | 61 72 61 6d 65 74 65 72 |of the p|arameter|
|00001030| 2e 0a 00 02 3c 66 6f 72 | 6d 3e 29 00 10 3b 54 65 |....<for|m>)..;Te|
|00001040| 6c 6c 73 20 4c 49 53 50 | 20 77 68 61 74 20 74 6f |lls LISP| what to|
|00001050| 20 64 6f 20 77 69 74 68 | 20 74 68 65 20 70 61 72 | do with| the par|
|00001060| 61 6d 65 74 65 72 2e 0a | 0a 48 65 72 65 20 69 73 |ameter..|.Here is|
|00001070| 20 61 20 64 65 66 69 6e | 69 74 69 6f 6e 20 6f 66 | a defin|ition of|
|00001080| 20 42 4f 54 48 2d 45 4e | 44 53 3a 0a 0a 28 44 45 | BOTH-EN|DS:..(DE|
|00001090| 46 55 4e 20 42 4f 54 48 | 2d 45 4e 44 53 00 10 3b |FUN BOTH|-ENDS..;|
|000010a0| 50 72 6f 63 65 64 75 72 | 65 27 73 20 6e 61 6d 65 |Procedur|e's name|
|000010b0| 20 69 73 20 42 4f 54 48 | 2d 45 4e 44 53 2e 0a 00 | is BOTH|-ENDS...|
|000010c0| 02 28 4c 29 00 1b 3b 54 | 68 65 20 70 61 72 61 6d |.(L)..;T|he param|
|000010d0| 65 74 65 72 20 69 73 20 | 4c 2e 0a 00 02 28 43 4f |eter is |L....(CO|
|000010e0| 4e 53 20 28 46 49 52 53 | 54 20 4c 29 20 28 4c 41 |NS (FIRS|T L) (LA|
|000010f0| 53 54 20 4c 29 29 29 00 | 04 3b 54 68 65 20 66 6f |ST L))).|.;The fo|
|00001100| 72 6d 2e 0a 0a 4f 6e 63 | 65 20 42 4f 54 48 2d 45 |rm...Onc|e BOTH-E|
|00001110| 4e 44 53 20 69 73 20 64 | 65 66 69 6e 65 64 2c 20 |NDS is d|efined, |
|00001120| 69 74 20 69 73 20 75 73 | 65 64 20 6c 69 6b 65 20 |it is us|ed like |
|00001130| 61 6e 79 20 6f 74 68 65 | 72 20 70 72 6f 63 65 64 |any othe|r proced|
|00001140| 75 72 65 3a 0a 0a 2a 20 | 28 42 4f 54 48 2d 45 4e |ure:..* |(BOTH-EN|
|00001150| 44 53 20 27 28 41 20 42 | 20 43 20 44 20 45 29 29 |DS '(A B| C D E))|
|00001160| 0a 28 41 20 45 29 0a 0a | 2a 20 28 42 4f 54 48 2d |.(A E)..|* (BOTH-|
|00001170| 45 4e 44 53 20 27 28 53 | 54 41 52 54 20 4c 20 4d |ENDS '(S|TART L M|
|00001180| 20 4e 20 46 49 4e 49 53 | 48 29 29 0a 28 53 54 41 | N FINIS|H)).(STA|
|00001190| 52 54 20 46 49 4e 49 53 | 48 29 0a 23 15 00 00 00 |RT FINIS|H).#....|
|000011a0| 10 01 04 27 03 00 00 00 | 2e 27 05 00 00 00 2e 07 |...'....|.'......|
|000011b0| 05 53 4c 49 44 45 07 0a | 45 58 50 4f 53 49 54 49 |.SLIDE..|EXPOSITI|
|000011c0| 4f 4e 23 0b 00 00 00 04 | 07 0a 45 58 50 4f 53 49 |ON#.....|..EXPOSI|
|000011d0| 54 49 4f 4e 25 3d 01 00 | 00 0a 4c 6f 6f 6b 20 63 |TION%=..|..Look c|
|000011e0| 61 72 65 66 75 6c 6c 79 | 20 61 74 20 68 6f 77 20 |arefully| at how |
|000011f0| 74 68 65 20 67 65 6e 65 | 72 61 6c 20 70 61 74 74 |the gene|ral patt|
|00001200| 65 72 6e 20 61 6e 64 20 | 74 68 65 20 70 61 72 74 |ern and |the part|
|00001210| 69 63 75 6c 61 72 0a 65 | 78 61 6d 70 6c 65 20 63 |icular.e|xample c|
|00001220| 6f 72 72 65 73 70 6f 6e | 64 20 77 68 65 6e 20 74 |orrespon|d when t|
|00001230| 68 65 72 65 20 69 73 20 | 6f 6e 65 20 70 61 72 61 |here is |one para|
|00001240| 6d 65 74 65 72 20 61 6e | 64 20 6f 6e 65 20 66 6f |meter an|d one fo|
|00001250| 72 6d 3a 0a 0a 28 44 45 | 46 55 4e 20 3c 70 72 6f |rm:..(DE|FUN <pro|
|00001260| 63 65 64 75 72 65 20 6e | 61 6d 65 3e 00 05 28 44 |cedure n|ame>..(D|
|00001270| 45 46 55 4e 20 42 4f 54 | 48 2d 45 4e 44 53 0a 00 |EFUN BOT|H-ENDS..|
|00001280| 07 28 3c 70 61 72 61 6d | 65 74 65 72 3e 29 00 0f |.(<param|eter>)..|
|00001290| 28 4c 29 0a 00 07 3c 66 | 6f 72 6d 3e 29 00 15 28 |(L)...<f|orm>)..(|
|000012a0| 43 4f 4e 53 20 28 46 49 | 52 53 54 20 4c 29 20 28 |CONS (FI|RST L) (|
|000012b0| 4c 41 53 54 20 4c 29 29 | 29 0a 0a 45 76 69 64 65 |LAST L))|)..Evide|
|000012c0| 6e 74 6c 79 3a 0a 0a 3c | 70 72 6f 63 65 64 75 72 |ntly:..<|procedur|
|000012d0| 65 20 6e 61 6d 65 3e 00 | 06 42 4f 54 48 2d 45 4e |e name>.|.BOTH-EN|
|000012e0| 44 53 0a 0a 3c 70 61 72 | 61 6d 65 74 65 72 3e 00 |DS..<par|ameter>.|
|000012f0| 0b 4c 0a 0a 3c 66 6f 72 | 6d 3e 00 10 28 43 4f 4e |.L..<for|m>..(CON|
|00001300| 53 20 28 46 49 52 53 54 | 20 4c 29 20 28 4c 41 53 |S (FIRST| L) (LAS|
|00001310| 54 20 4c 29 29 0a 23 10 | 00 00 00 10 01 04 27 03 |T L)).#.|......'.|
|00001320| 00 00 00 2e 27 05 00 00 | 00 2e 07 05 53 4c 49 44 |....'...|....SLID|
|00001330| 45 07 0a 45 58 50 4f 53 | 49 54 49 4f 4e 23 0c 00 |E..EXPOS|ITION#..|
|00001340| 00 00 04 07 0a 45 58 50 | 4f 53 49 54 49 4f 4e 25 |.....EXP|OSITION%|
|00001350| bf 01 00 00 0a 49 74 20 | 69 73 20 65 73 70 65 63 |.....It |is espec|
|00001360| 69 61 6c 6c 79 20 69 6d | 70 6f 72 74 61 6e 74 20 |ially im|portant |
|00001370| 74 6f 20 72 65 6d 65 6d | 62 65 72 20 74 68 61 74 |to remem|ber that|
|00001380| 20 74 68 65 20 70 61 72 | 61 6d 65 74 65 72 20 76 | the par|ameter v|
|00001390| 61 6c 75 65 73 0a 6c 61 | 73 74 20 6f 6e 6c 79 20 |alues.la|st only |
|000013a0| 77 68 69 6c 65 20 74 68 | 65 20 70 72 6f 63 65 64 |while th|e proced|
|000013b0| 75 72 65 20 69 73 20 62 | 65 69 6e 67 20 65 76 61 |ure is b|eing eva|
|000013c0| 6c 75 61 74 65 64 2e 00 | 02 52 65 63 61 6c 6c 20 |luated..|.Recall |
|000013d0| 74 68 61 74 0a 42 4f 54 | 48 2d 45 4e 44 53 20 75 |that.BOT|H-ENDS u|
|000013e0| 73 65 73 20 4c 3a 0a 0a | 28 44 45 46 55 4e 20 42 |ses L:..|(DEFUN B|
|000013f0| 4f 54 48 2d 45 4e 44 53 | 00 10 3b 50 72 6f 63 65 |OTH-ENDS|..;Proce|
|00001400| 64 75 72 65 27 73 20 6e | 61 6d 65 20 69 73 20 42 |dure's n|ame is B|
|00001410| 4f 54 48 2d 45 4e 44 53 | 2e 0a 00 02 28 4c 29 00 |OTH-ENDS|....(L).|
|00001420| 1b 3b 54 68 65 20 70 61 | 72 61 6d 65 74 65 72 20 |.;The pa|rameter |
|00001430| 69 73 20 4c 2e 0a 00 02 | 28 43 4f 4e 53 20 28 46 |is L....|(CONS (F|
|00001440| 49 52 53 54 20 4c 29 20 | 28 4c 41 53 54 20 4c 29 |IRST L) |(LAST L)|
|00001450| 29 29 00 04 3b 54 68 65 | 20 66 6f 72 6d 2e 0a 0a |))..;The| form...|
|00001460| 43 6f 6e 73 65 71 75 65 | 6e 74 6c 79 2c 20 77 68 |Conseque|ntly, wh|
|00001470| 65 6e 20 77 65 20 65 76 | 61 6c 75 61 74 65 20 74 |en we ev|aluate t|
|00001480| 68 69 73 2c 0a 0a 2a 20 | 28 42 4f 54 48 2d 45 4e |his,..* |(BOTH-EN|
|00001490| 44 53 20 27 28 41 20 42 | 20 43 20 44 20 45 29 29 |DS '(A B| C D E))|
|000014a0| 0a 28 41 20 45 29 0a 0a | 4c 27 73 20 76 61 6c 75 |.(A E)..|L's valu|
|000014b0| 65 20 69 73 20 28 41 20 | 42 20 43 20 44 20 45 29 |e is (A |B C D E)|
|000014c0| 2c 20 54 45 4d 50 4f 52 | 41 52 49 4c 59 2e 00 02 |, TEMPOR|ARILY...|
|000014d0| 49 66 20 4c 20 68 61 73 | 20 61 20 76 61 6c 75 65 |If L has| a value|
|000014e0| 20 62 65 66 6f 72 65 0a | 42 4f 54 48 2d 45 4e 44 | before.|BOTH-END|
|000014f0| 53 20 69 73 20 75 73 65 | 64 2c 20 74 68 61 74 20 |S is use|d, that |
|00001500| 76 61 6c 75 65 20 69 73 | 20 72 65 73 74 6f 72 65 |value is| restore|
|00001510| 64 2e 0a 23 11 00 00 00 | 10 01 04 27 03 00 00 00 |d..#....|...'....|
|00001520| 2e 27 05 00 00 00 2e 07 | 05 53 4c 49 44 45 07 0a |.'......|.SLIDE..|
|00001530| 45 58 50 4f 53 49 54 49 | 4f 4e 23 0d 00 00 00 04 |EXPOSITI|ON#.....|
|00001540| 07 0a 45 58 50 4f 53 49 | 54 49 4f 4e 26 c6 0a 43 |..EXPOSI|TION&..C|
|00001550| 6f 6e 73 69 64 65 72 20 | 74 68 65 73 65 3a 0a 0a |onsider |these:..|
|00001560| 2a 20 28 53 45 54 46 20 | 4c 20 27 28 53 54 41 52 |* (SETF |L '(STAR|
|00001570| 54 20 4c 20 4d 20 4e 20 | 46 49 4e 49 53 48 29 29 |T L M N |FINISH))|
|00001580| 0a 28 53 54 41 52 54 20 | 4c 20 4d 20 4e 20 46 49 |.(START |L M N FI|
|00001590| 4e 49 53 48 29 0a 0a 2a | 20 28 42 4f 54 48 2d 45 |NISH)..*| (BOTH-E|
|000015a0| 4e 44 53 20 27 28 41 20 | 42 20 43 20 44 20 45 29 |NDS '(A |B C D E)|
|000015b0| 29 00 03 3b 4c 27 73 20 | 76 61 6c 75 65 20 69 73 |)..;L's |value is|
|000015c0| 20 28 41 20 42 20 43 20 | 44 20 45 29 20 74 65 6d | (A B C |D E) tem|
|000015d0| 70 6f 72 61 72 69 6c 79 | 2e 0a 28 41 20 45 29 0a |porarily|..(A E).|
|000015e0| 0a 2a 20 4c 0a 28 53 54 | 41 52 54 20 4c 20 4d 20 |.* L.(ST|ART L M |
|000015f0| 4e 20 46 49 4e 49 53 48 | 29 00 09 3b 4c 27 73 20 |N FINISH|)..;L's |
|00001600| 76 61 6c 75 65 20 77 61 | 73 20 72 65 73 74 6f 72 |value wa|s restor|
|00001610| 65 64 2e 0a 23 0c 00 00 | 00 10 01 04 27 03 00 00 |ed..#...|....'...|
|00001620| 00 2e 27 05 00 00 00 2e | 07 05 53 4c 49 44 45 07 |..'.....|..SLIDE.|
|00001630| 0a 45 58 50 4f 53 49 54 | 49 4f 4e 23 0e 00 00 00 |.EXPOSIT|ION#....|
|00001640| 04 07 0a 45 58 50 4f 53 | 49 54 49 4f 4e 25 63 01 |...EXPOS|ITION%c.|
|00001650| 00 00 0a 46 6f 72 20 61 | 6e 6f 74 68 65 72 20 65 |...For a|nother e|
|00001660| 78 61 6d 70 6c 65 20 6f | 66 20 70 61 72 61 6d 65 |xample o|f parame|
|00001670| 74 65 72 20 61 73 73 69 | 67 6e 6d 65 6e 74 20 61 |ter assi|gnment a|
|00001680| 6e 64 20 72 65 73 74 6f | 72 69 6e 67 2c 0a 63 6f |nd resto|ring,.co|
|00001690| 6e 73 69 64 65 72 20 74 | 68 69 73 3a 0a 0a 2a 20 |nsider t|his:..* |
|000016a0| 28 53 45 54 46 20 4c 20 | 27 28 41 20 42 20 43 20 |(SETF L |'(A B C |
|000016b0| 44 20 45 29 29 0a 28 41 | 20 42 20 43 20 44 20 45 |D E)).(A| B C D E|
|000016c0| 29 0a 0a 2a 20 28 42 4f | 54 48 2d 45 4e 44 53 20 |)..* (BO|TH-ENDS |
|000016d0| 4c 29 00 05 3b 56 61 6c | 75 65 20 6f 66 20 61 72 |L)..;Val|ue of ar|
|000016e0| 67 75 6d 65 6e 74 20 69 | 73 20 28 41 20 42 20 43 |gument i|s (A B C|
|000016f0| 20 44 20 45 29 2c 0a 28 | 41 20 45 29 00 0f 3b 68 | D E),.(|A E)..;h|
|00001700| 65 6e 63 65 20 76 61 6c | 75 65 20 6f 66 20 4c 20 |ence val|ue of L |
|00001710| 62 65 63 6f 6d 65 73 20 | 28 41 20 42 20 43 20 44 |becomes |(A B C D|
|00001720| 20 45 29 2e 0a 0a 2a 20 | 4c 0a 28 41 20 42 20 43 | E)...* |L.(A B C|
|00001730| 20 44 20 45 29 00 09 3b | 4c 27 73 20 76 61 6c 75 | D E)..;|L's valu|
|00001740| 65 20 77 61 73 20 72 65 | 73 74 6f 72 65 64 20 74 |e was re|stored t|
|00001750| 6f 20 28 41 20 42 20 43 | 20 44 20 45 29 0a 00 14 |o (A B C| D E)...|
|00001760| 3b 77 68 69 63 68 20 68 | 61 70 70 65 6e 73 20 74 |;which h|appens t|
|00001770| 6f 20 62 65 20 77 68 61 | 74 20 69 74 20 77 61 73 |o be wha|t it was|
|00001780| 20 77 68 69 6c 65 0a 00 | 14 3b 65 76 61 6c 75 61 | while..|.;evalua|
|00001790| 74 69 6e 67 20 74 68 65 | 20 28 43 4f 4e 53 20 28 |ting the| (CONS (|
|000017a0| 46 49 52 53 54 20 4c 29 | 20 28 4c 41 53 54 20 4c |FIRST L)| (LAST L|
|000017b0| 29 29 2e 0a 0a 23 10 00 | 00 00 10 01 04 27 03 00 |))...#..|.....'..|
|000017c0| 00 00 2e 27 05 00 00 00 | 2e 07 05 53 4c 49 44 45 |...'....|...SLIDE|
|000017d0| 07 0a 45 58 50 4f 53 49 | 54 49 4f 4e 23 0f 00 00 |..EXPOSI|TION#...|
|000017e0| 00 04 07 0a 45 58 50 4f | 53 49 54 49 4f 4e 25 5c |....EXPO|SITION%\|
|000017f0| 01 00 00 0a 48 65 72 65 | 20 69 73 20 61 6e 6f 74 |....Here| is anot|
|00001800| 68 65 72 20 65 78 61 6d | 70 6c 65 20 6f 66 20 70 |her exam|ple of p|
|00001810| 72 6f 63 65 64 75 72 65 | 20 64 65 66 69 6e 69 74 |rocedure| definit|
|00001820| 69 6f 6e 3b 20 69 6d 61 | 67 69 6e 65 20 74 68 61 |ion; ima|gine tha|
|00001830| 74 20 74 68 65 0a 70 72 | 69 6d 69 74 69 76 65 20 |t the.pr|imitive |
|00001840| 53 45 43 4f 4e 44 20 64 | 6f 65 73 20 6e 6f 74 20 |SECOND d|oes not |
|00001850| 65 78 69 73 74 2c 20 6c | 65 61 64 69 6e 67 20 75 |exist, l|eading u|
|00001860| 73 20 74 6f 20 63 72 65 | 61 74 65 20 4f 55 52 2d |s to cre|ate OUR-|
|00001870| 53 45 43 4f 4e 44 3a 0a | 0a 28 44 45 46 55 4e 20 |SECOND:.|.(DEFUN |
|00001880| 4f 55 52 2d 53 45 43 4f | 4e 44 00 06 3b 50 72 6f |OUR-SECO|ND..;Pro|
|00001890| 63 65 64 75 72 65 27 73 | 20 6e 61 6d 65 20 69 73 |cedure's| name is|
|000018a0| 20 4f 55 52 2d 53 45 43 | 4f 4e 44 2e 0a 00 02 28 | OUR-SEC|OND....(|
|000018b0| 4c 29 00 12 3b 54 68 65 | 20 70 61 72 61 6d 65 74 |L)..;The| paramet|
|000018c0| 65 72 20 69 73 20 4c 2e | 0a 00 02 28 46 49 52 53 |er is L.|...(FIRS|
|000018d0| 54 20 28 52 45 53 54 20 | 4c 29 29 29 00 04 3b 54 |T (REST |L)))..;T|
|000018e0| 68 65 72 65 20 69 73 20 | 6f 6e 65 20 66 6f 72 6d |here is |one form|
|000018f0| 2e 0a 0a 4f 6e 63 65 20 | 4f 55 52 2d 53 45 43 4f |...Once |OUR-SECO|
|00001900| 4e 44 20 69 73 20 64 65 | 66 69 6e 65 64 2c 20 69 |ND is de|fined, i|
|00001910| 74 20 69 73 20 75 73 65 | 64 20 6c 69 6b 65 20 61 |t is use|d like a|
|00001920| 6e 79 20 6f 74 68 65 72 | 20 70 72 6f 63 65 64 75 |ny other| procedu|
|00001930| 72 65 3a 0a 0a 2a 20 28 | 4f 55 52 2d 53 45 43 4f |re:..* (|OUR-SECO|
|00001940| 4e 44 20 27 28 41 20 42 | 20 43 29 29 0a 42 0a 23 |ND '(A B| C)).B.#|
|00001950| 0d 00 00 00 10 01 04 27 | 03 00 00 00 2e 27 05 00 |.......'|.....'..|
|00001960| 00 00 2e 07 05 53 4c 49 | 44 45 07 0a 45 58 50 4f |.....SLI|DE..EXPO|
|00001970| 53 49 54 49 4f 4e 23 10 | 00 00 00 04 07 0a 45 58 |SITION#.|......EX|
|00001980| 50 4f 53 49 54 49 4f 4e | 25 28 01 00 00 0a 41 67 |POSITION|%(....Ag|
|00001990| 61 69 6e 2c 20 6c 6f 6f | 6b 20 63 61 72 65 66 75 |ain, loo|k carefu|
|000019a0| 6c 6c 79 20 61 74 20 68 | 6f 77 20 74 68 65 20 67 |lly at h|ow the g|
|000019b0| 65 6e 65 72 61 6c 20 70 | 61 74 74 65 72 6e 20 61 |eneral p|attern a|
|000019c0| 6e 64 20 74 68 65 20 70 | 61 72 74 69 63 75 6c 61 |nd the p|articula|
|000019d0| 72 0a 65 78 61 6d 70 6c | 65 20 63 6f 72 72 65 73 |r.exampl|e corres|
|000019e0| 70 6f 6e 64 20 77 68 65 | 6e 20 74 68 65 72 65 20 |pond whe|n there |
|000019f0| 69 73 20 6f 6e 65 20 70 | 61 72 61 6d 65 74 65 72 |is one p|arameter|
|00001a00| 20 61 6e 64 20 6f 6e 65 | 20 66 6f 72 6d 3a 0a 0a | and one| form:..|
|00001a10| 28 44 45 46 55 4e 20 3c | 70 72 6f 63 65 64 75 72 |(DEFUN <|procedur|
|00001a20| 65 20 6e 61 6d 65 3e 00 | 07 28 44 45 46 55 4e 20 |e name>.|.(DEFUN |
|00001a30| 4f 55 52 2d 53 45 43 4f | 4e 44 0a 00 07 28 3c 70 |OUR-SECO|ND...(<p|
|00001a40| 61 72 61 6d 65 74 65 72 | 3e 29 00 11 28 4c 29 0a |arameter|>)..(L).|
|00001a50| 00 07 3c 66 6f 72 6d 3e | 29 00 17 28 46 49 52 53 |..<form>|)..(FIRS|
|00001a60| 54 20 28 52 45 53 54 20 | 4c 29 29 29 0a 0a 3c 70 |T (REST |L)))..<p|
|00001a70| 72 6f 63 65 64 75 72 65 | 20 6e 61 6d 65 3e 00 06 |rocedure| name>..|
|00001a80| 4f 55 52 2d 53 45 43 4f | 4e 44 0a 0a 3c 70 61 72 |OUR-SECO|ND..<par|
|00001a90| 61 6d 65 74 65 72 3e 00 | 0b 4c 0a 0a 3c 66 6f 72 |ameter>.|.L..<for|
|00001aa0| 6d 3e 00 10 28 46 49 52 | 53 54 20 28 52 45 53 54 |m>..(FIR|ST (REST|
|00001ab0| 20 4c 29 29 0a 23 0e 00 | 00 00 10 01 04 27 03 00 | L)).#..|.....'..|
|00001ac0| 00 00 2e 27 05 00 00 00 | 2e 07 05 53 4c 49 44 45 |...'....|...SLIDE|
|00001ad0| 07 0a 45 58 50 4f 53 49 | 54 49 4f 4e 23 11 00 00 |..EXPOSI|TION#...|
|00001ae0| 00 04 07 0a 45 58 50 4f | 53 49 54 49 4f 4e 25 a7 |....EXPO|SITION%.|
|00001af0| 01 00 00 0a 49 74 20 69 | 73 20 63 6f 6e 76 65 6e |....It i|s conven|
|00001b00| 74 69 6f 6e 61 6c 2c 20 | 62 75 74 20 6e 6f 74 20 |tional, |but not |
|00001b10| 73 74 72 69 63 74 6c 79 | 20 6e 65 63 65 73 73 61 |strictly| necessa|
|00001b20| 72 79 2c 20 74 6f 20 70 | 75 74 20 61 6c 6c 20 74 |ry, to p|ut all t|
|00001b30| 68 65 0a 70 61 72 61 6d | 65 74 65 72 73 20 6f 6e |he.param|eters on|
|00001b40| 20 74 68 65 20 66 69 72 | 73 74 20 6c 69 6e 65 3a | the fir|st line:|
|00001b50| 0a 0a 28 44 45 46 55 4e | 20 4f 55 52 2d 53 45 43 |..(DEFUN| OUR-SEC|
|00001b60| 4f 4e 44 20 28 4c 29 0a | 00 02 28 46 49 52 53 54 |OND (L).|..(FIRST|
|00001b70| 20 28 52 45 53 54 20 4c | 29 29 29 0a 0a 41 6e 64 | (REST L|)))..And|
|00001b80| 20 69 66 20 74 68 65 20 | 70 72 6f 63 65 64 75 72 | if the |procedur|
|00001b90| 65 20 69 73 20 73 68 6f | 72 74 20 65 6e 6f 75 67 |e is sho|rt enoug|
|00001ba0| 68 2c 20 79 6f 75 20 63 | 61 6e 20 65 76 65 6e 20 |h, you c|an even |
|00001bb0| 73 61 76 65 20 73 70 61 | 63 65 20 62 79 0a 70 75 |save spa|ce by.pu|
|00001bc0| 74 74 69 6e 67 20 74 68 | 65 20 77 68 6f 6c 65 20 |tting th|e whole |
|00001bd0| 74 68 69 6e 67 20 6f 6e | 20 74 68 65 20 66 69 72 |thing on| the fir|
|00001be0| 73 74 20 6c 69 6e 65 3a | 0a 0a 28 44 45 46 55 4e |st line:|..(DEFUN|
|00001bf0| 20 4f 55 52 2d 53 45 43 | 4f 4e 44 20 28 4c 29 20 | OUR-SEC|OND (L) |
|00001c00| 28 46 49 52 53 54 20 28 | 52 45 53 54 20 4c 29 29 |(FIRST (|REST L))|
|00001c10| 29 0a 0a 54 68 65 20 76 | 61 6c 75 65 20 72 65 74 |)..The v|alue ret|
|00001c20| 75 72 6e 65 64 20 62 79 | 20 44 45 46 55 4e 20 69 |urned by| DEFUN i|
|00001c30| 73 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 74 68 |s the na|me of th|
|00001c40| 65 20 70 72 6f 63 65 64 | 75 72 65 20 44 45 46 55 |e proced|ure DEFU|
|00001c50| 4e 0a 68 61 73 20 6a 75 | 73 74 20 64 65 66 69 6e |N.has ju|st defin|
|00001c60| 65 64 3a 0a 0a 2a 20 28 | 44 45 46 55 4e 20 4f 55 |ed:..* (|DEFUN OU|
|00001c70| 52 2d 53 45 43 4f 4e 44 | 20 28 4c 29 20 28 46 49 |R-SECOND| (L) (FI|
|00001c80| 52 53 54 20 28 52 45 53 | 54 20 4c 29 29 29 0a 4f |RST (RES|T L))).O|
|00001c90| 55 52 2d 53 45 43 4f 4e | 44 0a 23 12 00 00 00 10 |UR-SECON|D.#.....|
|00001ca0| 01 04 27 03 00 00 00 2e | 27 05 00 00 00 2e 07 05 |..'.....|'.......|
|00001cb0| 53 4c 49 44 45 07 0a 45 | 58 50 4f 53 49 54 49 4f |SLIDE..E|XPOSITIO|
|00001cc0| 4e 23 12 00 00 00 04 07 | 0a 45 58 50 4f 53 49 54 |N#......|.EXPOSIT|
|00001cd0| 49 4f 4e 25 bb 01 00 00 | 0a 52 65 63 61 6c 6c 20 |ION%....|.Recall |
|00001ce0| 74 68 61 74 20 4f 55 52 | 2d 53 45 43 4f 4e 44 20 |that OUR|-SECOND |
|00001cf0| 69 73 20 64 65 66 69 6e | 65 64 20 74 68 69 73 20 |is defin|ed this |
|00001d00| 77 61 79 3a 0a 0a 28 44 | 45 46 55 4e 20 4f 55 52 |way:..(D|EFUN OUR|
|00001d10| 2d 53 45 43 4f 4e 44 20 | 28 4c 29 20 28 46 49 52 |-SECOND |(L) (FIR|
|00001d20| 53 54 20 28 52 45 53 54 | 20 4c 29 29 29 0a 0a 57 |ST (REST| L)))..W|
|00001d30| 68 65 6e 20 4f 55 52 2d | 53 45 43 4f 4e 44 20 69 |hen OUR-|SECOND i|
|00001d40| 73 20 75 73 65 64 2c 20 | 61 73 20 69 6e 20 28 4f |s used, |as in (O|
|00001d50| 55 52 2d 53 45 43 4f 4e | 44 20 27 28 31 20 32 20 |UR-SECON|D '(1 2 |
|00001d60| 33 29 29 2c 20 74 68 65 | 20 76 61 6c 75 65 0a 6f |3)), the| value.o|
|00001d70| 66 20 74 68 65 20 70 61 | 72 61 6d 65 74 65 72 20 |f the pa|rameter |
|00001d80| 4c 20 62 65 63 6f 6d 65 | 73 20 28 31 20 32 20 33 |L become|s (1 2 3|
|00001d90| 29 2e 0a 0a 52 45 53 54 | 20 74 68 65 72 65 66 6f |)...REST| therefo|
|00001da0| 72 65 20 77 6f 72 6b 73 | 20 6f 6e 20 74 68 69 73 |re works| on this|
|00001db0| 20 6e 65 77 20 76 61 6c | 75 65 20 6f 66 20 4c 2c | new val|ue of L,|
|00001dc0| 20 70 72 6f 64 75 63 69 | 6e 67 20 28 32 20 33 29 | produci|ng (2 3)|
|00001dd0| 2c 0a 66 72 6f 6d 20 77 | 68 69 63 68 20 46 49 52 |,.from w|hich FIR|
|00001de0| 53 54 20 65 78 74 72 61 | 63 74 73 20 32 3a 0a 0a |ST extra|cts 2:..|
|00001df0| 2a 20 28 4f 55 52 2d 53 | 45 43 4f 4e 44 20 27 28 |* (OUR-S|ECOND '(|
|00001e00| 31 20 32 20 33 29 29 0a | 32 0a 0a 4e 6f 74 65 20 |1 2 3)).|2..Note |
|00001e10| 63 61 72 65 66 75 6c 6c | 79 20 74 68 61 74 20 77 |carefull|y that w|
|00001e20| 68 65 6e 20 4f 55 52 2d | 53 45 43 4f 4e 44 20 69 |hen OUR-|SECOND i|
|00001e30| 73 20 74 68 72 6f 75 67 | 68 2c 20 74 68 65 20 76 |s throug|h, the v|
|00001e40| 61 6c 75 65 20 6f 66 20 | 4c 20 69 73 0a 72 65 73 |alue of |L is.res|
|00001e50| 74 6f 72 65 64 20 74 6f | 20 77 68 61 74 65 76 65 |tored to| whateve|
|00001e60| 72 20 76 61 6c 75 65 20 | 69 74 20 68 61 64 20 62 |r value |it had b|
|00001e70| 65 66 6f 72 65 20 4f 55 | 52 2d 53 45 43 4f 4e 44 |efore OU|R-SECOND|
|00001e80| 20 77 61 73 20 75 73 65 | 64 2c 20 69 66 0a 61 6e | was use|d, if.an|
|00001e90| 79 2e 0a 23 12 00 00 00 | 10 01 04 27 03 00 00 00 |y..#....|...'....|
|00001ea0| 2e 27 05 00 00 00 2e 07 | 05 53 4c 49 44 45 07 0a |.'......|.SLIDE..|
|00001eb0| 45 58 50 4f 53 49 54 49 | 4f 4e 23 13 00 00 00 04 |EXPOSITI|ON#.....|
|00001ec0| 07 0a 45 58 50 4f 53 49 | 54 49 4f 4e 25 6a 01 00 |..EXPOSI|TION%j..|
|00001ed0| 00 0a 52 65 6d 65 6d 62 | 65 72 20 2e 2e 2e 0a 0a |..Rememb|er .....|
|00001ee0| 6f 00 04 49 46 20 79 6f | 75 20 77 61 6e 74 20 74 |o..IF yo|u want t|
|00001ef0| 6f 20 64 65 66 69 6e 65 | 20 79 6f 75 72 20 6f 77 |o define| your ow|
|00001f00| 6e 20 70 72 6f 63 65 64 | 75 72 65 2c 0a 00 05 54 |n proced|ure,...T|
|00001f10| 48 45 4e 20 75 73 65 20 | 44 45 46 55 4e 3a 0a 0a |HEN use |DEFUN:..|
|00001f20| 00 05 28 44 45 46 55 4e | 20 3c 70 72 6f 63 65 64 |..(DEFUN| <proced|
|00001f30| 75 72 65 20 6e 61 6d 65 | 3e 20 28 3c 70 61 72 61 |ure name|> (<para|
|00001f40| 6d 65 74 65 72 20 31 3e | 20 2e 2e 2e 20 3c 70 61 |meter 1>| ... <pa|
|00001f50| 72 61 6d 65 74 65 72 20 | 6e 3e 29 0a 00 07 3c 66 |rameter |n>)...<f|
|00001f60| 6f 72 6d 20 31 3e 0a 00 | 07 2e 2e 2e 0a 00 07 3c |orm 1>..|.......<|
|00001f70| 66 6f 72 6d 20 6e 3e 29 | 0a 0a 6f 00 04 54 68 65 |form n>)|..o..The|
|00001f80| 20 66 6f 75 72 20 73 74 | 65 70 73 20 69 6e 76 6f | four st|eps invo|
|00001f90| 6c 76 65 64 20 69 6e 20 | 75 73 69 6e 67 20 61 20 |lved in |using a |
|00001fa0| 64 65 66 69 6e 65 64 20 | 70 72 6f 63 65 64 75 72 |defined |procedur|
|00001fb0| 65 20 61 72 65 3a 0a 0a | 00 05 31 2e 20 41 74 74 |e are:..|..1. Att|
|00001fc0| 61 63 68 20 61 72 67 75 | 6d 65 6e 74 20 76 61 6c |ach argu|ment val|
|00001fd0| 75 65 73 20 74 6f 20 70 | 61 72 61 6d 65 74 65 72 |ues to p|arameter|
|00001fe0| 73 2e 0a 0a 00 05 32 2e | 20 45 76 61 6c 75 61 74 |s.....2.| Evaluat|
|00001ff0| 65 20 66 6f 72 6d 73 2e | 0a 0a 00 05 33 2e 20 52 |e forms.|....3. R|
|00002000| 65 73 74 6f 72 65 20 70 | 61 72 61 6d 65 74 65 72 |estore p|arameter|
|00002010| 20 76 61 6c 75 65 73 2e | 0a 0a 00 05 34 2e 20 52 | values.|....4. R|
|00002020| 65 74 75 72 6e 20 76 61 | 6c 75 65 20 6f 66 20 6c |eturn va|lue of l|
|00002030| 61 73 74 20 66 6f 72 6d | 2e 0a 0a 23 16 00 00 00 |ast form|...#....|
|00002040| 10 01 04 27 03 00 00 00 | 2e 27 05 00 00 00 2e 27 |...'....|.'.....'|
|00002050| 13 00 00 00 04 27 05 00 | 00 00 2e 04 10 02 04 10 |.....'..|........|
|00002060| 03 36 0b 01 04 53 45 54 | 46 07 15 2a 4c 41 53 54 |.6...SET|F..*LAST|
|00002070| 2d 4c 4f 41 44 45 44 2d | 4c 45 53 53 4f 4e 53 2a |-LOADED-|LESSONS*|
|00002080| 0b 01 05 51 55 4f 54 45 | 07 07 44 45 46 55 4e 2d |...QUOTE|..DEFUN-|
|00002090| 49 04 10 01 04 10 02 04 | 10 03 36 40 |I.......|..6@ |
+--------+-------------------------+-------------------------+--------+--------+