home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: ref5.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text, with CR line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[CR]
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [R*ch] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 45 78 70 72 65 73 73 |\chapter|{Express|
|00000010| 69 6f 6e 73 20 61 6e 64 | 20 63 6f 6e 64 69 74 69 |ions and| conditi|
|00000020| 6f 6e 73 7d 0d 5c 69 6e | 64 65 78 7b 65 78 70 72 |ons}.\in|dex{expr|
|00000030| 65 73 73 69 6f 6e 7d 0d | 5c 69 6e 64 65 78 7b 63 |ession}.|\index{c|
|00000040| 6f 6e 64 69 74 69 6f 6e | 7d 0d 0d 7b 5c 62 66 20 |ondition|}..{\bf |
|00000050| 4e 6f 74 65 3a 7d 20 49 | 6e 20 74 68 69 73 20 61 |Note:} I|n this a|
|00000060| 6e 64 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |nd the f|ollowing|
|00000070| 20 63 68 61 70 74 65 72 | 73 2c 20 65 78 74 65 6e | chapter|s, exten|
|00000080| 64 65 64 20 42 4e 46 20 | 6e 6f 74 61 74 69 6f 6e |ded BNF |notation|
|00000090| 0d 77 69 6c 6c 20 62 65 | 20 75 73 65 64 20 74 6f |.will be| used to|
|000000a0| 20 64 65 73 63 72 69 62 | 65 20 73 79 6e 74 61 78 | describ|e syntax|
|000000b0| 2c 20 6e 6f 74 20 6c 65 | 78 69 63 61 6c 20 61 6e |, not le|xical an|
|000000c0| 61 6c 79 73 69 73 2e 0d | 5c 69 6e 64 65 78 7b 42 |alysis..|\index{B|
|000000d0| 4e 46 7d 0d 0d 54 68 69 | 73 20 63 68 61 70 74 65 |NF}..Thi|s chapte|
|000000e0| 72 20 65 78 70 6c 61 69 | 6e 73 20 74 68 65 20 6d |r explai|ns the m|
|000000f0| 65 61 6e 69 6e 67 20 6f | 66 20 74 68 65 20 65 6c |eaning o|f the el|
|00000100| 65 6d 65 6e 74 73 20 6f | 66 20 65 78 70 72 65 73 |ements o|f expres|
|00000110| 73 69 6f 6e 73 20 61 6e | 64 0d 63 6f 6e 64 69 74 |sions an|d.condit|
|00000120| 69 6f 6e 73 2e 20 20 43 | 6f 6e 64 69 74 69 6f 6e |ions. C|ondition|
|00000130| 73 20 61 72 65 20 61 20 | 73 75 70 65 72 73 65 74 |s are a |superset|
|00000140| 20 6f 66 20 65 78 70 72 | 65 73 73 69 6f 6e 73 2c | of expr|essions,|
|00000150| 20 61 6e 64 20 61 20 63 | 6f 6e 64 69 74 69 6f 6e | and a c|ondition|
|00000160| 0d 6d 61 79 20 62 65 20 | 75 73 65 64 20 77 68 65 |.may be |used whe|
|00000170| 72 65 76 65 72 20 61 6e | 20 65 78 70 72 65 73 73 |rever an| express|
|00000180| 69 6f 6e 20 69 73 20 72 | 65 71 75 69 72 65 64 20 |ion is r|equired |
|00000190| 62 79 20 65 6e 63 6c 6f | 73 69 6e 67 20 69 74 20 |by enclo|sing it |
|000001a0| 69 6e 0d 70 61 72 65 6e | 74 68 65 73 65 73 2e 20 |in.paren|theses. |
|000001b0| 20 54 68 65 20 6f 6e 6c | 79 20 70 6c 61 63 65 73 | The onl|y places|
|000001c0| 20 77 68 65 72 65 20 65 | 78 70 72 65 73 73 69 6f | where e|xpressio|
|000001d0| 6e 73 20 61 72 65 20 75 | 73 65 64 20 69 6e 20 74 |ns are u|sed in t|
|000001e0| 68 65 20 73 79 6e 74 61 | 78 0d 69 6e 73 74 65 61 |he synta|x.instea|
|000001f0| 64 20 6f 66 20 63 6f 6e | 64 69 74 69 6f 6e 73 20 |d of con|ditions |
|00000200| 69 73 20 69 6e 20 65 78 | 70 72 65 73 73 69 6f 6e |is in ex|pression|
|00000210| 20 73 74 61 74 65 6d 65 | 6e 74 73 20 61 6e 64 20 | stateme|nts and |
|00000220| 6f 6e 20 74 68 65 0d 72 | 69 67 68 74 2d 68 61 6e |on the.r|ight-han|
|00000230| 64 20 73 69 64 65 20 6f | 66 20 61 73 73 69 67 6e |d side o|f assign|
|00000240| 6d 65 6e 74 20 73 74 61 | 74 65 6d 65 6e 74 73 3b |ment sta|tements;|
|00000250| 20 74 68 69 73 20 63 61 | 74 63 68 65 73 20 73 6f | this ca|tches so|
|00000260| 6d 65 20 6e 61 73 74 79 | 20 62 75 67 73 0d 6c 69 |me nasty| bugs.li|
|00000270| 6b 65 20 61 63 63 69 64 | 65 6e 74 61 6c 6c 79 20 |ke accid|entally |
|00000280| 77 72 69 74 69 6e 67 20 | 5c 76 65 72 62 40 78 20 |writing |\verb@x |
|00000290| 3d 3d 20 31 40 20 69 6e | 73 74 65 61 64 20 6f 66 |== 1@ in|stead of|
|000002a0| 20 5c 76 65 72 62 40 78 | 20 3d 20 31 40 2e 0d 5c | \verb@x| = 1@..\|
|000002b0| 69 6e 64 65 78 69 69 7b | 61 73 73 69 67 6e 6d 65 |indexii{|assignme|
|000002c0| 6e 74 7d 7b 73 74 61 74 | 65 6d 65 6e 74 7d 0d 0d |nt}{stat|ement}..|
|000002d0| 54 68 65 20 63 6f 6d 6d | 61 20 70 6c 61 79 73 20 |The comm|a plays |
|000002e0| 73 65 76 65 72 61 6c 20 | 72 6f 6c 65 73 20 69 6e |several |roles in|
|000002f0| 20 50 79 74 68 6f 6e 27 | 73 20 73 79 6e 74 61 78 | Python'|s syntax|
|00000300| 2e 20 20 49 74 20 69 73 | 20 75 73 75 61 6c 6c 79 |. It is| usually|
|00000310| 20 61 6e 0d 6f 70 65 72 | 61 74 6f 72 20 77 69 74 | an.oper|ator wit|
|00000320| 68 20 61 20 6c 6f 77 65 | 72 20 70 72 65 63 65 64 |h a lowe|r preced|
|00000330| 65 6e 63 65 20 74 68 61 | 6e 20 61 6c 6c 20 6f 74 |ence tha|n all ot|
|00000340| 68 65 72 73 2c 20 62 75 | 74 20 6f 63 63 61 73 69 |hers, bu|t occasi|
|00000350| 6f 6e 61 6c 6c 79 0d 73 | 65 72 76 65 73 20 6f 74 |onally.s|erves ot|
|00000360| 68 65 72 20 70 75 72 70 | 6f 73 65 73 20 61 73 20 |her purp|oses as |
|00000370| 77 65 6c 6c 3b 20 65 2e | 67 2e 20 69 74 20 73 65 |well; e.|g. it se|
|00000380| 70 61 72 61 74 65 73 20 | 66 75 6e 63 74 69 6f 6e |parates |function|
|00000390| 20 61 72 67 75 6d 65 6e | 74 73 2c 0d 69 73 20 75 | argumen|ts,.is u|
|000003a0| 73 65 64 20 69 6e 20 6c | 69 73 74 20 61 6e 64 20 |sed in l|ist and |
|000003b0| 64 69 63 74 69 6f 6e 61 | 72 79 20 63 6f 6e 73 74 |dictiona|ry const|
|000003c0| 72 75 63 74 6f 72 73 2c | 20 61 6e 64 20 68 61 73 |ructors,| and has|
|000003d0| 20 73 70 65 63 69 61 6c | 20 73 65 6d 61 6e 74 69 | special| semanti|
|000003e0| 63 73 0d 69 6e 20 5c 76 | 65 72 62 40 70 72 69 6e |cs.in \v|erb@prin|
|000003f0| 74 40 20 73 74 61 74 65 | 6d 65 6e 74 73 2e 0d 5c |t@ state|ments..\|
|00000400| 69 6e 64 65 78 7b 63 6f | 6d 6d 61 7d 0d 0d 57 68 |index{co|mma}..Wh|
|00000410| 65 6e 20 28 6f 6e 65 20 | 61 6c 74 65 72 6e 61 74 |en (one |alternat|
|00000420| 69 76 65 20 6f 66 29 20 | 61 20 73 79 6e 74 61 78 |ive of) |a syntax|
|00000430| 20 72 75 6c 65 20 68 61 | 73 20 74 68 65 20 66 6f | rule ha|s the fo|
|00000440| 72 6d 0d 0d 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |rm..\beg|in{verba|
|00000450| 74 69 6d 7d 0d 6e 61 6d | 65 3a 20 20 20 20 20 20 |tim}.nam|e: |
|00000460| 20 20 20 20 20 6f 74 68 | 65 72 6e 61 6d 65 0d 5c | oth|ername.\|
|00000470| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0d 0d 61 |end{verb|atim}..a|
|00000480| 6e 64 20 6e 6f 20 73 65 | 6d 61 6e 74 69 63 73 20 |nd no se|mantics |
|00000490| 61 72 65 20 67 69 76 65 | 6e 2c 20 74 68 65 20 73 |are give|n, the s|
|000004a0| 65 6d 61 6e 74 69 63 73 | 20 6f 66 20 74 68 69 73 |emantics| of this|
|000004b0| 20 66 6f 72 6d 20 6f 66 | 20 5c 76 65 72 62 40 6e | form of| \verb@n|
|000004c0| 61 6d 65 40 0d 61 72 65 | 20 74 68 65 20 73 61 6d |ame@.are| the sam|
|000004d0| 65 20 61 73 20 66 6f 72 | 20 5c 76 65 72 62 40 6f |e as for| \verb@o|
|000004e0| 74 68 65 72 6e 61 6d 65 | 40 2e 0d 5c 69 6e 64 65 |thername|@..\inde|
|000004f0| 78 7b 73 79 6e 74 61 78 | 7d 0d 0d 5c 73 65 63 74 |x{syntax|}..\sect|
|00000500| 69 6f 6e 7b 41 72 69 74 | 68 6d 65 74 69 63 20 63 |ion{Arit|hmetic c|
|00000510| 6f 6e 76 65 72 73 69 6f | 6e 73 7d 0d 5c 69 6e 64 |onversio|ns}.\ind|
|00000520| 65 78 69 69 7b 61 72 69 | 74 68 6d 65 74 69 63 7d |exii{ari|thmetic}|
|00000530| 7b 63 6f 6e 76 65 72 73 | 69 6f 6e 7d 0d 0d 57 68 |{convers|ion}..Wh|
|00000540| 65 6e 20 61 20 64 65 73 | 63 72 69 70 74 69 6f 6e |en a des|cription|
|00000550| 20 6f 66 20 61 6e 20 61 | 72 69 74 68 6d 65 74 69 | of an a|rithmeti|
|00000560| 63 20 6f 70 65 72 61 74 | 6f 72 20 62 65 6c 6f 77 |c operat|or below|
|00000570| 20 75 73 65 73 20 74 68 | 65 20 70 68 72 61 73 65 | uses th|e phrase|
|00000580| 0d 60 60 74 68 65 20 6e | 75 6d 65 72 69 63 20 61 |.``the n|umeric a|
|00000590| 72 67 75 6d 65 6e 74 73 | 20 61 72 65 20 63 6f 6e |rguments| are con|
|000005a0| 76 65 72 74 65 64 20 74 | 6f 20 61 20 63 6f 6d 6d |verted t|o a comm|
|000005b0| 6f 6e 20 74 79 70 65 27 | 27 2c 0d 74 68 69 73 20 |on type'|',.this |
|000005c0| 62 6f 74 68 20 6d 65 61 | 6e 73 20 74 68 61 74 20 |both mea|ns that |
|000005d0| 69 66 20 65 69 74 68 65 | 72 20 61 72 67 75 6d 65 |if eithe|r argume|
|000005e0| 6e 74 20 69 73 20 6e 6f | 74 20 61 20 6e 75 6d 62 |nt is no|t a numb|
|000005f0| 65 72 2c 20 61 0d 5c 76 | 65 72 62 40 54 79 70 65 |er, a.\v|erb@Type|
|00000600| 45 72 72 6f 72 40 20 65 | 78 63 65 70 74 69 6f 6e |Error@ e|xception|
|00000610| 20 69 73 20 72 61 69 73 | 65 64 2c 20 61 6e 64 20 | is rais|ed, and |
|00000620| 74 68 61 74 20 6f 74 68 | 65 72 77 69 73 65 0d 74 |that oth|erwise.t|
|00000630| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 63 6f 6e |he follo|wing con|
|00000640| 76 65 72 73 69 6f 6e 73 | 20 61 72 65 20 61 70 70 |versions| are app|
|00000650| 6c 69 65 64 3a 0d 5c 65 | 78 69 6e 64 65 78 7b 54 |lied:.\e|xindex{T|
|00000660| 79 70 65 45 72 72 6f 72 | 7d 0d 5c 69 6e 64 65 78 |ypeError|}.\index|
|00000670| 69 69 7b 66 6c 6f 61 74 | 69 6e 67 20 70 6f 69 6e |ii{float|ing poin|
|00000680| 74 7d 7b 6e 75 6d 62 65 | 72 7d 0d 5c 69 6e 64 65 |t}{numbe|r}.\inde|
|00000690| 78 69 69 7b 6c 6f 6e 67 | 7d 7b 69 6e 74 65 67 65 |xii{long|}{intege|
|000006a0| 72 7d 0d 5c 69 6e 64 65 | 78 69 69 7b 70 6c 61 69 |r}.\inde|xii{plai|
|000006b0| 6e 7d 7b 69 6e 74 65 67 | 65 72 7d 0d 0d 5c 62 65 |n}{integ|er}..\be|
|000006c0| 67 69 6e 7b 69 74 65 6d | 69 7a 65 7d 0d 5c 69 74 |gin{item|ize}.\it|
|000006d0| 65 6d 09 66 69 72 73 74 | 2c 20 69 66 20 65 69 74 |em.first|, if eit|
|000006e0| 68 65 72 20 61 72 67 75 | 6d 65 6e 74 20 69 73 20 |her argu|ment is |
|000006f0| 61 20 66 6c 6f 61 74 69 | 6e 67 20 70 6f 69 6e 74 |a floati|ng point|
|00000700| 20 6e 75 6d 62 65 72 2c | 0d 09 74 68 65 20 6f 74 | number,|..the ot|
|00000710| 68 65 72 20 69 73 20 63 | 6f 6e 76 65 72 74 65 64 |her is c|onverted|
|00000720| 20 74 6f 20 66 6c 6f 61 | 74 69 6e 67 20 70 6f 69 | to floa|ting poi|
|00000730| 6e 74 3b 0d 5c 69 74 65 | 6d 09 65 6c 73 65 2c 20 |nt;.\ite|m.else, |
|00000740| 69 66 20 65 69 74 68 65 | 72 20 61 72 67 75 6d 65 |if eithe|r argume|
|00000750| 6e 74 20 69 73 20 61 20 | 6c 6f 6e 67 20 69 6e 74 |nt is a |long int|
|00000760| 65 67 65 72 2c 0d 09 74 | 68 65 20 6f 74 68 65 72 |eger,..t|he other|
|00000770| 20 69 73 20 63 6f 6e 76 | 65 72 74 65 64 20 74 6f | is conv|erted to|
|00000780| 20 6c 6f 6e 67 20 69 6e | 74 65 67 65 72 3b 0d 5c | long in|teger;.\|
|00000790| 69 74 65 6d 09 6f 74 68 | 65 72 77 69 73 65 2c 20 |item.oth|erwise, |
|000007a0| 62 6f 74 68 20 6d 75 73 | 74 20 62 65 20 70 6c 61 |both mus|t be pla|
|000007b0| 69 6e 20 69 6e 74 65 67 | 65 72 73 20 61 6e 64 20 |in integ|ers and |
|000007c0| 6e 6f 20 63 6f 6e 76 65 | 72 73 69 6f 6e 0d 09 69 |no conve|rsion..i|
|000007d0| 73 20 6e 65 63 65 73 73 | 61 72 79 2e 0d 5c 65 6e |s necess|ary..\en|
|000007e0| 64 7b 69 74 65 6d 69 7a | 65 7d 0d 0d 5c 73 65 63 |d{itemiz|e}..\sec|
|000007f0| 74 69 6f 6e 7b 41 74 6f | 6d 73 7d 0d 5c 69 6e 64 |tion{Ato|ms}.\ind|
|00000800| 65 78 7b 61 74 6f 6d 7d | 0d 0d 41 74 6f 6d 73 20 |ex{atom}|..Atoms |
|00000810| 61 72 65 20 74 68 65 20 | 6d 6f 73 74 20 62 61 73 |are the |most bas|
|00000820| 69 63 20 65 6c 65 6d 65 | 6e 74 73 20 6f 66 20 65 |ic eleme|nts of e|
|00000830| 78 70 72 65 73 73 69 6f | 6e 73 2e 20 20 46 6f 72 |xpressio|ns. For|
|00000840| 6d 73 20 65 6e 63 6c 6f | 73 65 64 20 69 6e 0d 72 |ms enclo|sed in.r|
|00000850| 65 76 65 72 73 65 20 71 | 75 6f 74 65 73 20 6f 72 |everse q|uotes or|
|00000860| 20 69 6e 20 70 61 72 65 | 6e 74 68 65 73 65 73 2c | in pare|ntheses,|
|00000870| 20 62 72 61 63 6b 65 74 | 73 20 6f 72 20 62 72 61 | bracket|s or bra|
|00000880| 63 65 73 20 61 72 65 20 | 61 6c 73 6f 0d 63 61 74 |ces are |also.cat|
|00000890| 65 67 6f 72 69 7a 65 64 | 20 73 79 6e 74 61 63 74 |egorized| syntact|
|000008a0| 69 63 61 6c 6c 79 20 61 | 73 20 61 74 6f 6d 73 2e |ically a|s atoms.|
|000008b0| 20 20 54 68 65 20 73 79 | 6e 74 61 78 20 66 6f 72 | The sy|ntax for|
|000008c0| 20 61 74 6f 6d 73 20 69 | 73 3a 0d 0d 5c 62 65 67 | atoms i|s:..\beg|
|000008d0| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0d 61 74 6f |in{verba|tim}.ato|
|000008e0| 6d 3a 20 20 20 20 20 20 | 20 20 20 20 20 69 64 65 |m: | ide|
|000008f0| 6e 74 69 66 69 65 72 20 | 7c 20 6c 69 74 65 72 61 |ntifier || litera|
|00000900| 6c 20 7c 20 65 6e 63 6c | 6f 73 75 72 65 0d 65 6e |l | encl|osure.en|
|00000910| 63 6c 6f 73 75 72 65 3a | 20 20 20 20 20 20 70 61 |closure:| pa|
|00000920| 72 65 6e 74 68 5f 66 6f | 72 6d 20 7c 20 6c 69 73 |renth_fo|rm | lis|
|00000930| 74 5f 64 69 73 70 6c 61 | 79 20 7c 20 64 69 63 74 |t_displa|y | dict|
|00000940| 5f 64 69 73 70 6c 61 79 | 20 7c 20 73 74 72 69 6e |_display| | strin|
|00000950| 67 5f 63 6f 6e 76 65 72 | 73 69 6f 6e 0d 5c 65 6e |g_conver|sion.\en|
|00000960| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0d 0d 5c 73 75 |d{verbat|im}..\su|
|00000970| 62 73 65 63 74 69 6f 6e | 7b 49 64 65 6e 74 69 66 |bsection|{Identif|
|00000980| 69 65 72 73 20 28 4e 61 | 6d 65 73 29 7d 0d 5c 69 |iers (Na|mes)}.\i|
|00000990| 6e 64 65 78 7b 6e 61 6d | 65 7d 0d 5c 69 6e 64 65 |ndex{nam|e}.\inde|
|000009a0| 78 7b 69 64 65 6e 74 69 | 66 69 65 72 7d 0d 0d 41 |x{identi|fier}..A|
|000009b0| 6e 20 69 64 65 6e 74 69 | 66 69 65 72 20 6f 63 63 |n identi|fier occ|
|000009c0| 75 72 72 69 6e 67 20 61 | 73 20 61 6e 20 61 74 6f |urring a|s an ato|
|000009d0| 6d 20 69 73 20 61 20 72 | 65 66 65 72 65 6e 63 65 |m is a r|eference|
|000009e0| 20 74 6f 20 61 20 6c 6f | 63 61 6c 2c 20 67 6c 6f | to a lo|cal, glo|
|000009f0| 62 61 6c 0d 6f 72 20 62 | 75 69 6c 74 2d 69 6e 20 |bal.or b|uilt-in |
|00000a00| 6e 61 6d 65 20 62 69 6e | 64 69 6e 67 2e 20 20 49 |name bin|ding. I|
|00000a10| 66 20 61 20 6e 61 6d 65 | 20 69 73 20 61 73 73 69 |f a name| is assi|
|00000a20| 67 6e 65 64 20 74 6f 20 | 61 6e 79 77 68 65 72 65 |gned to |anywhere|
|00000a30| 20 69 6e 20 61 20 63 6f | 64 65 0d 62 6c 6f 63 6b | in a co|de.block|
|00000a40| 20 28 65 76 65 6e 20 69 | 6e 20 75 6e 72 65 61 63 | (even i|n unreac|
|00000a50| 68 61 62 6c 65 20 63 6f | 64 65 29 2c 20 61 6e 64 |hable co|de), and|
|00000a60| 20 69 73 20 6e 6f 74 20 | 6d 65 6e 74 69 6f 6e 65 | is not |mentione|
|00000a70| 64 20 69 6e 20 61 0d 5c | 76 65 72 62 40 67 6c 6f |d in a.\|verb@glo|
|00000a80| 62 61 6c 40 20 73 74 61 | 74 65 6d 65 6e 74 20 69 |bal@ sta|tement i|
|00000a90| 6e 20 74 68 61 74 20 63 | 6f 64 65 20 62 6c 6f 63 |n that c|ode bloc|
|00000aa0| 6b 2c 20 74 68 65 6e 20 | 69 74 20 72 65 66 65 72 |k, then |it refer|
|00000ab0| 73 20 74 6f 20 61 20 6c | 6f 63 61 6c 0d 6e 61 6d |s to a l|ocal.nam|
|00000ac0| 65 20 74 68 72 6f 75 67 | 68 6f 75 74 20 74 68 61 |e throug|hout tha|
|00000ad0| 74 20 63 6f 64 65 20 62 | 6c 6f 63 6b 2e 20 20 57 |t code b|lock. W|
|00000ae0| 68 65 6e 20 69 74 20 69 | 73 20 6e 6f 74 20 61 73 |hen it i|s not as|
|00000af0| 73 69 67 6e 65 64 20 74 | 6f 20 61 6e 79 77 68 65 |signed t|o anywhe|
|00000b00| 72 65 0d 69 6e 20 74 68 | 65 20 62 6c 6f 63 6b 2c |re.in th|e block,|
|00000b10| 20 6f 72 20 77 68 65 6e | 20 69 74 20 69 73 20 61 | or when| it is a|
|00000b20| 73 73 69 67 6e 65 64 20 | 74 6f 20 62 75 74 20 61 |ssigned |to but a|
|00000b30| 6c 73 6f 20 65 78 70 6c | 69 63 69 74 6c 79 20 6c |lso expl|icitly l|
|00000b40| 69 73 74 65 64 20 69 6e | 0d 61 20 5c 76 65 72 62 |isted in|.a \verb|
|00000b50| 40 67 6c 6f 62 61 6c 40 | 20 73 74 61 74 65 6d 65 |@global@| stateme|
|00000b60| 6e 74 2c 20 69 74 20 72 | 65 66 65 72 73 20 74 6f |nt, it r|efers to|
|00000b70| 20 61 20 67 6c 6f 62 61 | 6c 20 6e 61 6d 65 20 69 | a globa|l name i|
|00000b80| 66 20 6f 6e 65 20 65 78 | 69 73 74 73 2c 0d 65 6c |f one ex|ists,.el|
|00000b90| 73 65 20 74 6f 20 61 20 | 62 75 69 6c 74 2d 69 6e |se to a |built-in|
|00000ba0| 20 6e 61 6d 65 20 28 61 | 6e 64 20 74 68 69 73 20 | name (a|nd this |
|00000bb0| 62 69 6e 64 69 6e 67 20 | 6d 61 79 20 64 79 6e 61 |binding |may dyna|
|00000bc0| 6d 69 63 61 6c 6c 79 20 | 63 68 61 6e 67 65 29 2e |mically |change).|
|00000bd0| 0d 5c 69 6e 64 65 78 69 | 69 7b 6e 61 6d 65 7d 7b |.\indexi|i{name}{|
|00000be0| 62 69 6e 64 69 6e 67 7d | 0d 5c 69 6e 64 65 78 7b |binding}|.\index{|
|00000bf0| 63 6f 64 65 20 62 6c 6f | 63 6b 7d 0d 5c 73 74 69 |code blo|ck}.\sti|
|00000c00| 6e 64 65 78 7b 67 6c 6f | 62 61 6c 7d 0d 5c 69 6e |ndex{glo|bal}.\in|
|00000c10| 64 65 78 69 69 7b 62 75 | 69 6c 74 2d 69 6e 7d 7b |dexii{bu|ilt-in}{|
|00000c20| 6e 61 6d 65 7d 0d 5c 69 | 6e 64 65 78 69 69 7b 67 |name}.\i|ndexii{g|
|00000c30| 6c 6f 62 61 6c 7d 7b 6e | 61 6d 65 7d 0d 0d 57 68 |lobal}{n|ame}..Wh|
|00000c40| 65 6e 20 74 68 65 20 6e | 61 6d 65 20 69 73 20 62 |en the n|ame is b|
|00000c50| 6f 75 6e 64 20 74 6f 20 | 61 6e 20 6f 62 6a 65 63 |ound to |an objec|
|00000c60| 74 2c 20 65 76 61 6c 75 | 61 74 69 6f 6e 20 6f 66 |t, evalu|ation of|
|00000c70| 20 74 68 65 20 61 74 6f | 6d 20 79 69 65 6c 64 73 | the ato|m yields|
|00000c80| 0d 74 68 61 74 20 6f 62 | 6a 65 63 74 2e 20 20 57 |.that ob|ject. W|
|00000c90| 68 65 6e 20 61 20 6e 61 | 6d 65 20 69 73 20 6e 6f |hen a na|me is no|
|00000ca0| 74 20 62 6f 75 6e 64 2c | 20 61 6e 20 61 74 74 65 |t bound,| an atte|
|00000cb0| 6d 70 74 20 74 6f 20 65 | 76 61 6c 75 61 74 65 20 |mpt to e|valuate |
|00000cc0| 69 74 0d 72 61 69 73 65 | 73 20 61 20 5c 76 65 72 |it.raise|s a \ver|
|00000cd0| 62 40 4e 61 6d 65 45 72 | 72 6f 72 40 20 65 78 63 |b@NameEr|ror@ exc|
|00000ce0| 65 70 74 69 6f 6e 2e 0d | 5c 65 78 69 6e 64 65 78 |eption..|\exindex|
|00000cf0| 7b 4e 61 6d 65 45 72 72 | 6f 72 7d 0d 0d 5c 73 75 |{NameErr|or}..\su|
|00000d00| 62 73 65 63 74 69 6f 6e | 7b 4c 69 74 65 72 61 6c |bsection|{Literal|
|00000d10| 73 7d 0d 5c 69 6e 64 65 | 78 7b 6c 69 74 65 72 61 |s}.\inde|x{litera|
|00000d20| 6c 7d 0d 0d 50 79 74 68 | 6f 6e 20 6b 6e 6f 77 73 |l}..Pyth|on knows|
|00000d30| 20 73 74 72 69 6e 67 20 | 61 6e 64 20 6e 75 6d 65 | string |and nume|
|00000d40| 72 69 63 20 6c 69 74 65 | 72 61 6c 73 3a 0d 0d 5c |ric lite|rals:..\|
|00000d50| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0d |begin{ve|rbatim}.|
|00000d60| 6c 69 74 65 72 61 6c 3a | 20 20 20 20 20 20 20 20 |literal:| |
|00000d70| 73 74 72 69 6e 67 6c 69 | 74 65 72 61 6c 20 7c 20 |stringli|teral | |
|00000d80| 69 6e 74 65 67 65 72 20 | 7c 20 6c 6f 6e 67 69 6e |integer || longin|
|00000d90| 74 65 67 65 72 20 7c 20 | 66 6c 6f 61 74 6e 75 6d |teger | |floatnum|
|00000da0| 62 65 72 0d 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |ber.\end|{verbati|
|00000db0| 6d 7d 0d 0d 45 76 61 6c | 75 61 74 69 6f 6e 20 6f |m}..Eval|uation o|
|00000dc0| 66 20 61 20 6c 69 74 65 | 72 61 6c 20 79 69 65 6c |f a lite|ral yiel|
|00000dd0| 64 73 20 61 6e 20 6f 62 | 6a 65 63 74 20 6f 66 20 |ds an ob|ject of |
|00000de0| 74 68 65 20 67 69 76 65 | 6e 20 74 79 70 65 20 28 |the give|n type (|
|00000df0| 73 74 72 69 6e 67 2c 0d | 69 6e 74 65 67 65 72 2c |string,.|integer,|
|00000e00| 20 6c 6f 6e 67 20 69 6e | 74 65 67 65 72 2c 20 66 | long in|teger, f|
|00000e10| 6c 6f 61 74 69 6e 67 20 | 70 6f 69 6e 74 20 6e 75 |loating |point nu|
|00000e20| 6d 62 65 72 29 20 77 69 | 74 68 20 74 68 65 20 67 |mber) wi|th the g|
|00000e30| 69 76 65 6e 20 76 61 6c | 75 65 2e 0d 54 68 65 20 |iven val|ue..The |
|00000e40| 76 61 6c 75 65 20 6d 61 | 79 20 62 65 20 61 70 70 |value ma|y be app|
|00000e50| 72 6f 78 69 6d 61 74 65 | 64 20 69 6e 20 74 68 65 |roximate|d in the|
|00000e60| 20 63 61 73 65 20 6f 66 | 20 66 6c 6f 61 74 69 6e | case of| floatin|
|00000e70| 67 20 70 6f 69 6e 74 20 | 6c 69 74 65 72 61 6c 73 |g point |literals|
|00000e80| 2e 0d 53 65 65 20 73 65 | 63 74 69 6f 6e 20 5c 72 |..See se|ction \r|
|00000e90| 65 66 7b 6c 69 74 65 72 | 61 6c 73 7d 20 66 6f 72 |ef{liter|als} for|
|00000ea0| 20 64 65 74 61 69 6c 73 | 2e 0d 0d 41 6c 6c 20 6c | details|...All l|
|00000eb0| 69 74 65 72 61 6c 73 20 | 63 6f 72 72 65 73 70 6f |iterals |correspo|
|00000ec0| 6e 64 20 74 6f 20 69 6d | 6d 75 74 61 62 6c 65 20 |nd to im|mutable |
|00000ed0| 64 61 74 61 20 74 79 70 | 65 73 2c 20 61 6e 64 20 |data typ|es, and |
|00000ee0| 68 65 6e 63 65 20 74 68 | 65 0d 6f 62 6a 65 63 74 |hence th|e.object|
|00000ef0| 27 73 20 69 64 65 6e 74 | 69 74 79 20 69 73 20 6c |'s ident|ity is l|
|00000f00| 65 73 73 20 69 6d 70 6f | 72 74 61 6e 74 20 74 68 |ess impo|rtant th|
|00000f10| 61 6e 20 69 74 73 20 76 | 61 6c 75 65 2e 20 20 4d |an its v|alue. M|
|00000f20| 75 6c 74 69 70 6c 65 0d | 65 76 61 6c 75 61 74 69 |ultiple.|evaluati|
|00000f30| 6f 6e 73 20 6f 66 20 6c | 69 74 65 72 61 6c 73 20 |ons of l|iterals |
|00000f40| 77 69 74 68 20 74 68 65 | 20 73 61 6d 65 20 76 61 |with the| same va|
|00000f50| 6c 75 65 20 28 65 69 74 | 68 65 72 20 74 68 65 20 |lue (eit|her the |
|00000f60| 73 61 6d 65 0d 6f 63 63 | 75 72 72 65 6e 63 65 20 |same.occ|urrence |
|00000f70| 69 6e 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 74 |in the p|rogram t|
|00000f80| 65 78 74 20 6f 72 20 61 | 20 64 69 66 66 65 72 65 |ext or a| differe|
|00000f90| 6e 74 20 6f 63 63 75 72 | 72 65 6e 63 65 29 20 6d |nt occur|rence) m|
|00000fa0| 61 79 20 6f 62 74 61 69 | 6e 0d 74 68 65 20 73 61 |ay obtai|n.the sa|
|00000fb0| 6d 65 20 6f 62 6a 65 63 | 74 20 6f 72 20 61 20 64 |me objec|t or a d|
|00000fc0| 69 66 66 65 72 65 6e 74 | 20 6f 62 6a 65 63 74 20 |ifferent| object |
|00000fd0| 77 69 74 68 20 74 68 65 | 20 73 61 6d 65 20 76 61 |with the| same va|
|00000fe0| 6c 75 65 2e 0d 5c 69 6e | 64 65 78 69 69 69 7b 69 |lue..\in|dexiii{i|
|00000ff0| 6d 6d 75 74 61 62 6c 65 | 7d 7b 64 61 74 61 7d 7b |mmutable|}{data}{|
|00001000| 74 79 70 65 7d 0d 0d 28 | 49 6e 20 74 68 65 20 6f |type}..(|In the o|
|00001010| 72 69 67 69 6e 61 6c 20 | 69 6d 70 6c 65 6d 65 6e |riginal |implemen|
|00001020| 74 61 74 69 6f 6e 2c 20 | 61 6c 6c 20 6c 69 74 65 |tation, |all lite|
|00001030| 72 61 6c 73 20 69 6e 20 | 74 68 65 20 73 61 6d 65 |rals in |the same|
|00001040| 20 63 6f 64 65 20 62 6c | 6f 63 6b 0d 77 69 74 68 | code bl|ock.with|
|00001050| 20 74 68 65 20 73 61 6d | 65 20 74 79 70 65 20 61 | the sam|e type a|
|00001060| 6e 64 20 76 61 6c 75 65 | 20 79 69 65 6c 64 20 74 |nd value| yield t|
|00001070| 68 65 20 73 61 6d 65 20 | 6f 62 6a 65 63 74 2e 29 |he same |object.)|
|00001080| 0d 0d 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 50 61 |..\subse|ction{Pa|
|00001090| 72 65 6e 74 68 65 73 69 | 7a 65 64 20 66 6f 72 6d |renthesi|zed form|
|000010a0| 73 7d 0d 5c 69 6e 64 65 | 78 7b 70 61 72 65 6e 74 |s}.\inde|x{parent|
|000010b0| 68 65 73 69 7a 65 64 20 | 66 6f 72 6d 7d 0d 0d 41 |hesized |form}..A|
|000010c0| 20 70 61 72 65 6e 74 68 | 65 73 69 7a 65 64 20 66 | parenth|esized f|
|000010d0| 6f 72 6d 20 69 73 20 61 | 6e 20 6f 70 74 69 6f 6e |orm is a|n option|
|000010e0| 61 6c 20 63 6f 6e 64 69 | 74 69 6f 6e 20 6c 69 73 |al condi|tion lis|
|000010f0| 74 20 65 6e 63 6c 6f 73 | 65 64 20 69 6e 0d 70 61 |t enclos|ed in.pa|
|00001100| 72 65 6e 74 68 65 73 65 | 73 3a 0d 0d 5c 62 65 67 |renthese|s:..\beg|
|00001110| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0d 70 61 72 |in{verba|tim}.par|
|00001120| 65 6e 74 68 5f 66 6f 72 | 6d 3a 20 20 20 20 20 20 |enth_for|m: |
|00001130| 22 28 22 20 5b 63 6f 6e | 64 69 74 69 6f 6e 5f 6c |"(" [con|dition_l|
|00001140| 69 73 74 5d 20 22 29 22 | 0d 5c 65 6e 64 7b 76 65 |ist] ")"|.\end{ve|
|00001150| 72 62 61 74 69 6d 7d 0d | 0d 41 20 70 61 72 65 6e |rbatim}.|.A paren|
|00001160| 74 68 65 73 69 7a 65 64 | 20 63 6f 6e 64 69 74 69 |thesized| conditi|
|00001170| 6f 6e 20 6c 69 73 74 20 | 79 69 65 6c 64 73 20 77 |on list |yields w|
|00001180| 68 61 74 65 76 65 72 20 | 74 68 61 74 20 63 6f 6e |hatever |that con|
|00001190| 64 69 74 69 6f 6e 20 6c | 69 73 74 0d 79 69 65 6c |dition l|ist.yiel|
|000011a0| 64 73 2e 0d 0d 41 6e 20 | 65 6d 70 74 79 20 70 61 |ds...An |empty pa|
|000011b0| 69 72 20 6f 66 20 70 61 | 72 65 6e 74 68 65 73 65 |ir of pa|renthese|
|000011c0| 73 20 79 69 65 6c 64 73 | 20 61 6e 20 65 6d 70 74 |s yields| an empt|
|000011d0| 79 20 74 75 70 6c 65 20 | 6f 62 6a 65 63 74 2e 20 |y tuple |object. |
|000011e0| 20 53 69 6e 63 65 0d 74 | 75 70 6c 65 73 20 61 72 | Since.t|uples ar|
|000011f0| 65 20 69 6d 6d 75 74 61 | 62 6c 65 2c 20 74 68 65 |e immuta|ble, the|
|00001200| 20 72 75 6c 65 73 20 66 | 6f 72 20 6c 69 74 65 72 | rules f|or liter|
|00001210| 61 6c 73 20 61 70 70 6c | 79 20 68 65 72 65 2e 0d |als appl|y here..|
|00001220| 5c 69 6e 64 65 78 69 69 | 7b 65 6d 70 74 79 7d 7b |\indexii|{empty}{|
|00001230| 74 75 70 6c 65 7d 0d 0d | 28 4e 6f 74 65 20 74 68 |tuple}..|(Note th|
|00001240| 61 74 20 74 75 70 6c 65 | 73 20 61 72 65 20 6e 6f |at tuple|s are no|
|00001250| 74 20 66 6f 72 6d 65 64 | 20 62 79 20 74 68 65 20 |t formed| by the |
|00001260| 70 61 72 65 6e 74 68 65 | 73 65 73 2c 20 62 75 74 |parenthe|ses, but|
|00001270| 20 72 61 74 68 65 72 20 | 62 79 20 75 73 65 0d 6f | rather |by use.o|
|00001280| 66 20 74 68 65 20 63 6f | 6d 6d 61 20 6f 70 65 72 |f the co|mma oper|
|00001290| 61 74 6f 72 2e 20 20 54 | 68 65 20 65 78 63 65 70 |ator. T|he excep|
|000012a0| 74 69 6f 6e 20 69 73 20 | 74 68 65 20 65 6d 70 74 |tion is |the empt|
|000012b0| 79 20 74 75 70 6c 65 2c | 20 66 6f 72 20 77 68 69 |y tuple,| for whi|
|000012c0| 63 68 0d 70 61 72 65 6e | 74 68 65 73 65 73 20 7b |ch.paren|theses {|
|000012d0| 5c 65 6d 20 61 72 65 7d | 20 72 65 71 75 69 72 65 |\em are}| require|
|000012e0| 64 20 2d 2d 2d 20 61 6c | 6c 6f 77 69 6e 67 20 75 |d --- al|lowing u|
|000012f0| 6e 70 61 72 65 6e 74 68 | 65 73 69 7a 65 64 20 60 |nparenth|esized `|
|00001300| 60 6e 6f 74 68 69 6e 67 | 27 27 0d 69 6e 20 65 78 |`nothing|''.in ex|
|00001310| 70 72 65 73 73 69 6f 6e | 73 20 77 6f 75 6c 64 20 |pression|s would |
|00001320| 63 61 75 73 65 20 61 6d | 62 69 67 75 69 74 69 65 |cause am|biguitie|
|00001330| 73 20 61 6e 64 20 61 6c | 6c 6f 77 20 63 6f 6d 6d |s and al|low comm|
|00001340| 6f 6e 20 74 79 70 6f 73 | 20 74 6f 0d 70 61 73 73 |on typos| to.pass|
|00001350| 20 75 6e 63 61 75 67 68 | 74 2e 29 0d 5c 69 6e 64 | uncaugh|t.).\ind|
|00001360| 65 78 7b 63 6f 6d 6d 61 | 7d 0d 5c 69 6e 64 65 78 |ex{comma|}.\index|
|00001370| 69 69 7b 74 75 70 6c 65 | 7d 7b 64 69 73 70 6c 61 |ii{tuple|}{displa|
|00001380| 79 7d 0d 0d 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |y}..\sub|section{|
|00001390| 4c 69 73 74 20 64 69 73 | 70 6c 61 79 73 7d 0d 5c |List dis|plays}.\|
|000013a0| 69 6e 64 65 78 69 69 7b | 6c 69 73 74 7d 7b 64 69 |indexii{|list}{di|
|000013b0| 73 70 6c 61 79 7d 0d 0d | 41 20 6c 69 73 74 20 64 |splay}..|A list d|
|000013c0| 69 73 70 6c 61 79 20 69 | 73 20 61 20 70 6f 73 73 |isplay i|s a poss|
|000013d0| 69 62 6c 79 20 65 6d 70 | 74 79 20 73 65 72 69 65 |ibly emp|ty serie|
|000013e0| 73 20 6f 66 20 63 6f 6e | 64 69 74 69 6f 6e 73 20 |s of con|ditions |
|000013f0| 65 6e 63 6c 6f 73 65 64 | 20 69 6e 0d 73 71 75 61 |enclosed| in.squa|
|00001400| 72 65 20 62 72 61 63 6b | 65 74 73 3a 0d 0d 5c 62 |re brack|ets:..\b|
|00001410| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0d 6c |egin{ver|batim}.l|
|00001420| 69 73 74 5f 64 69 73 70 | 6c 61 79 3a 20 20 20 22 |ist_disp|lay: "|
|00001430| 5b 22 20 5b 63 6f 6e 64 | 69 74 69 6f 6e 5f 6c 69 |[" [cond|ition_li|
|00001440| 73 74 5d 20 22 5d 22 0d | 5c 65 6e 64 7b 76 65 72 |st] "]".|\end{ver|
|00001450| 62 61 74 69 6d 7d 0d 0d | 41 20 6c 69 73 74 20 64 |batim}..|A list d|
|00001460| 69 73 70 6c 61 79 20 79 | 69 65 6c 64 73 20 61 20 |isplay y|ields a |
|00001470| 6e 65 77 20 6c 69 73 74 | 20 6f 62 6a 65 63 74 2e |new list| object.|
|00001480| 0d 5c 6f 62 69 6e 64 65 | 78 7b 6c 69 73 74 7d 0d |.\obinde|x{list}.|
|00001490| 0d 49 66 20 69 74 20 68 | 61 73 20 6e 6f 20 63 6f |.If it h|as no co|
|000014a0| 6e 64 69 74 69 6f 6e 20 | 6c 69 73 74 2c 20 74 68 |ndition |list, th|
|000014b0| 65 20 6c 69 73 74 20 6f | 62 6a 65 63 74 20 68 61 |e list o|bject ha|
|000014c0| 73 20 6e 6f 20 69 74 65 | 6d 73 2e 20 20 4f 74 68 |s no ite|ms. Oth|
|000014d0| 65 72 77 69 73 65 2c 0d | 74 68 65 20 65 6c 65 6d |erwise,.|the elem|
|000014e0| 65 6e 74 73 20 6f 66 20 | 74 68 65 20 63 6f 6e 64 |ents of |the cond|
|000014f0| 69 74 69 6f 6e 20 6c 69 | 73 74 20 61 72 65 20 65 |ition li|st are e|
|00001500| 76 61 6c 75 61 74 65 64 | 20 66 72 6f 6d 20 6c 65 |valuated| from le|
|00001510| 66 74 20 74 6f 20 72 69 | 67 68 74 0d 61 6e 64 20 |ft to ri|ght.and |
|00001520| 69 6e 73 65 72 74 65 64 | 20 69 6e 20 74 68 65 20 |inserted| in the |
|00001530| 6c 69 73 74 20 6f 62 6a | 65 63 74 20 69 6e 20 74 |list obj|ect in t|
|00001540| 68 61 74 20 6f 72 64 65 | 72 2e 0d 5c 69 6e 64 65 |hat orde|r..\inde|
|00001550| 78 69 69 7b 65 6d 70 74 | 79 7d 7b 6c 69 73 74 7d |xii{empt|y}{list}|
|00001560| 0d 0d 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 44 69 |..\subse|ction{Di|
|00001570| 63 74 69 6f 6e 61 72 79 | 20 64 69 73 70 6c 61 79 |ctionary| display|
|00001580| 73 7d 20 5c 6c 61 62 65 | 6c 7b 64 69 63 74 7d 0d |s} \labe|l{dict}.|
|00001590| 5c 69 6e 64 65 78 69 69 | 7b 64 69 63 74 69 6f 6e |\indexii|{diction|
|000015a0| 61 72 79 7d 7b 64 69 73 | 70 6c 61 79 7d 0d 0d 41 |ary}{dis|play}..A|
|000015b0| 20 64 69 63 74 69 6f 6e | 61 72 79 20 64 69 73 70 | diction|ary disp|
|000015c0| 6c 61 79 20 69 73 20 61 | 20 70 6f 73 73 69 62 6c |lay is a| possibl|
|000015d0| 79 20 65 6d 70 74 79 20 | 73 65 72 69 65 73 20 6f |y empty |series o|
|000015e0| 66 20 6b 65 79 2f 64 61 | 74 75 6d 20 70 61 69 72 |f key/da|tum pair|
|000015f0| 73 0d 65 6e 63 6c 6f 73 | 65 64 20 69 6e 20 63 75 |s.enclos|ed in cu|
|00001600| 72 6c 79 20 62 72 61 63 | 65 73 3a 0d 5c 69 6e 64 |rly brac|es:.\ind|
|00001610| 65 78 7b 6b 65 79 7d 0d | 5c 69 6e 64 65 78 7b 64 |ex{key}.|\index{d|
|00001620| 61 74 75 6d 7d 0d 5c 69 | 6e 64 65 78 7b 6b 65 79 |atum}.\i|ndex{key|
|00001630| 2f 64 61 74 75 6d 20 70 | 61 69 72 7d 0d 0d 5c 62 |/datum p|air}..\b|
|00001640| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0d 64 |egin{ver|batim}.d|
|00001650| 69 63 74 5f 64 69 73 70 | 6c 61 79 3a 20 20 20 22 |ict_disp|lay: "|
|00001660| 7b 22 20 5b 6b 65 79 5f | 64 61 74 75 6d 5f 6c 69 |{" [key_|datum_li|
|00001670| 73 74 5d 20 22 7d 22 0d | 6b 65 79 5f 64 61 74 75 |st] "}".|key_datu|
|00001680| 6d 5f 6c 69 73 74 3a 20 | 6b 65 79 5f 64 61 74 75 |m_list: |key_datu|
|00001690| 6d 20 28 22 2c 22 20 6b | 65 79 5f 64 61 74 75 6d |m ("," k|ey_datum|
|000016a0| 29 2a 20 5b 22 2c 22 5d | 0d 6b 65 79 5f 64 61 74 |)* [","]|.key_dat|
|000016b0| 75 6d 3a 20 20 20 20 20 | 20 63 6f 6e 64 69 74 69 |um: | conditi|
|000016c0| 6f 6e 20 22 3a 22 20 63 | 6f 6e 64 69 74 69 6f 6e |on ":" c|ondition|
|000016d0| 0d 5c 65 6e 64 7b 76 65 | 72 62 61 74 69 6d 7d 0d |.\end{ve|rbatim}.|
|000016e0| 0d 41 20 64 69 63 74 69 | 6f 6e 61 72 79 20 64 69 |.A dicti|onary di|
|000016f0| 73 70 6c 61 79 20 79 69 | 65 6c 64 73 20 61 20 6e |splay yi|elds a n|
|00001700| 65 77 20 64 69 63 74 69 | 6f 6e 61 72 79 20 6f 62 |ew dicti|onary ob|
|00001710| 6a 65 63 74 2e 0d 5c 6f | 62 69 6e 64 65 78 7b 64 |ject..\o|bindex{d|
|00001720| 69 63 74 69 6f 6e 61 72 | 79 7d 0d 0d 54 68 65 20 |ictionar|y}..The |
|00001730| 6b 65 79 2f 64 61 74 75 | 6d 20 70 61 69 72 73 20 |key/datu|m pairs |
|00001740| 61 72 65 20 65 76 61 6c | 75 61 74 65 64 20 66 72 |are eval|uated fr|
|00001750| 6f 6d 20 6c 65 66 74 20 | 74 6f 20 72 69 67 68 74 |om left |to right|
|00001760| 20 74 6f 20 64 65 66 69 | 6e 65 20 74 68 65 0d 65 | to defi|ne the.e|
|00001770| 6e 74 72 69 65 73 20 6f | 66 20 74 68 65 20 64 69 |ntries o|f the di|
|00001780| 63 74 69 6f 6e 61 72 79 | 3a 20 65 61 63 68 20 6b |ctionary|: each k|
|00001790| 65 79 20 6f 62 6a 65 63 | 74 20 69 73 20 75 73 65 |ey objec|t is use|
|000017a0| 64 20 61 73 20 61 20 6b | 65 79 20 69 6e 74 6f 20 |d as a k|ey into |
|000017b0| 74 68 65 0d 64 69 63 74 | 69 6f 6e 61 72 79 20 74 |the.dict|ionary t|
|000017c0| 6f 20 73 74 6f 72 65 20 | 74 68 65 20 63 6f 72 72 |o store |the corr|
|000017d0| 65 73 70 6f 6e 64 69 6e | 67 20 64 61 74 75 6d 2e |espondin|g datum.|
|000017e0| 0d 0d 52 65 73 74 72 69 | 63 74 69 6f 6e 73 20 6f |..Restri|ctions o|
|000017f0| 6e 20 74 68 65 20 74 79 | 70 65 73 20 6f 66 20 74 |n the ty|pes of t|
|00001800| 68 65 20 6b 65 79 20 76 | 61 6c 75 65 73 20 61 72 |he key v|alues ar|
|00001810| 65 20 6c 69 73 74 65 64 | 20 65 61 72 6c 69 65 72 |e listed| earlier|
|00001820| 20 69 6e 0d 73 65 63 74 | 69 6f 6e 20 5c 72 65 66 | in.sect|ion \ref|
|00001830| 7b 74 79 70 65 73 7d 2e | 0d 43 6c 61 73 68 65 73 |{types}.|.Clashes|
|00001840| 20 62 65 74 77 65 65 6e | 20 64 75 70 6c 69 63 61 | between| duplica|
|00001850| 74 65 20 6b 65 79 73 20 | 61 72 65 20 6e 6f 74 20 |te keys |are not |
|00001860| 64 65 74 65 63 74 65 64 | 3b 20 74 68 65 20 6c 61 |detected|; the la|
|00001870| 73 74 0d 64 61 74 75 6d | 20 28 74 65 78 74 75 61 |st.datum| (textua|
|00001880| 6c 6c 79 20 72 69 67 68 | 74 6d 6f 73 74 20 69 6e |lly righ|tmost in|
|00001890| 20 74 68 65 20 64 69 73 | 70 6c 61 79 29 20 73 74 | the dis|play) st|
|000018a0| 6f 72 65 64 20 66 6f 72 | 20 61 20 67 69 76 65 6e |ored for| a given|
|000018b0| 20 6b 65 79 0d 76 61 6c | 75 65 20 70 72 65 76 61 | key.val|ue preva|
|000018c0| 69 6c 73 2e 0d 5c 65 78 | 69 6e 64 65 78 7b 54 79 |ils..\ex|index{Ty|
|000018d0| 70 65 45 72 72 6f 72 7d | 0d 0d 5c 73 75 62 73 65 |peError}|..\subse|
|000018e0| 63 74 69 6f 6e 7b 53 74 | 72 69 6e 67 20 63 6f 6e |ction{St|ring con|
|000018f0| 76 65 72 73 69 6f 6e 73 | 7d 0d 5c 69 6e 64 65 78 |versions|}.\index|
|00001900| 69 69 7b 73 74 72 69 6e | 67 7d 7b 63 6f 6e 76 65 |ii{strin|g}{conve|
|00001910| 72 73 69 6f 6e 7d 0d 0d | 41 20 73 74 72 69 6e 67 |rsion}..|A string|
|00001920| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 20 69 73 20 61 | convers|ion is a|
|00001930| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 6c 69 73 74 20 | conditi|on list |
|00001940| 65 6e 63 6c 6f 73 65 64 | 20 69 6e 20 72 65 76 65 |enclosed| in reve|
|00001950| 72 73 65 20 28 6f 72 0d | 62 61 63 6b 77 61 72 64 |rse (or.|backward|
|00001960| 29 20 71 75 6f 74 65 73 | 3a 0d 0d 5c 62 65 67 69 |) quotes|:..\begi|
|00001970| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0d 73 74 72 69 |n{verbat|im}.stri|
|00001980| 6e 67 5f 63 6f 6e 76 65 | 72 73 69 6f 6e 3a 20 22 |ng_conve|rsion: "|
|00001990| 60 22 20 63 6f 6e 64 69 | 74 69 6f 6e 5f 6c 69 73 |`" condi|tion_lis|
|000019a0| 74 20 22 60 22 0d 5c 65 | 6e 64 7b 76 65 72 62 61 |t "`".\e|nd{verba|
|000019b0| 74 69 6d 7d 0d 0d 41 20 | 73 74 72 69 6e 67 20 63 |tim}..A |string c|
|000019c0| 6f 6e 76 65 72 73 69 6f | 6e 20 65 76 61 6c 75 61 |onversio|n evalua|
|000019d0| 74 65 73 20 74 68 65 20 | 63 6f 6e 74 61 69 6e 65 |tes the |containe|
|000019e0| 64 20 63 6f 6e 64 69 74 | 69 6f 6e 20 6c 69 73 74 |d condit|ion list|
|000019f0| 20 61 6e 64 0d 63 6f 6e | 76 65 72 74 73 20 74 68 | and.con|verts th|
|00001a00| 65 20 72 65 73 75 6c 74 | 69 6e 67 20 6f 62 6a 65 |e result|ing obje|
|00001a10| 63 74 20 69 6e 74 6f 20 | 61 20 73 74 72 69 6e 67 |ct into |a string|
|00001a20| 20 61 63 63 6f 72 64 69 | 6e 67 20 74 6f 20 72 75 | accordi|ng to ru|
|00001a30| 6c 65 73 0d 73 70 65 63 | 69 66 69 63 20 74 6f 20 |les.spec|ific to |
|00001a40| 69 74 73 20 74 79 70 65 | 2e 0d 0d 49 66 20 74 68 |its type|...If th|
|00001a50| 65 20 6f 62 6a 65 63 74 | 20 69 73 20 61 20 73 74 |e object| is a st|
|00001a60| 72 69 6e 67 2c 20 61 20 | 6e 75 6d 62 65 72 2c 20 |ring, a |number, |
|00001a70| 5c 76 65 72 62 40 4e 6f | 6e 65 40 2c 20 6f 72 20 |\verb@No|ne@, or |
|00001a80| 61 20 74 75 70 6c 65 2c | 20 6c 69 73 74 20 6f 72 |a tuple,| list or|
|00001a90| 0d 64 69 63 74 69 6f 6e | 61 72 79 20 63 6f 6e 74 |.diction|ary cont|
|00001aa0| 61 69 6e 69 6e 67 20 6f | 6e 6c 79 20 6f 62 6a 65 |aining o|nly obje|
|00001ab0| 63 74 73 20 77 68 6f 73 | 65 20 74 79 70 65 20 69 |cts whos|e type i|
|00001ac0| 73 20 6f 6e 65 20 6f 66 | 20 74 68 65 73 65 2c 20 |s one of| these, |
|00001ad0| 74 68 65 0d 72 65 73 75 | 6c 74 69 6e 67 20 73 74 |the.resu|lting st|
|00001ae0| 72 69 6e 67 20 69 73 20 | 61 20 76 61 6c 69 64 20 |ring is |a valid |
|00001af0| 50 79 74 68 6f 6e 20 65 | 78 70 72 65 73 73 69 6f |Python e|xpressio|
|00001b00| 6e 20 77 68 69 63 68 20 | 63 61 6e 20 62 65 20 70 |n which |can be p|
|00001b10| 61 73 73 65 64 20 74 6f | 0d 74 68 65 20 62 75 69 |assed to|.the bui|
|00001b20| 6c 74 2d 69 6e 20 66 75 | 6e 63 74 69 6f 6e 20 5c |lt-in fu|nction \|
|00001b30| 76 65 72 62 40 65 76 61 | 6c 28 29 40 20 74 6f 20 |verb@eva|l()@ to |
|00001b40| 79 69 65 6c 64 20 61 6e | 20 65 78 70 72 65 73 73 |yield an| express|
|00001b50| 69 6f 6e 20 77 69 74 68 | 20 74 68 65 0d 73 61 6d |ion with| the.sam|
|00001b60| 65 20 76 61 6c 75 65 20 | 28 6f 72 20 61 6e 20 61 |e value |(or an a|
|00001b70| 70 70 72 6f 78 69 6d 61 | 74 69 6f 6e 2c 20 69 66 |pproxima|tion, if|
|00001b80| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | floatin|g point |
|00001b90| 6e 75 6d 62 65 72 73 20 | 61 72 65 0d 69 6e 76 6f |numbers |are.invo|
|00001ba0| 6c 76 65 64 29 2e 0d 0d | 28 49 6e 20 70 61 72 74 |lved)...|(In part|
|00001bb0| 69 63 75 6c 61 72 2c 20 | 63 6f 6e 76 65 72 74 69 |icular, |converti|
|00001bc0| 6e 67 20 61 20 73 74 72 | 69 6e 67 20 61 64 64 73 |ng a str|ing adds|
|00001bd0| 20 71 75 6f 74 65 73 20 | 61 72 6f 75 6e 64 20 69 | quotes |around i|
|00001be0| 74 20 61 6e 64 20 63 6f | 6e 76 65 72 74 73 0d 60 |t and co|nverts.`|
|00001bf0| 60 66 75 6e 6e 79 27 27 | 20 63 68 61 72 61 63 74 |`funny''| charact|
|00001c00| 65 72 73 20 74 6f 20 65 | 73 63 61 70 65 20 73 65 |ers to e|scape se|
|00001c10| 71 75 65 6e 63 65 73 20 | 74 68 61 74 20 61 72 65 |quences |that are|
|00001c20| 20 73 61 66 65 20 74 6f | 20 70 72 69 6e 74 2e 29 | safe to| print.)|
|00001c30| 0d 0d 49 74 20 69 73 20 | 69 6c 6c 65 67 61 6c 20 |..It is |illegal |
|00001c40| 74 6f 20 61 74 74 65 6d | 70 74 20 74 6f 20 63 6f |to attem|pt to co|
|00001c50| 6e 76 65 72 74 20 72 65 | 63 75 72 73 69 76 65 20 |nvert re|cursive |
|00001c60| 6f 62 6a 65 63 74 73 20 | 28 65 2e 67 2e 20 6c 69 |objects |(e.g. li|
|00001c70| 73 74 73 20 6f 72 0d 64 | 69 63 74 69 6f 6e 61 72 |sts or.d|ictionar|
|00001c80| 69 65 73 20 74 68 61 74 | 20 63 6f 6e 74 61 69 6e |ies that| contain|
|00001c90| 20 61 20 72 65 66 65 72 | 65 6e 63 65 20 74 6f 20 | a refer|ence to |
|00001ca0| 74 68 65 6d 73 65 6c 76 | 65 73 2c 20 64 69 72 65 |themselv|es, dire|
|00001cb0| 63 74 6c 79 20 6f 72 0d | 69 6e 64 69 72 65 63 74 |ctly or.|indirect|
|00001cc0| 6c 79 2e 29 0d 5c 6f 62 | 69 6e 64 65 78 7b 72 65 |ly.).\ob|index{re|
|00001cd0| 63 75 72 73 69 76 65 7d | 0d 0d 5c 73 65 63 74 69 |cursive}|..\secti|
|00001ce0| 6f 6e 7b 50 72 69 6d 61 | 72 69 65 73 7d 20 5c 6c |on{Prima|ries} \l|
|00001cf0| 61 62 65 6c 7b 70 72 69 | 6d 61 72 69 65 73 7d 0d |abel{pri|maries}.|
|00001d00| 5c 69 6e 64 65 78 7b 70 | 72 69 6d 61 72 79 7d 0d |\index{p|rimary}.|
|00001d10| 0d 50 72 69 6d 61 72 69 | 65 73 20 72 65 70 72 65 |.Primari|es repre|
|00001d20| 73 65 6e 74 20 74 68 65 | 20 6d 6f 73 74 20 74 69 |sent the| most ti|
|00001d30| 67 68 74 6c 79 20 62 6f | 75 6e 64 20 6f 70 65 72 |ghtly bo|und oper|
|00001d40| 61 74 69 6f 6e 73 20 6f | 66 20 74 68 65 20 6c 61 |ations o|f the la|
|00001d50| 6e 67 75 61 67 65 2e 0d | 54 68 65 69 72 20 73 79 |nguage..|Their sy|
|00001d60| 6e 74 61 78 20 69 73 3a | 0d 0d 5c 62 65 67 69 6e |ntax is:|..\begin|
|00001d70| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 70 72 69 6d 61 |{verbati|m}.prima|
|00001d80| 72 79 3a 20 20 20 20 20 | 20 20 20 61 74 6f 6d 20 |ry: | atom |
|00001d90| 7c 20 61 74 74 72 69 62 | 75 74 65 72 65 66 20 7c || attrib|uteref ||
|00001da0| 20 73 75 62 73 63 72 69 | 70 74 69 6f 6e 20 7c 20 | subscri|ption | |
|00001db0| 73 6c 69 63 69 6e 67 20 | 7c 20 63 61 6c 6c 0d 5c |slicing || call.\|
|00001dc0| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0d 0d 5c |end{verb|atim}..\|
|00001dd0| 73 75 62 73 65 63 74 69 | 6f 6e 7b 41 74 74 72 69 |subsecti|on{Attri|
|00001de0| 62 75 74 65 20 72 65 66 | 65 72 65 6e 63 65 73 7d |bute ref|erences}|
|00001df0| 0d 5c 69 6e 64 65 78 69 | 69 7b 61 74 74 72 69 62 |.\indexi|i{attrib|
|00001e00| 75 74 65 7d 7b 72 65 66 | 65 72 65 6e 63 65 7d 0d |ute}{ref|erence}.|
|00001e10| 0d 41 6e 20 61 74 74 72 | 69 62 75 74 65 20 72 65 |.An attr|ibute re|
|00001e20| 66 65 72 65 6e 63 65 20 | 69 73 20 61 20 70 72 69 |ference |is a pri|
|00001e30| 6d 61 72 79 20 66 6f 6c | 6c 6f 77 65 64 20 62 79 |mary fol|lowed by|
|00001e40| 20 61 20 70 65 72 69 6f | 64 20 61 6e 64 20 61 20 | a perio|d and a |
|00001e50| 6e 61 6d 65 3a 0d 0d 5c | 62 65 67 69 6e 7b 76 65 |name:..\|begin{ve|
|00001e60| 72 62 61 74 69 6d 7d 0d | 61 74 74 72 69 62 75 74 |rbatim}.|attribut|
|00001e70| 65 72 65 66 3a 20 20 20 | 70 72 69 6d 61 72 79 20 |eref: |primary |
|00001e80| 22 2e 22 20 69 64 65 6e | 74 69 66 69 65 72 0d 5c |"." iden|tifier.\|
|00001e90| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0d 0d 54 |end{verb|atim}..T|
|00001ea0| 68 65 20 70 72 69 6d 61 | 72 79 20 6d 75 73 74 20 |he prima|ry must |
|00001eb0| 65 76 61 6c 75 61 74 65 | 20 74 6f 20 61 6e 20 6f |evaluate| to an o|
|00001ec0| 62 6a 65 63 74 20 6f 66 | 20 61 20 74 79 70 65 20 |bject of| a type |
|00001ed0| 74 68 61 74 20 73 75 70 | 70 6f 72 74 73 0d 61 74 |that sup|ports.at|
|00001ee0| 74 72 69 62 75 74 65 20 | 72 65 66 65 72 65 6e 63 |tribute |referenc|
|00001ef0| 65 73 2c 20 65 2e 67 2e | 20 61 20 6d 6f 64 75 6c |es, e.g.| a modul|
|00001f00| 65 20 6f 72 20 61 20 6c | 69 73 74 2e 20 20 54 68 |e or a l|ist. Th|
|00001f10| 69 73 20 6f 62 6a 65 63 | 74 20 69 73 20 74 68 65 |is objec|t is the|
|00001f20| 6e 0d 61 73 6b 65 64 20 | 74 6f 20 70 72 6f 64 75 |n.asked |to produ|
|00001f30| 63 65 20 74 68 65 20 61 | 74 74 72 69 62 75 74 65 |ce the a|ttribute|
|00001f40| 20 77 68 6f 73 65 20 6e | 61 6d 65 20 69 73 20 74 | whose n|ame is t|
|00001f50| 68 65 20 69 64 65 6e 74 | 69 66 69 65 72 2e 20 20 |he ident|ifier. |
|00001f60| 49 66 20 74 68 69 73 0d | 61 74 74 72 69 62 75 74 |If this.|attribut|
|00001f70| 65 20 69 73 20 6e 6f 74 | 20 61 76 61 69 6c 61 62 |e is not| availab|
|00001f80| 6c 65 2c 20 74 68 65 20 | 65 78 63 65 70 74 69 6f |le, the |exceptio|
|00001f90| 6e 20 5c 76 65 72 62 40 | 41 74 74 72 69 62 75 74 |n \verb@|Attribut|
|00001fa0| 65 45 72 72 6f 72 40 20 | 69 73 0d 72 61 69 73 65 |eError@ |is.raise|
|00001fb0| 64 2e 20 20 4f 74 68 65 | 72 77 69 73 65 2c 20 74 |d. Othe|rwise, t|
|00001fc0| 68 65 20 74 79 70 65 20 | 61 6e 64 20 76 61 6c 75 |he type |and valu|
|00001fd0| 65 20 6f 66 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |e of the| object |
|00001fe0| 70 72 6f 64 75 63 65 64 | 20 69 73 0d 64 65 74 65 |produced| is.dete|
|00001ff0| 72 6d 69 6e 65 64 20 62 | 79 20 74 68 65 20 6f 62 |rmined b|y the ob|
|00002000| 6a 65 63 74 2e 20 20 4d | 75 6c 74 69 70 6c 65 20 |ject. M|ultiple |
|00002010| 65 76 61 6c 75 61 74 69 | 6f 6e 73 20 6f 66 20 74 |evaluati|ons of t|
|00002020| 68 65 20 73 61 6d 65 20 | 61 74 74 72 69 62 75 74 |he same |attribut|
|00002030| 65 0d 72 65 66 65 72 65 | 6e 63 65 20 6d 61 79 20 |e.refere|nce may |
|00002040| 79 69 65 6c 64 20 64 69 | 66 66 65 72 65 6e 74 20 |yield di|fferent |
|00002050| 6f 62 6a 65 63 74 73 2e | 0d 5c 6f 62 69 6e 64 65 |objects.|.\obinde|
|00002060| 78 7b 6d 6f 64 75 6c 65 | 7d 0d 5c 6f 62 69 6e 64 |x{module|}.\obind|
|00002070| 65 78 7b 6c 69 73 74 7d | 0d 0d 5c 73 75 62 73 65 |ex{list}|..\subse|
|00002080| 63 74 69 6f 6e 7b 53 75 | 62 73 63 72 69 70 74 69 |ction{Su|bscripti|
|00002090| 6f 6e 73 7d 0d 5c 69 6e | 64 65 78 7b 73 75 62 73 |ons}.\in|dex{subs|
|000020a0| 63 72 69 70 74 69 6f 6e | 7d 0d 0d 41 20 73 75 62 |cription|}..A sub|
|000020b0| 73 63 72 69 70 74 69 6f | 6e 20 73 65 6c 65 63 74 |scriptio|n select|
|000020c0| 73 20 61 6e 20 69 74 65 | 6d 20 6f 66 20 61 20 73 |s an ite|m of a s|
|000020d0| 65 71 75 65 6e 63 65 20 | 28 73 74 72 69 6e 67 2c |equence |(string,|
|000020e0| 20 74 75 70 6c 65 20 6f | 72 20 6c 69 73 74 29 0d | tuple o|r list).|
|000020f0| 6f 72 20 6d 61 70 70 69 | 6e 67 20 28 64 69 63 74 |or mappi|ng (dict|
|00002100| 69 6f 6e 61 72 79 29 20 | 6f 62 6a 65 63 74 3a 0d |ionary) |object:.|
|00002110| 5c 6f 62 69 6e 64 65 78 | 7b 73 65 71 75 65 6e 63 |\obindex|{sequenc|
|00002120| 65 7d 0d 5c 6f 62 69 6e | 64 65 78 7b 6d 61 70 70 |e}.\obin|dex{mapp|
|00002130| 69 6e 67 7d 0d 5c 6f 62 | 69 6e 64 65 78 7b 73 74 |ing}.\ob|index{st|
|00002140| 72 69 6e 67 7d 0d 5c 6f | 62 69 6e 64 65 78 7b 74 |ring}.\o|bindex{t|
|00002150| 75 70 6c 65 7d 0d 5c 6f | 62 69 6e 64 65 78 7b 6c |uple}.\o|bindex{l|
|00002160| 69 73 74 7d 0d 5c 6f 62 | 69 6e 64 65 78 7b 64 69 |ist}.\ob|index{di|
|00002170| 63 74 69 6f 6e 61 72 79 | 7d 0d 5c 69 6e 64 65 78 |ctionary|}.\index|
|00002180| 69 69 7b 73 65 71 75 65 | 6e 63 65 7d 7b 69 74 65 |ii{seque|nce}{ite|
|00002190| 6d 7d 0d 0d 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |m}..\beg|in{verba|
|000021a0| 74 69 6d 7d 0d 73 75 62 | 73 63 72 69 70 74 69 6f |tim}.sub|scriptio|
|000021b0| 6e 3a 20 20 20 70 72 69 | 6d 61 72 79 20 22 5b 22 |n: pri|mary "["|
|000021c0| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 22 5d 22 0d 5c | conditi|on "]".\|
|000021d0| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0d 0d 54 |end{verb|atim}..T|
|000021e0| 68 65 20 70 72 69 6d 61 | 72 79 20 6d 75 73 74 20 |he prima|ry must |
|000021f0| 65 76 61 6c 75 61 74 65 | 20 74 6f 20 61 6e 20 6f |evaluate| to an o|
|00002200| 62 6a 65 63 74 20 6f 66 | 20 61 20 73 65 71 75 65 |bject of| a seque|
|00002210| 6e 63 65 20 6f 72 20 6d | 61 70 70 69 6e 67 20 74 |nce or m|apping t|
|00002220| 79 70 65 2e 0d 0d 49 66 | 20 69 74 20 69 73 20 61 |ype...If| it is a|
|00002230| 20 6d 61 70 70 69 6e 67 | 2c 20 74 68 65 20 63 6f | mapping|, the co|
|00002240| 6e 64 69 74 69 6f 6e 20 | 6d 75 73 74 20 65 76 61 |ndition |must eva|
|00002250| 6c 75 61 74 65 20 74 6f | 20 61 6e 20 6f 62 6a 65 |luate to| an obje|
|00002260| 63 74 20 77 68 6f 73 65 | 0d 76 61 6c 75 65 20 69 |ct whose|.value i|
|00002270| 73 20 6f 6e 65 20 6f 66 | 20 74 68 65 20 6b 65 79 |s one of| the key|
|00002280| 73 20 6f 66 20 74 68 65 | 20 6d 61 70 70 69 6e 67 |s of the| mapping|
|00002290| 2c 20 61 6e 64 20 74 68 | 65 20 73 75 62 73 63 72 |, and th|e subscr|
|000022a0| 69 70 74 69 6f 6e 20 73 | 65 6c 65 63 74 73 0d 74 |iption s|elects.t|
|000022b0| 68 65 20 76 61 6c 75 65 | 20 69 6e 20 74 68 65 20 |he value| in the |
|000022c0| 6d 61 70 70 69 6e 67 20 | 74 68 61 74 20 63 6f 72 |mapping |that cor|
|000022d0| 72 65 73 70 6f 6e 64 73 | 20 74 6f 20 74 68 61 74 |responds| to that|
|000022e0| 20 6b 65 79 2e 0d 0d 49 | 66 20 69 74 20 69 73 20 | key...I|f it is |
|000022f0| 61 20 73 65 71 75 65 6e | 63 65 2c 20 74 68 65 20 |a sequen|ce, the |
|00002300| 63 6f 6e 64 69 74 69 6f | 6e 20 6d 75 73 74 20 65 |conditio|n must e|
|00002310| 76 61 6c 75 61 74 65 20 | 74 6f 20 61 20 70 6c 61 |valuate |to a pla|
|00002320| 69 6e 20 69 6e 74 65 67 | 65 72 2e 0d 49 66 20 74 |in integ|er..If t|
|00002330| 68 69 73 20 76 61 6c 75 | 65 20 69 73 20 6e 65 67 |his valu|e is neg|
|00002340| 61 74 69 76 65 2c 20 74 | 68 65 20 6c 65 6e 67 74 |ative, t|he lengt|
|00002350| 68 20 6f 66 20 74 68 65 | 20 73 65 71 75 65 6e 63 |h of the| sequenc|
|00002360| 65 20 69 73 20 61 64 64 | 65 64 20 74 6f 20 69 74 |e is add|ed to it|
|00002370| 0d 28 73 6f 20 74 68 61 | 74 2c 20 65 2e 67 2e 20 |.(so tha|t, e.g. |
|00002380| 5c 76 65 72 62 40 78 5b | 2d 31 5d 40 20 73 65 6c |\verb@x[|-1]@ sel|
|00002390| 65 63 74 73 20 74 68 65 | 20 6c 61 73 74 20 69 74 |ects the| last it|
|000023a0| 65 6d 20 6f 66 20 5c 76 | 65 72 62 40 78 40 2e 29 |em of \v|erb@x@.)|
|000023b0| 0d 54 68 65 20 72 65 73 | 75 6c 74 69 6e 67 20 76 |.The res|ulting v|
|000023c0| 61 6c 75 65 20 6d 75 73 | 74 20 62 65 20 61 20 6e |alue mus|t be a n|
|000023d0| 6f 6e 6e 65 67 61 74 69 | 76 65 20 69 6e 74 65 67 |onnegati|ve integ|
|000023e0| 65 72 20 73 6d 61 6c 6c | 65 72 20 74 68 61 6e 20 |er small|er than |
|000023f0| 74 68 65 0d 6e 75 6d 62 | 65 72 20 6f 66 20 69 74 |the.numb|er of it|
|00002400| 65 6d 73 20 69 6e 20 74 | 68 65 20 73 65 71 75 65 |ems in t|he seque|
|00002410| 6e 63 65 2c 20 61 6e 64 | 20 74 68 65 20 73 75 62 |nce, and| the sub|
|00002420| 73 63 72 69 70 74 69 6f | 6e 20 73 65 6c 65 63 74 |scriptio|n select|
|00002430| 73 20 74 68 65 20 69 74 | 65 6d 0d 77 68 6f 73 65 |s the it|em.whose|
|00002440| 20 69 6e 64 65 78 20 69 | 73 20 74 68 61 74 20 76 | index i|s that v|
|00002450| 61 6c 75 65 20 28 63 6f | 75 6e 74 69 6e 67 20 66 |alue (co|unting f|
|00002460| 72 6f 6d 20 7a 65 72 6f | 29 2e 0d 0d 41 20 73 74 |rom zero|)...A st|
|00002470| 72 69 6e 67 27 73 20 69 | 74 65 6d 73 20 61 72 65 |ring's i|tems are|
|00002480| 20 63 68 61 72 61 63 74 | 65 72 73 2e 20 20 41 20 | charact|ers. A |
|00002490| 63 68 61 72 61 63 74 65 | 72 20 69 73 20 6e 6f 74 |characte|r is not|
|000024a0| 20 61 20 73 65 70 61 72 | 61 74 65 20 64 61 74 61 | a separ|ate data|
|000024b0| 0d 74 79 70 65 20 62 75 | 74 20 61 20 73 74 72 69 |.type bu|t a stri|
|000024c0| 6e 67 20 6f 66 20 65 78 | 61 63 74 6c 79 20 6f 6e |ng of ex|actly on|
|000024d0| 65 20 63 68 61 72 61 63 | 74 65 72 2e 0d 5c 69 6e |e charac|ter..\in|
|000024e0| 64 65 78 7b 63 68 61 72 | 61 63 74 65 72 7d 0d 5c |dex{char|acter}.\|
|000024f0| 69 6e 64 65 78 69 69 7b | 73 74 72 69 6e 67 7d 7b |indexii{|string}{|
|00002500| 69 74 65 6d 7d 0d 0d 5c | 73 75 62 73 65 63 74 69 |item}..\|subsecti|
|00002510| 6f 6e 7b 53 6c 69 63 69 | 6e 67 73 7d 0d 5c 69 6e |on{Slici|ngs}.\in|
|00002520| 64 65 78 7b 73 6c 69 63 | 69 6e 67 7d 0d 5c 69 6e |dex{slic|ing}.\in|
|00002530| 64 65 78 7b 73 6c 69 63 | 65 7d 0d 0d 41 20 73 6c |dex{slic|e}..A sl|
|00002540| 69 63 69 6e 67 20 28 6f | 72 20 73 6c 69 63 65 29 |icing (o|r slice)|
|00002550| 20 73 65 6c 65 63 74 73 | 20 61 20 72 61 6e 67 65 | selects| a range|
|00002560| 20 6f 66 20 69 74 65 6d | 73 20 69 6e 20 61 20 73 | of item|s in a s|
|00002570| 65 71 75 65 6e 63 65 20 | 28 73 74 72 69 6e 67 2c |equence |(string,|
|00002580| 0d 74 75 70 6c 65 20 6f | 72 20 6c 69 73 74 29 20 |.tuple o|r list) |
|00002590| 6f 62 6a 65 63 74 3a 0d | 5c 6f 62 69 6e 64 65 78 |object:.|\obindex|
|000025a0| 7b 73 65 71 75 65 6e 63 | 65 7d 0d 5c 6f 62 69 6e |{sequenc|e}.\obin|
|000025b0| 64 65 78 7b 73 74 72 69 | 6e 67 7d 0d 5c 6f 62 69 |dex{stri|ng}.\obi|
|000025c0| 6e 64 65 78 7b 74 75 70 | 6c 65 7d 0d 5c 6f 62 69 |ndex{tup|le}.\obi|
|000025d0| 6e 64 65 78 7b 6c 69 73 | 74 7d 0d 0d 5c 62 65 67 |ndex{lis|t}..\beg|
|000025e0| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0d 73 6c 69 |in{verba|tim}.sli|
|000025f0| 63 69 6e 67 3a 20 20 20 | 20 20 20 20 20 70 72 69 |cing: | pri|
|00002600| 6d 61 72 79 20 22 5b 22 | 20 5b 63 6f 6e 64 69 74 |mary "["| [condit|
|00002610| 69 6f 6e 5d 20 22 3a 22 | 20 5b 63 6f 6e 64 69 74 |ion] ":"| [condit|
|00002620| 69 6f 6e 5d 20 22 5d 22 | 0d 5c 65 6e 64 7b 76 65 |ion] "]"|.\end{ve|
|00002630| 72 62 61 74 69 6d 7d 0d | 0d 54 68 65 20 70 72 69 |rbatim}.|.The pri|
|00002640| 6d 61 72 79 20 6d 75 73 | 74 20 65 76 61 6c 75 61 |mary mus|t evalua|
|00002650| 74 65 20 74 6f 20 61 20 | 73 65 71 75 65 6e 63 65 |te to a |sequence|
|00002660| 20 6f 62 6a 65 63 74 2e | 20 20 54 68 65 20 6c 6f | object.| The lo|
|00002670| 77 65 72 20 61 6e 64 20 | 75 70 70 65 72 0d 62 6f |wer and |upper.bo|
|00002680| 75 6e 64 20 65 78 70 72 | 65 73 73 69 6f 6e 73 2c |und expr|essions,|
|00002690| 20 69 66 20 70 72 65 73 | 65 6e 74 2c 20 6d 75 73 | if pres|ent, mus|
|000026a0| 74 20 65 76 61 6c 75 61 | 74 65 20 74 6f 20 70 6c |t evalua|te to pl|
|000026b0| 61 69 6e 20 69 6e 74 65 | 67 65 72 73 3b 0d 64 65 |ain inte|gers;.de|
|000026c0| 66 61 75 6c 74 73 20 61 | 72 65 20 7a 65 72 6f 20 |faults a|re zero |
|000026d0| 61 6e 64 20 74 68 65 20 | 73 65 71 75 65 6e 63 65 |and the |sequence|
|000026e0| 27 73 20 6c 65 6e 67 74 | 68 2c 20 72 65 73 70 65 |'s lengt|h, respe|
|000026f0| 63 74 69 76 65 6c 79 2e | 20 20 49 66 20 65 69 74 |ctively.| If eit|
|00002700| 68 65 72 0d 62 6f 75 6e | 64 20 69 73 20 6e 65 67 |her.boun|d is neg|
|00002710| 61 74 69 76 65 2c 20 74 | 68 65 20 73 65 71 75 65 |ative, t|he seque|
|00002720| 6e 63 65 27 73 20 6c 65 | 6e 67 74 68 20 69 73 20 |nce's le|ngth is |
|00002730| 61 64 64 65 64 20 74 6f | 20 69 74 2e 20 20 54 68 |added to| it. Th|
|00002740| 65 20 73 6c 69 63 69 6e | 67 0d 6e 6f 77 20 73 65 |e slicin|g.now se|
|00002750| 6c 65 63 74 73 20 61 6c | 6c 20 69 74 65 6d 73 20 |lects al|l items |
|00002760| 77 69 74 68 20 69 6e 64 | 65 78 20 24 6b 24 20 73 |with ind|ex $k$ s|
|00002770| 75 63 68 20 74 68 61 74 | 20 24 69 20 3c 3d 20 6b |uch that| $i <= k|
|00002780| 20 3c 20 6a 24 20 77 68 | 65 72 65 20 24 69 24 0d | < j$ wh|ere $i$.|
|00002790| 61 6e 64 20 24 6a 24 20 | 61 72 65 20 74 68 65 20 |and $j$ |are the |
|000027a0| 73 70 65 63 69 66 69 65 | 64 20 6c 6f 77 65 72 20 |specifie|d lower |
|000027b0| 61 6e 64 20 75 70 70 65 | 72 20 62 6f 75 6e 64 73 |and uppe|r bounds|
|000027c0| 2e 20 20 54 68 69 73 20 | 6d 61 79 20 62 65 20 61 |. This |may be a|
|000027d0| 6e 0d 65 6d 70 74 79 20 | 73 65 71 75 65 6e 63 65 |n.empty |sequence|
|000027e0| 2e 20 20 49 74 20 69 73 | 20 6e 6f 74 20 61 6e 20 |. It is| not an |
|000027f0| 65 72 72 6f 72 20 69 66 | 20 24 69 24 20 6f 72 20 |error if| $i$ or |
|00002800| 24 6a 24 20 6c 69 65 20 | 6f 75 74 73 69 64 65 20 |$j$ lie |outside |
|00002810| 74 68 65 0d 72 61 6e 67 | 65 20 6f 66 20 76 61 6c |the.rang|e of val|
|00002820| 69 64 20 69 6e 64 65 78 | 65 73 20 28 73 75 63 68 |id index|es (such|
|00002830| 20 69 74 65 6d 73 20 64 | 6f 6e 27 74 20 65 78 69 | items d|on't exi|
|00002840| 73 74 20 73 6f 20 74 68 | 65 79 20 61 72 65 6e 27 |st so th|ey aren'|
|00002850| 74 0d 73 65 6c 65 63 74 | 65 64 29 2e 0d 0d 5c 73 |t.select|ed)...\s|
|00002860| 75 62 73 65 63 74 69 6f | 6e 7b 43 61 6c 6c 73 7d |ubsectio|n{Calls}|
|00002870| 20 5c 6c 61 62 65 6c 7b | 63 61 6c 6c 73 7d 0d 5c | \label{|calls}.\|
|00002880| 69 6e 64 65 78 7b 63 61 | 6c 6c 7d 0d 0d 41 20 63 |index{ca|ll}..A c|
|00002890| 61 6c 6c 20 63 61 6c 6c | 73 20 61 20 63 61 6c 6c |all call|s a call|
|000028a0| 61 62 6c 65 20 6f 62 6a | 65 63 74 20 28 65 2e 67 |able obj|ect (e.g|
|000028b0| 2e 20 61 20 66 75 6e 63 | 74 69 6f 6e 29 20 77 69 |. a func|tion) wi|
|000028c0| 74 68 20 61 20 70 6f 73 | 73 69 62 6c 79 20 65 6d |th a pos|sibly em|
|000028d0| 70 74 79 0d 73 65 72 69 | 65 73 20 6f 66 20 61 72 |pty.seri|es of ar|
|000028e0| 67 75 6d 65 6e 74 73 3a | 0d 5c 6f 62 69 6e 64 65 |guments:|.\obinde|
|000028f0| 78 7b 63 61 6c 6c 61 62 | 6c 65 7d 0d 0d 5c 62 65 |x{callab|le}..\be|
|00002900| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0d 63 61 |gin{verb|atim}.ca|
|00002910| 6c 6c 3a 20 20 20 20 20 | 20 20 20 20 20 20 70 72 |ll: | pr|
|00002920| 69 6d 61 72 79 20 22 28 | 22 20 5b 63 6f 6e 64 69 |imary "(|" [condi|
|00002930| 74 69 6f 6e 5f 6c 69 73 | 74 5d 20 22 29 22 0d 5c |tion_lis|t] ")".\|
|00002940| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0d 0d 54 |end{verb|atim}..T|
|00002950| 68 65 20 70 72 69 6d 61 | 72 79 20 6d 75 73 74 20 |he prima|ry must |
|00002960| 65 76 61 6c 75 61 74 65 | 20 74 6f 20 61 20 63 61 |evaluate| to a ca|
|00002970| 6c 6c 61 62 6c 65 20 6f | 62 6a 65 63 74 20 28 75 |llable o|bject (u|
|00002980| 73 65 72 2d 64 65 66 69 | 6e 65 64 0d 66 75 6e 63 |ser-defi|ned.func|
|00002990| 74 69 6f 6e 73 2c 20 62 | 75 69 6c 74 2d 69 6e 20 |tions, b|uilt-in |
|000029a0| 66 75 6e 63 74 69 6f 6e | 73 2c 20 6d 65 74 68 6f |function|s, metho|
|000029b0| 64 73 20 6f 66 20 62 75 | 69 6c 74 2d 69 6e 20 6f |ds of bu|ilt-in o|
|000029c0| 62 6a 65 63 74 73 2c 20 | 63 6c 61 73 73 0d 6f 62 |bjects, |class.ob|
|000029d0| 6a 65 63 74 73 2c 20 61 | 6e 64 20 6d 65 74 68 6f |jects, a|nd metho|
|000029e0| 64 73 20 6f 66 20 63 6c | 61 73 73 20 69 6e 73 74 |ds of cl|ass inst|
|000029f0| 61 6e 63 65 73 20 61 72 | 65 20 63 61 6c 6c 61 62 |ances ar|e callab|
|00002a00| 6c 65 29 2e 20 20 49 66 | 20 69 74 20 69 73 20 61 |le). If| it is a|
|00002a10| 0d 63 6c 61 73 73 2c 20 | 74 68 65 20 61 72 67 75 |.class, |the argu|
|00002a20| 6d 65 6e 74 20 6c 69 73 | 74 20 6d 75 73 74 20 62 |ment lis|t must b|
|00002a30| 65 20 65 6d 70 74 79 3b | 20 6f 74 68 65 72 77 69 |e empty;| otherwi|
|00002a40| 73 65 2c 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 |se, the |argument|
|00002a50| 73 20 61 72 65 0d 65 76 | 61 6c 75 61 74 65 64 2e |s are.ev|aluated.|
|00002a60| 0d 0d 41 20 63 61 6c 6c | 20 61 6c 77 61 79 73 20 |..A call| always |
|00002a70| 72 65 74 75 72 6e 73 20 | 73 6f 6d 65 20 76 61 6c |returns |some val|
|00002a80| 75 65 2c 20 70 6f 73 73 | 69 62 6c 79 20 5c 76 65 |ue, poss|ibly \ve|
|00002a90| 72 62 40 4e 6f 6e 65 40 | 2c 20 75 6e 6c 65 73 73 |rb@None@|, unless|
|00002aa0| 20 69 74 0d 72 61 69 73 | 65 73 20 61 6e 20 65 78 | it.rais|es an ex|
|00002ab0| 63 65 70 74 69 6f 6e 2e | 20 20 48 6f 77 20 74 68 |ception.| How th|
|00002ac0| 69 73 20 76 61 6c 75 65 | 20 69 73 20 63 6f 6d 70 |is value| is comp|
|00002ad0| 75 74 65 64 20 64 65 70 | 65 6e 64 73 20 6f 6e 20 |uted dep|ends on |
|00002ae0| 74 68 65 20 74 79 70 65 | 0d 6f 66 20 74 68 65 20 |the type|.of the |
|00002af0| 63 61 6c 6c 61 62 6c 65 | 20 6f 62 6a 65 63 74 2e |callable| object.|
|00002b00| 20 20 49 66 20 69 74 20 | 69 73 3a 0d 0d 5c 62 65 | If it |is:..\be|
|00002b10| 67 69 6e 7b 64 65 73 63 | 72 69 70 74 69 6f 6e 7d |gin{desc|ription}|
|00002b20| 0d 0d 5c 69 74 65 6d 5b | 61 20 75 73 65 72 2d 64 |..\item[|a user-d|
|00002b30| 65 66 69 6e 65 64 20 66 | 75 6e 63 74 69 6f 6e 3a |efined f|unction:|
|00002b40| 5d 20 74 68 65 20 63 6f | 64 65 20 62 6c 6f 63 6b |] the co|de block|
|00002b50| 20 66 6f 72 20 74 68 65 | 20 66 75 6e 63 74 69 6f | for the| functio|
|00002b60| 6e 20 69 73 0d 65 78 65 | 63 75 74 65 64 2c 20 70 |n is.exe|cuted, p|
|00002b70| 61 73 73 69 6e 67 20 69 | 74 20 74 68 65 20 61 72 |assing i|t the ar|
|00002b80| 67 75 6d 65 6e 74 20 6c | 69 73 74 2e 20 20 54 68 |gument l|ist. Th|
|00002b90| 65 20 66 69 72 73 74 20 | 74 68 69 6e 67 20 74 68 |e first |thing th|
|00002ba0| 65 20 63 6f 64 65 0d 62 | 6c 6f 63 6b 20 77 69 6c |e code.b|lock wil|
|00002bb0| 6c 20 64 6f 20 69 73 20 | 62 69 6e 64 20 74 68 65 |l do is |bind the|
|00002bc0| 20 66 6f 72 6d 61 6c 20 | 70 61 72 61 6d 65 74 65 | formal |paramete|
|00002bd0| 72 73 20 74 6f 20 74 68 | 65 20 61 72 67 75 6d 65 |rs to th|e argume|
|00002be0| 6e 74 73 3b 20 74 68 69 | 73 20 69 73 0d 64 65 73 |nts; thi|s is.des|
|00002bf0| 63 72 69 62 65 64 20 69 | 6e 20 73 65 63 74 69 6f |cribed i|n sectio|
|00002c00| 6e 20 5c 72 65 66 7b 66 | 75 6e 63 74 69 6f 6e 7d |n \ref{f|unction}|
|00002c10| 2e 20 20 57 68 65 6e 20 | 74 68 65 20 63 6f 64 65 |. When |the code|
|00002c20| 20 62 6c 6f 63 6b 20 65 | 78 65 63 75 74 65 73 20 | block e|xecutes |
|00002c30| 61 0d 5c 76 65 72 62 40 | 72 65 74 75 72 6e 40 20 |a.\verb@|return@ |
|00002c40| 73 74 61 74 65 6d 65 6e | 74 2c 20 74 68 69 73 20 |statemen|t, this |
|00002c50| 73 70 65 63 69 66 69 65 | 73 20 74 68 65 20 72 65 |specifie|s the re|
|00002c60| 74 75 72 6e 20 76 61 6c | 75 65 20 6f 66 20 74 68 |turn val|ue of th|
|00002c70| 65 0d 66 75 6e 63 74 69 | 6f 6e 20 63 61 6c 6c 2e |e.functi|on call.|
|00002c80| 0d 5c 69 6e 64 65 78 69 | 69 7b 66 75 6e 63 74 69 |.\indexi|i{functi|
|00002c90| 6f 6e 7d 7b 63 61 6c 6c | 7d 0d 5c 69 6e 64 65 78 |on}{call|}.\index|
|00002ca0| 69 69 69 7b 75 73 65 72 | 2d 64 65 66 69 6e 65 64 |iii{user|-defined|
|00002cb0| 7d 7b 66 75 6e 63 74 69 | 6f 6e 7d 7b 63 61 6c 6c |}{functi|on}{call|
|00002cc0| 7d 0d 5c 6f 62 69 6e 64 | 65 78 7b 75 73 65 72 2d |}.\obind|ex{user-|
|00002cd0| 64 65 66 69 6e 65 64 20 | 66 75 6e 63 74 69 6f 6e |defined |function|
|00002ce0| 7d 0d 5c 6f 62 69 6e 64 | 65 78 7b 66 75 6e 63 74 |}.\obind|ex{funct|
|00002cf0| 69 6f 6e 7d 0d 0d 5c 69 | 74 65 6d 5b 61 20 62 75 |ion}..\i|tem[a bu|
|00002d00| 69 6c 74 2d 69 6e 20 66 | 75 6e 63 74 69 6f 6e 20 |ilt-in f|unction |
|00002d10| 6f 72 20 6d 65 74 68 6f | 64 3a 5d 20 74 68 65 20 |or metho|d:] the |
|00002d20| 72 65 73 75 6c 74 20 69 | 73 20 75 70 20 74 6f 20 |result i|s up to |
|00002d30| 74 68 65 0d 69 6e 74 65 | 72 70 72 65 74 65 72 3b |the.inte|rpreter;|
|00002d40| 20 73 65 65 20 74 68 65 | 20 6c 69 62 72 61 72 79 | see the| library|
|00002d50| 20 72 65 66 65 72 65 6e | 63 65 20 6d 61 6e 75 61 | referen|ce manua|
|00002d60| 6c 20 66 6f 72 20 74 68 | 65 20 64 65 73 63 72 69 |l for th|e descri|
|00002d70| 70 74 69 6f 6e 73 20 6f | 66 0d 62 75 69 6c 74 2d |ptions o|f.built-|
|00002d80| 69 6e 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 6e 64 |in funct|ions and|
|00002d90| 20 6d 65 74 68 6f 64 73 | 2e 0d 5c 69 6e 64 65 78 | methods|..\index|
|00002da0| 69 69 7b 66 75 6e 63 74 | 69 6f 6e 7d 7b 63 61 6c |ii{funct|ion}{cal|
|00002db0| 6c 7d 0d 5c 69 6e 64 65 | 78 69 69 7b 62 75 69 6c |l}.\inde|xii{buil|
|00002dc0| 74 2d 69 6e 20 66 75 6e | 63 74 69 6f 6e 7d 7b 63 |t-in fun|ction}{c|
|00002dd0| 61 6c 6c 7d 0d 5c 69 6e | 64 65 78 69 69 7b 6d 65 |all}.\in|dexii{me|
|00002de0| 74 68 6f 64 7d 7b 63 61 | 6c 6c 7d 0d 5c 69 6e 64 |thod}{ca|ll}.\ind|
|00002df0| 65 78 69 69 7b 62 75 69 | 6c 74 2d 69 6e 20 6d 65 |exii{bui|lt-in me|
|00002e00| 74 68 6f 64 7d 7b 63 61 | 6c 6c 7d 0d 5c 6f 62 69 |thod}{ca|ll}.\obi|
|00002e10| 6e 64 65 78 7b 62 75 69 | 6c 74 2d 69 6e 20 6d 65 |ndex{bui|lt-in me|
|00002e20| 74 68 6f 64 7d 0d 5c 6f | 62 69 6e 64 65 78 7b 62 |thod}.\o|bindex{b|
|00002e30| 75 69 6c 74 2d 69 6e 20 | 66 75 6e 63 74 69 6f 6e |uilt-in |function|
|00002e40| 7d 0d 5c 6f 62 69 6e 64 | 65 78 7b 6d 65 74 68 6f |}.\obind|ex{metho|
|00002e50| 64 7d 0d 5c 6f 62 69 6e | 64 65 78 7b 66 75 6e 63 |d}.\obin|dex{func|
|00002e60| 74 69 6f 6e 7d 0d 0d 5c | 69 74 65 6d 5b 61 20 63 |tion}..\|item[a c|
|00002e70| 6c 61 73 73 20 6f 62 6a | 65 63 74 3a 5d 20 61 20 |lass obj|ect:] a |
|00002e80| 6e 65 77 20 69 6e 73 74 | 61 6e 63 65 20 6f 66 20 |new inst|ance of |
|00002e90| 74 68 61 74 20 63 6c 61 | 73 73 20 69 73 20 72 65 |that cla|ss is re|
|00002ea0| 74 75 72 6e 65 64 2e 0d | 5c 6f 62 69 6e 64 65 78 |turned..|\obindex|
|00002eb0| 7b 63 6c 61 73 73 7d 0d | 5c 69 6e 64 65 78 69 69 |{class}.|\indexii|
|00002ec0| 7b 63 6c 61 73 73 20 6f | 62 6a 65 63 74 7d 7b 63 |{class o|bject}{c|
|00002ed0| 61 6c 6c 7d 0d 0d 5c 69 | 74 65 6d 5b 61 20 63 6c |all}..\i|tem[a cl|
|00002ee0| 61 73 73 20 69 6e 73 74 | 61 6e 63 65 20 6d 65 74 |ass inst|ance met|
|00002ef0| 68 6f 64 3a 5d 20 74 68 | 65 20 63 6f 72 72 65 73 |hod:] th|e corres|
|00002f00| 70 6f 6e 64 69 6e 67 20 | 75 73 65 72 2d 64 65 66 |ponding |user-def|
|00002f10| 69 6e 65 64 0d 66 75 6e | 63 74 69 6f 6e 20 69 73 |ined.fun|ction is|
|00002f20| 20 63 61 6c 6c 65 64 2c | 20 77 69 74 68 20 61 6e | called,| with an|
|00002f30| 20 61 72 67 75 6d 65 6e | 74 20 6c 69 73 74 20 74 | argumen|t list t|
|00002f40| 68 61 74 20 69 73 20 6f | 6e 65 20 6c 6f 6e 67 65 |hat is o|ne longe|
|00002f50| 72 20 74 68 61 6e 20 74 | 68 65 0d 61 72 67 75 6d |r than t|he.argum|
|00002f60| 65 6e 74 20 6c 69 73 74 | 20 6f 66 20 74 68 65 20 |ent list| of the |
|00002f70| 63 61 6c 6c 3a 20 74 68 | 65 20 69 6e 73 74 61 6e |call: th|e instan|
|00002f80| 63 65 20 62 65 63 6f 6d | 65 73 20 74 68 65 20 66 |ce becom|es the f|
|00002f90| 69 72 73 74 20 61 72 67 | 75 6d 65 6e 74 2e 0d 5c |irst arg|ument..\|
|00002fa0| 6f 62 69 6e 64 65 78 7b | 63 6c 61 73 73 20 69 6e |obindex{|class in|
|00002fb0| 73 74 61 6e 63 65 7d 0d | 5c 6f 62 69 6e 64 65 78 |stance}.|\obindex|
|00002fc0| 7b 69 6e 73 74 61 6e 63 | 65 7d 0d 5c 69 6e 64 65 |{instanc|e}.\inde|
|00002fd0| 78 69 69 7b 69 6e 73 74 | 61 6e 63 65 7d 7b 63 61 |xii{inst|ance}{ca|
|00002fe0| 6c 6c 7d 0d 5c 69 6e 64 | 65 78 69 69 7b 63 6c 61 |ll}.\ind|exii{cla|
|00002ff0| 73 73 20 69 6e 73 74 61 | 6e 63 65 7d 7b 63 61 6c |ss insta|nce}{cal|
|00003000| 6c 7d 0d 0d 5c 65 6e 64 | 7b 64 65 73 63 72 69 70 |l}..\end|{descrip|
|00003010| 74 69 6f 6e 7d 0d 0d 5c | 73 65 63 74 69 6f 6e 7b |tion}..\|section{|
|00003020| 55 6e 61 72 79 20 61 72 | 69 74 68 6d 65 74 69 63 |Unary ar|ithmetic|
|00003030| 20 6f 70 65 72 61 74 69 | 6f 6e 73 7d 0d 5c 69 6e | operati|ons}.\in|
|00003040| 64 65 78 69 69 69 7b 75 | 6e 61 72 79 7d 7b 61 72 |dexiii{u|nary}{ar|
|00003050| 69 74 68 6d 65 74 69 63 | 7d 7b 6f 70 65 72 61 74 |ithmetic|}{operat|
|00003060| 69 6f 6e 7d 0d 5c 69 6e | 64 65 78 69 69 69 7b 75 |ion}.\in|dexiii{u|
|00003070| 6e 61 72 79 7d 7b 62 69 | 74 2d 77 69 73 65 7d 7b |nary}{bi|t-wise}{|
|00003080| 6f 70 65 72 61 74 69 6f | 6e 7d 0d 0d 41 6c 6c 20 |operatio|n}..All |
|00003090| 75 6e 61 72 79 20 61 72 | 69 74 68 6d 65 74 69 63 |unary ar|ithmetic|
|000030a0| 20 28 61 6e 64 20 62 69 | 74 2d 77 69 73 65 29 20 | (and bi|t-wise) |
|000030b0| 6f 70 65 72 61 74 69 6f | 6e 73 20 68 61 76 65 20 |operatio|ns have |
|000030c0| 74 68 65 20 73 61 6d 65 | 20 70 72 69 6f 72 69 74 |the same| priorit|
|000030d0| 79 3a 0d 0d 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |y:..\beg|in{verba|
|000030e0| 74 69 6d 7d 0d 75 5f 65 | 78 70 72 3a 20 20 20 20 |tim}.u_e|xpr: |
|000030f0| 20 20 20 20 20 70 72 69 | 6d 61 72 79 20 7c 20 22 | pri|mary | "|
|00003100| 2d 22 20 75 5f 65 78 70 | 72 20 7c 20 22 2b 22 20 |-" u_exp|r | "+" |
|00003110| 75 5f 65 78 70 72 20 7c | 20 22 7e 22 20 75 5f 65 |u_expr || "~" u_e|
|00003120| 78 70 72 0d 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |xpr.\end|{verbati|
|00003130| 6d 7d 0d 0d 54 68 65 20 | 75 6e 61 72 79 20 5c 76 |m}..The |unary \v|
|00003140| 65 72 62 40 22 2d 22 40 | 20 28 6d 69 6e 75 73 29 |erb@"-"@| (minus)|
|00003150| 20 6f 70 65 72 61 74 6f | 72 20 79 69 65 6c 64 73 | operato|r yields|
|00003160| 20 74 68 65 20 6e 65 67 | 61 74 69 6f 6e 20 6f 66 | the neg|ation of|
|00003170| 20 69 74 73 0d 6e 75 6d | 65 72 69 63 20 61 72 67 | its.num|eric arg|
|00003180| 75 6d 65 6e 74 2e 0d 5c | 69 6e 64 65 78 7b 6e 65 |ument..\|index{ne|
|00003190| 67 61 74 69 6f 6e 7d 0d | 5c 69 6e 64 65 78 7b 6d |gation}.|\index{m|
|000031a0| 69 6e 75 73 7d 0d 0d 54 | 68 65 20 75 6e 61 72 79 |inus}..T|he unary|
|000031b0| 20 5c 76 65 72 62 40 22 | 2b 22 40 20 28 70 6c 75 | \verb@"|+"@ (plu|
|000031c0| 73 29 20 6f 70 65 72 61 | 74 6f 72 20 79 69 65 6c |s) opera|tor yiel|
|000031d0| 64 73 20 69 74 73 20 6e | 75 6d 65 72 69 63 20 61 |ds its n|umeric a|
|000031e0| 72 67 75 6d 65 6e 74 0d | 75 6e 63 68 61 6e 67 65 |rgument.|unchange|
|000031f0| 64 2e 0d 5c 69 6e 64 65 | 78 7b 70 6c 75 73 7d 0d |d..\inde|x{plus}.|
|00003200| 0d 54 68 65 20 75 6e 61 | 72 79 20 5c 76 65 72 62 |.The una|ry \verb|
|00003210| 40 22 7e 22 40 20 28 69 | 6e 76 65 72 74 29 20 6f |@"~"@ (i|nvert) o|
|00003220| 70 65 72 61 74 6f 72 20 | 79 69 65 6c 64 73 20 74 |perator |yields t|
|00003230| 68 65 20 62 69 74 2d 77 | 69 73 65 20 69 6e 76 65 |he bit-w|ise inve|
|00003240| 72 73 69 6f 6e 0d 6f 66 | 20 69 74 73 20 70 6c 61 |rsion.of| its pla|
|00003250| 69 6e 20 6f 72 20 6c 6f | 6e 67 20 69 6e 74 65 67 |in or lo|ng integ|
|00003260| 65 72 20 61 72 67 75 6d | 65 6e 74 2e 20 20 54 68 |er argum|ent. Th|
|00003270| 65 20 62 69 74 2d 77 69 | 73 65 20 69 6e 76 65 72 |e bit-wi|se inver|
|00003280| 73 69 6f 6e 20 6f 66 0d | 5c 76 65 72 62 40 78 40 |sion of.|\verb@x@|
|00003290| 20 69 73 20 64 65 66 69 | 6e 65 64 20 61 73 20 5c | is defi|ned as \|
|000032a0| 76 65 72 62 40 2d 28 78 | 2b 31 29 40 2e 0d 5c 69 |verb@-(x|+1)@..\i|
|000032b0| 6e 64 65 78 7b 69 6e 76 | 65 72 73 69 6f 6e 7d 0d |ndex{inv|ersion}.|
|000032c0| 0d 49 6e 20 61 6c 6c 20 | 74 68 72 65 65 20 63 61 |.In all |three ca|
|000032d0| 73 65 73 2c 20 69 66 20 | 74 68 65 20 61 72 67 75 |ses, if |the argu|
|000032e0| 6d 65 6e 74 20 64 6f 65 | 73 20 6e 6f 74 20 68 61 |ment doe|s not ha|
|000032f0| 76 65 20 74 68 65 20 70 | 72 6f 70 65 72 20 74 79 |ve the p|roper ty|
|00003300| 70 65 2c 0d 61 20 5c 76 | 65 72 62 40 54 79 70 65 |pe,.a \v|erb@Type|
|00003310| 45 72 72 6f 72 40 20 65 | 78 63 65 70 74 69 6f 6e |Error@ e|xception|
|00003320| 20 69 73 20 72 61 69 73 | 65 64 2e 0d 5c 65 78 69 | is rais|ed..\exi|
|00003330| 6e 64 65 78 7b 54 79 70 | 65 45 72 72 6f 72 7d 0d |ndex{Typ|eError}.|
|00003340| 0d 5c 73 65 63 74 69 6f | 6e 7b 42 69 6e 61 72 79 |.\sectio|n{Binary|
|00003350| 20 61 72 69 74 68 6d 65 | 74 69 63 20 6f 70 65 72 | arithme|tic oper|
|00003360| 61 74 69 6f 6e 73 7d 0d | 5c 69 6e 64 65 78 69 69 |ations}.|\indexii|
|00003370| 69 7b 62 69 6e 61 72 79 | 7d 7b 61 72 69 74 68 6d |i{binary|}{arithm|
|00003380| 65 74 69 63 7d 7b 6f 70 | 65 72 61 74 69 6f 6e 7d |etic}{op|eration}|
|00003390| 0d 0d 54 68 65 20 62 69 | 6e 61 72 79 20 61 72 69 |..The bi|nary ari|
|000033a0| 74 68 6d 65 74 69 63 20 | 6f 70 65 72 61 74 69 6f |thmetic |operatio|
|000033b0| 6e 73 20 68 61 76 65 20 | 74 68 65 20 63 6f 6e 76 |ns have |the conv|
|000033c0| 65 6e 74 69 6f 6e 61 6c | 20 70 72 69 6f 72 69 74 |entional| priorit|
|000033d0| 79 0d 6c 65 76 65 6c 73 | 2e 20 20 4e 6f 74 65 20 |y.levels|. Note |
|000033e0| 74 68 61 74 20 73 6f 6d | 65 20 6f 66 20 74 68 65 |that som|e of the|
|000033f0| 73 65 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 61 6c |se opera|tions al|
|00003400| 73 6f 20 61 70 70 6c 79 | 20 74 6f 20 63 65 72 74 |so apply| to cert|
|00003410| 61 69 6e 0d 6e 6f 6e 2d | 6e 75 6d 65 72 69 63 20 |ain.non-|numeric |
|00003420| 74 79 70 65 73 2e 20 20 | 54 68 65 72 65 20 69 73 |types. |There is|
|00003430| 20 6e 6f 20 60 60 70 6f | 77 65 72 27 27 20 6f 70 | no ``po|wer'' op|
|00003440| 65 72 61 74 6f 72 2c 20 | 73 6f 20 74 68 65 72 65 |erator, |so there|
|00003450| 20 61 72 65 20 6f 6e 6c | 79 0d 74 77 6f 20 6c 65 | are onl|y.two le|
|00003460| 76 65 6c 73 2c 20 6f 6e | 65 20 66 6f 72 20 6d 75 |vels, on|e for mu|
|00003470| 6c 74 69 70 6c 69 63 61 | 74 69 76 65 20 6f 70 65 |ltiplica|tive ope|
|00003480| 72 61 74 6f 72 73 20 61 | 6e 64 20 6f 6e 65 20 66 |rators a|nd one f|
|00003490| 6f 72 20 61 64 64 69 74 | 69 76 65 0d 6f 70 65 72 |or addit|ive.oper|
|000034a0| 61 74 6f 72 73 3a 0d 0d | 5c 62 65 67 69 6e 7b 76 |ators:..|\begin{v|
|000034b0| 65 72 62 61 74 69 6d 7d | 0d 6d 5f 65 78 70 72 3a |erbatim}|.m_expr:|
|000034c0| 20 20 20 20 20 20 20 20 | 20 75 5f 65 78 70 72 20 | | u_expr |
|000034d0| 7c 20 6d 5f 65 78 70 72 | 20 22 2a 22 20 75 5f 65 || m_expr| "*" u_e|
|000034e0| 78 70 72 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |xpr. | |
|000034f0| 20 20 7c 20 6d 5f 65 78 | 70 72 20 22 2f 22 20 75 | | m_ex|pr "/" u|
|00003500| 5f 65 78 70 72 20 7c 20 | 6d 5f 65 78 70 72 20 22 |_expr | |m_expr "|
|00003510| 25 22 20 75 5f 65 78 70 | 72 0d 61 5f 65 78 70 72 |%" u_exp|r.a_expr|
|00003520| 3a 20 20 20 20 20 20 20 | 20 20 6d 5f 65 78 70 72 |: | m_expr|
|00003530| 20 7c 20 61 65 78 70 72 | 20 22 2b 22 20 6d 5f 65 | | aexpr| "+" m_e|
|00003540| 78 70 72 20 7c 20 61 65 | 78 70 72 20 22 2d 22 20 |xpr | ae|xpr "-" |
|00003550| 6d 5f 65 78 70 72 0d 5c | 65 6e 64 7b 76 65 72 62 |m_expr.\|end{verb|
|00003560| 61 74 69 6d 7d 0d 0d 54 | 68 65 20 5c 76 65 72 62 |atim}..T|he \verb|
|00003570| 40 22 2a 22 40 20 28 6d | 75 6c 74 69 70 6c 69 63 |@"*"@ (m|ultiplic|
|00003580| 61 74 69 6f 6e 29 20 6f | 70 65 72 61 74 6f 72 20 |ation) o|perator |
|00003590| 79 69 65 6c 64 73 20 74 | 68 65 20 70 72 6f 64 75 |yields t|he produ|
|000035a0| 63 74 20 6f 66 20 69 74 | 73 0d 61 72 67 75 6d 65 |ct of it|s.argume|
|000035b0| 6e 74 73 2e 20 20 54 68 | 65 20 61 72 67 75 6d 65 |nts. Th|e argume|
|000035c0| 6e 74 73 20 6d 75 73 74 | 20 65 69 74 68 65 72 20 |nts must| either |
|000035d0| 62 6f 74 68 20 62 65 20 | 6e 75 6d 62 65 72 73 2c |both be |numbers,|
|000035e0| 20 6f 72 20 6f 6e 65 20 | 61 72 67 75 6d 65 6e 74 | or one |argument|
|000035f0| 0d 6d 75 73 74 20 62 65 | 20 61 20 70 6c 61 69 6e |.must be| a plain|
|00003600| 20 69 6e 74 65 67 65 72 | 20 61 6e 64 20 74 68 65 | integer| and the|
|00003610| 20 6f 74 68 65 72 20 6d | 75 73 74 20 62 65 20 61 | other m|ust be a|
|00003620| 20 73 65 71 75 65 6e 63 | 65 2e 20 20 49 6e 20 74 | sequenc|e. In t|
|00003630| 68 65 0d 66 6f 72 6d 65 | 72 20 63 61 73 65 2c 20 |he.forme|r case, |
|00003640| 74 68 65 20 6e 75 6d 62 | 65 72 73 20 61 72 65 20 |the numb|ers are |
|00003650| 63 6f 6e 76 65 72 74 65 | 64 20 74 6f 20 61 20 63 |converte|d to a c|
|00003660| 6f 6d 6d 6f 6e 20 74 79 | 70 65 20 61 6e 64 20 74 |ommon ty|pe and t|
|00003670| 68 65 6e 0d 6d 75 6c 74 | 69 70 6c 69 65 64 20 74 |hen.mult|iplied t|
|00003680| 6f 67 65 74 68 65 72 2e | 20 20 49 6e 20 74 68 65 |ogether.| In the|
|00003690| 20 6c 61 74 74 65 72 20 | 63 61 73 65 2c 20 73 65 | latter |case, se|
|000036a0| 71 75 65 6e 63 65 20 72 | 65 70 65 74 69 74 69 6f |quence r|epetitio|
|000036b0| 6e 20 69 73 0d 70 65 72 | 66 6f 72 6d 65 64 3b 20 |n is.per|formed; |
|000036c0| 61 20 6e 65 67 61 74 69 | 76 65 20 72 65 70 65 74 |a negati|ve repet|
|000036d0| 69 74 69 6f 6e 20 66 61 | 63 74 6f 72 20 79 69 65 |ition fa|ctor yie|
|000036e0| 6c 64 73 20 61 6e 20 65 | 6d 70 74 79 20 73 65 71 |lds an e|mpty seq|
|000036f0| 75 65 6e 63 65 2e 0d 5c | 69 6e 64 65 78 7b 6d 75 |uence..\|index{mu|
|00003700| 6c 74 69 70 6c 69 63 61 | 74 69 6f 6e 7d 0d 0d 54 |ltiplica|tion}..T|
|00003710| 68 65 20 5c 76 65 72 62 | 40 22 2f 22 40 20 28 64 |he \verb|@"/"@ (d|
|00003720| 69 76 69 73 69 6f 6e 29 | 20 6f 70 65 72 61 74 6f |ivision)| operato|
|00003730| 72 20 79 69 65 6c 64 73 | 20 74 68 65 20 71 75 6f |r yields| the quo|
|00003740| 74 69 65 6e 74 20 6f 66 | 20 69 74 73 0d 61 72 67 |tient of| its.arg|
|00003750| 75 6d 65 6e 74 73 2e 20 | 20 54 68 65 20 6e 75 6d |uments. | The num|
|00003760| 65 72 69 63 20 61 72 67 | 75 6d 65 6e 74 73 20 61 |eric arg|uments a|
|00003770| 72 65 20 66 69 72 73 74 | 20 63 6f 6e 76 65 72 74 |re first| convert|
|00003780| 65 64 20 74 6f 20 61 20 | 63 6f 6d 6d 6f 6e 0d 74 |ed to a |common.t|
|00003790| 79 70 65 2e 20 20 50 6c | 61 69 6e 20 6f 72 20 6c |ype. Pl|ain or l|
|000037a0| 6f 6e 67 20 69 6e 74 65 | 67 65 72 20 64 69 76 69 |ong inte|ger divi|
|000037b0| 73 69 6f 6e 20 79 69 65 | 6c 64 73 20 61 6e 20 69 |sion yie|lds an i|
|000037c0| 6e 74 65 67 65 72 20 6f | 66 20 74 68 65 20 73 61 |nteger o|f the sa|
|000037d0| 6d 65 0d 74 79 70 65 3b | 20 74 68 65 20 72 65 73 |me.type;| the res|
|000037e0| 75 6c 74 20 69 73 20 74 | 68 61 74 20 6f 66 20 6d |ult is t|hat of m|
|000037f0| 61 74 68 65 6d 61 74 69 | 63 61 6c 20 64 69 76 69 |athemati|cal divi|
|00003800| 73 69 6f 6e 20 77 69 74 | 68 20 74 68 65 20 60 66 |sion wit|h the `f|
|00003810| 6c 6f 6f 72 27 0d 66 75 | 6e 63 74 69 6f 6e 20 61 |loor'.fu|nction a|
|00003820| 70 70 6c 69 65 64 20 74 | 6f 20 74 68 65 20 72 65 |pplied t|o the re|
|00003830| 73 75 6c 74 2e 20 20 44 | 69 76 69 73 69 6f 6e 20 |sult. D|ivision |
|00003840| 62 79 20 7a 65 72 6f 20 | 72 61 69 73 65 73 20 74 |by zero |raises t|
|00003850| 68 65 0d 5c 76 65 72 62 | 40 5a 65 72 6f 44 69 76 |he.\verb|@ZeroDiv|
|00003860| 69 73 69 6f 6e 45 72 72 | 6f 72 40 20 65 78 63 65 |isionErr|or@ exce|
|00003870| 70 74 69 6f 6e 2e 0d 5c | 65 78 69 6e 64 65 78 7b |ption..\|exindex{|
|00003880| 5a 65 72 6f 44 69 76 69 | 73 69 6f 6e 45 72 72 6f |ZeroDivi|sionErro|
|00003890| 72 7d 0d 5c 69 6e 64 65 | 78 7b 64 69 76 69 73 69 |r}.\inde|x{divisi|
|000038a0| 6f 6e 7d 0d 0d 54 68 65 | 20 5c 76 65 72 62 40 22 |on}..The| \verb@"|
|000038b0| 25 22 40 20 28 6d 6f 64 | 75 6c 6f 29 20 6f 70 65 |%"@ (mod|ulo) ope|
|000038c0| 72 61 74 6f 72 20 79 69 | 65 6c 64 73 20 74 68 65 |rator yi|elds the|
|000038d0| 20 72 65 6d 61 69 6e 64 | 65 72 20 66 72 6f 6d 20 | remaind|er from |
|000038e0| 74 68 65 0d 64 69 76 69 | 73 69 6f 6e 20 6f 66 20 |the.divi|sion of |
|000038f0| 74 68 65 20 66 69 72 73 | 74 20 61 72 67 75 6d 65 |the firs|t argume|
|00003900| 6e 74 20 62 79 20 74 68 | 65 20 73 65 63 6f 6e 64 |nt by th|e second|
|00003910| 2e 20 20 54 68 65 20 6e | 75 6d 65 72 69 63 20 61 |. The n|umeric a|
|00003920| 72 67 75 6d 65 6e 74 73 | 0d 61 72 65 20 66 69 72 |rguments|.are fir|
|00003930| 73 74 20 63 6f 6e 76 65 | 72 74 65 64 20 74 6f 20 |st conve|rted to |
|00003940| 61 20 63 6f 6d 6d 6f 6e | 20 74 79 70 65 2e 20 20 |a common| type. |
|00003950| 41 20 7a 65 72 6f 20 72 | 69 67 68 74 20 61 72 67 |A zero r|ight arg|
|00003960| 75 6d 65 6e 74 20 72 61 | 69 73 65 73 0d 74 68 65 |ument ra|ises.the|
|00003970| 20 5c 76 65 72 62 40 5a | 65 72 6f 44 69 76 69 73 | \verb@Z|eroDivis|
|00003980| 69 6f 6e 45 72 72 6f 72 | 40 20 65 78 63 65 70 74 |ionError|@ except|
|00003990| 69 6f 6e 2e 20 20 54 68 | 65 20 61 72 67 75 6d 65 |ion. Th|e argume|
|000039a0| 6e 74 73 20 6d 61 79 20 | 62 65 20 66 6c 6f 61 74 |nts may |be float|
|000039b0| 69 6e 67 0d 70 6f 69 6e | 74 20 6e 75 6d 62 65 72 |ing.poin|t number|
|000039c0| 73 2c 20 65 2e 67 2e 20 | 5c 76 65 72 62 40 33 2e |s, e.g. |\verb@3.|
|000039d0| 31 34 20 25 20 30 2e 37 | 40 20 65 71 75 61 6c 73 |14 % 0.7|@ equals|
|000039e0| 20 5c 76 65 72 62 40 30 | 2e 33 34 40 2e 20 20 54 | \verb@0|.34@. T|
|000039f0| 68 65 20 6d 6f 64 75 6c | 6f 0d 6f 70 65 72 61 74 |he modul|o.operat|
|00003a00| 6f 72 20 61 6c 77 61 79 | 73 20 79 69 65 6c 64 73 |or alway|s yields|
|00003a10| 20 61 20 72 65 73 75 6c | 74 20 77 69 74 68 20 74 | a resul|t with t|
|00003a20| 68 65 20 73 61 6d 65 20 | 73 69 67 6e 20 61 73 20 |he same |sign as |
|00003a30| 69 74 73 20 73 65 63 6f | 6e 64 0d 6f 70 65 72 61 |its seco|nd.opera|
|00003a40| 6e 64 20 28 6f 72 20 7a | 65 72 6f 29 3b 20 74 68 |nd (or z|ero); th|
|00003a50| 65 20 61 62 73 6f 6c 75 | 74 65 20 76 61 6c 75 65 |e absolu|te value|
|00003a60| 20 6f 66 20 74 68 65 20 | 72 65 73 75 6c 74 20 69 | of the |result i|
|00003a70| 73 20 73 74 72 69 63 74 | 6c 79 0d 73 6d 61 6c 6c |s strict|ly.small|
|00003a80| 65 72 20 74 68 61 6e 20 | 74 68 65 20 73 65 63 6f |er than |the seco|
|00003a90| 6e 64 20 6f 70 65 72 61 | 6e 64 2e 0d 5c 69 6e 64 |nd opera|nd..\ind|
|00003aa0| 65 78 7b 6d 6f 64 75 6c | 6f 7d 0d 0d 54 68 65 20 |ex{modul|o}..The |
|00003ab0| 69 6e 74 65 67 65 72 20 | 64 69 76 69 73 69 6f 6e |integer |division|
|00003ac0| 20 61 6e 64 20 6d 6f 64 | 75 6c 6f 20 6f 70 65 72 | and mod|ulo oper|
|00003ad0| 61 74 6f 72 73 20 61 72 | 65 20 63 6f 6e 6e 65 63 |ators ar|e connec|
|00003ae0| 74 65 64 20 62 79 20 74 | 68 65 0d 66 6f 6c 6c 6f |ted by t|he.follo|
|00003af0| 77 69 6e 67 20 69 64 65 | 6e 74 69 74 79 3a 20 5c |wing ide|ntity: \|
|00003b00| 76 65 72 62 40 78 20 3d | 3d 20 28 78 2f 79 29 2a |verb@x =|= (x/y)*|
|00003b10| 79 20 2b 20 28 78 25 79 | 29 40 2e 20 20 49 6e 74 |y + (x%y|)@. Int|
|00003b20| 65 67 65 72 20 64 69 76 | 69 73 69 6f 6e 20 61 6e |eger div|ision an|
|00003b30| 64 0d 6d 6f 64 75 6c 6f | 20 61 72 65 20 61 6c 73 |d.modulo| are als|
|00003b40| 6f 20 63 6f 6e 6e 65 63 | 74 65 64 20 77 69 74 68 |o connec|ted with|
|00003b50| 20 74 68 65 20 62 75 69 | 6c 74 2d 69 6e 20 66 75 | the bui|lt-in fu|
|00003b60| 6e 63 74 69 6f 6e 20 5c | 76 65 72 62 40 64 69 76 |nction \|verb@div|
|00003b70| 6d 6f 64 28 29 40 3a 0d | 5c 76 65 72 62 40 64 69 |mod()@:.|\verb@di|
|00003b80| 76 6d 6f 64 28 78 2c 20 | 79 29 20 3d 3d 20 28 78 |vmod(x, |y) == (x|
|00003b90| 2f 79 2c 20 78 25 79 29 | 40 2e 20 20 54 68 65 73 |/y, x%y)|@. Thes|
|00003ba0| 65 20 69 64 65 6e 74 69 | 74 69 65 73 20 64 6f 6e |e identi|ties don|
|00003bb0| 27 74 20 68 6f 6c 64 20 | 66 6f 72 0d 66 6c 6f 61 |'t hold |for.floa|
|00003bc0| 74 69 6e 67 20 70 6f 69 | 6e 74 20 6e 75 6d 62 65 |ting poi|nt numbe|
|00003bd0| 72 73 3b 20 74 68 65 72 | 65 20 61 20 73 69 6d 69 |rs; ther|e a simi|
|00003be0| 6c 61 72 20 69 64 65 6e | 74 69 74 79 20 68 6f 6c |lar iden|tity hol|
|00003bf0| 64 73 20 77 68 65 72 65 | 0d 5c 76 65 72 62 40 78 |ds where|.\verb@x|
|00003c00| 2f 79 40 20 69 73 20 72 | 65 70 6c 61 63 65 64 20 |/y@ is r|eplaced |
|00003c10| 62 79 20 5c 76 65 72 62 | 40 66 6c 6f 6f 72 28 78 |by \verb|@floor(x|
|00003c20| 2f 79 29 40 29 2e 0d 0d | 54 68 65 20 5c 76 65 72 |/y)@)...|The \ver|
|00003c30| 62 40 22 2b 22 40 20 28 | 61 64 64 69 74 69 6f 6e |b@"+"@ (|addition|
|00003c40| 29 20 6f 70 65 72 61 74 | 6f 72 20 79 69 65 6c 64 |) operat|or yield|
|00003c50| 73 20 74 68 65 20 73 75 | 6d 20 6f 66 20 69 74 73 |s the su|m of its|
|00003c60| 20 61 72 67 75 6d 65 6e | 74 73 2e 0d 54 68 65 20 | argumen|ts..The |
|00003c70| 61 72 67 75 6d 65 6e 74 | 73 20 6d 75 73 74 20 65 |argument|s must e|
|00003c80| 69 74 68 65 72 20 62 6f | 74 68 20 62 65 20 6e 75 |ither bo|th be nu|
|00003c90| 6d 62 65 72 73 2c 20 6f | 72 20 62 6f 74 68 20 73 |mbers, o|r both s|
|00003ca0| 65 71 75 65 6e 63 65 73 | 20 6f 66 20 74 68 65 0d |equences| of the.|
|00003cb0| 73 61 6d 65 20 74 79 70 | 65 2e 20 20 49 6e 20 74 |same typ|e. In t|
|00003cc0| 68 65 20 66 6f 72 6d 65 | 72 20 63 61 73 65 2c 20 |he forme|r case, |
|00003cd0| 74 68 65 20 6e 75 6d 62 | 65 72 73 20 61 72 65 20 |the numb|ers are |
|00003ce0| 63 6f 6e 76 65 72 74 65 | 64 20 74 6f 20 61 20 63 |converte|d to a c|
|00003cf0| 6f 6d 6d 6f 6e 0d 74 79 | 70 65 20 61 6e 64 20 74 |ommon.ty|pe and t|
|00003d00| 68 65 6e 20 61 64 64 65 | 64 20 74 6f 67 65 74 68 |hen adde|d togeth|
|00003d10| 65 72 2e 20 20 49 6e 20 | 74 68 65 20 6c 61 74 74 |er. In |the latt|
|00003d20| 65 72 20 63 61 73 65 2c | 20 74 68 65 20 73 65 71 |er case,| the seq|
|00003d30| 75 65 6e 63 65 73 20 61 | 72 65 0d 63 6f 6e 63 61 |uences a|re.conca|
|00003d40| 74 65 6e 61 74 65 64 2e | 0d 5c 69 6e 64 65 78 7b |tenated.|.\index{|
|00003d50| 61 64 64 69 74 69 6f 6e | 7d 0d 0d 54 68 65 20 5c |addition|}..The \|
|00003d60| 76 65 72 62 40 22 2d 22 | 40 20 28 73 75 62 74 72 |verb@"-"|@ (subtr|
|00003d70| 61 63 74 69 6f 6e 29 20 | 6f 70 65 72 61 74 6f 72 |action) |operator|
|00003d80| 20 79 69 65 6c 64 73 20 | 74 68 65 20 64 69 66 66 | yields |the diff|
|00003d90| 65 72 65 6e 63 65 20 6f | 66 20 69 74 73 0d 61 72 |erence o|f its.ar|
|00003da0| 67 75 6d 65 6e 74 73 2e | 20 20 54 68 65 20 6e 75 |guments.| The nu|
|00003db0| 6d 65 72 69 63 20 61 72 | 67 75 6d 65 6e 74 73 20 |meric ar|guments |
|00003dc0| 61 72 65 20 66 69 72 73 | 74 20 63 6f 6e 76 65 72 |are firs|t conver|
|00003dd0| 74 65 64 20 74 6f 20 61 | 20 63 6f 6d 6d 6f 6e 0d |ted to a| common.|
|00003de0| 74 79 70 65 2e 0d 5c 69 | 6e 64 65 78 7b 73 75 62 |type..\i|ndex{sub|
|00003df0| 74 72 61 63 74 69 6f 6e | 7d 0d 0d 5c 73 65 63 74 |traction|}..\sect|
|00003e00| 69 6f 6e 7b 53 68 69 66 | 74 69 6e 67 20 6f 70 65 |ion{Shif|ting ope|
|00003e10| 72 61 74 69 6f 6e 73 7d | 0d 5c 69 6e 64 65 78 69 |rations}|.\indexi|
|00003e20| 69 7b 73 68 69 66 74 69 | 6e 67 7d 7b 6f 70 65 72 |i{shifti|ng}{oper|
|00003e30| 61 74 69 6f 6e 7d 0d 0d | 54 68 65 20 73 68 69 66 |ation}..|The shif|
|00003e40| 74 69 6e 67 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |ting ope|rations |
|00003e50| 68 61 76 65 20 6c 6f 77 | 65 72 20 70 72 69 6f 72 |have low|er prior|
|00003e60| 69 74 79 20 74 68 61 6e | 20 74 68 65 20 61 72 69 |ity than| the ari|
|00003e70| 74 68 6d 65 74 69 63 0d | 6f 70 65 72 61 74 69 6f |thmetic.|operatio|
|00003e80| 6e 73 3a 0d 0d 5c 62 65 | 67 69 6e 7b 76 65 72 62 |ns:..\be|gin{verb|
|00003e90| 61 74 69 6d 7d 0d 73 68 | 69 66 74 5f 65 78 70 72 |atim}.sh|ift_expr|
|00003ea0| 3a 20 20 20 20 20 61 5f | 65 78 70 72 20 7c 20 73 |: a_|expr | s|
|00003eb0| 68 69 66 74 5f 65 78 70 | 72 20 28 20 22 3c 3c 22 |hift_exp|r ( "<<"|
|00003ec0| 20 7c 20 22 3e 3e 22 20 | 29 20 61 5f 65 78 70 72 | | ">>" |) a_expr|
|00003ed0| 0d 5c 65 6e 64 7b 76 65 | 72 62 61 74 69 6d 7d 0d |.\end{ve|rbatim}.|
|00003ee0| 0d 54 68 65 73 65 20 6f | 70 65 72 61 74 6f 72 73 |.These o|perators|
|00003ef0| 20 61 63 63 65 70 74 20 | 70 6c 61 69 6e 20 6f 72 | accept |plain or|
|00003f00| 20 6c 6f 6e 67 20 69 6e | 74 65 67 65 72 73 20 61 | long in|tegers a|
|00003f10| 73 20 61 72 67 75 6d 65 | 6e 74 73 2e 20 20 54 68 |s argume|nts. Th|
|00003f20| 65 0d 61 72 67 75 6d 65 | 6e 74 73 20 61 72 65 20 |e.argume|nts are |
|00003f30| 63 6f 6e 76 65 72 74 65 | 64 20 74 6f 20 61 20 63 |converte|d to a c|
|00003f40| 6f 6d 6d 6f 6e 20 74 79 | 70 65 2e 20 20 54 68 65 |ommon ty|pe. The|
|00003f50| 79 20 73 68 69 66 74 20 | 74 68 65 20 66 69 72 73 |y shift |the firs|
|00003f60| 74 0d 61 72 67 75 6d 65 | 6e 74 20 74 6f 20 74 68 |t.argume|nt to th|
|00003f70| 65 20 6c 65 66 74 20 6f | 72 20 72 69 67 68 74 20 |e left o|r right |
|00003f80| 62 79 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |by the n|umber of|
|00003f90| 20 62 69 74 73 20 67 69 | 76 65 6e 20 62 79 20 74 | bits gi|ven by t|
|00003fa0| 68 65 0d 73 65 63 6f 6e | 64 20 61 72 67 75 6d 65 |he.secon|d argume|
|00003fb0| 6e 74 2e 0d 0d 41 20 72 | 69 67 68 74 20 73 68 69 |nt...A r|ight shi|
|00003fc0| 66 74 20 62 79 20 24 6e | 24 20 62 69 74 73 20 69 |ft by $n|$ bits i|
|00003fd0| 73 20 64 65 66 69 6e 65 | 64 20 61 73 20 64 69 76 |s define|d as div|
|00003fe0| 69 73 69 6f 6e 20 62 79 | 20 24 32 5e 6e 24 2e 20 |ision by| $2^n$. |
|00003ff0| 20 41 20 6c 65 66 74 0d | 73 68 69 66 74 20 62 79 | A left.|shift by|
|00004000| 20 24 6e 24 20 62 69 74 | 73 20 69 73 20 64 65 66 | $n$ bit|s is def|
|00004010| 69 6e 65 64 20 61 73 20 | 6d 75 6c 74 69 70 6c 69 |ined as |multipli|
|00004020| 63 61 74 69 6f 6e 20 77 | 69 74 68 20 24 32 5e 6e |cation w|ith $2^n|
|00004030| 24 3b 20 66 6f 72 20 70 | 6c 61 69 6e 0d 69 6e 74 |$; for p|lain.int|
|00004040| 65 67 65 72 73 20 74 68 | 65 72 65 20 69 73 20 6e |egers th|ere is n|
|00004050| 6f 20 6f 76 65 72 66 6c | 6f 77 20 63 68 65 63 6b |o overfl|ow check|
|00004060| 20 73 6f 20 74 68 69 73 | 20 64 72 6f 70 73 20 62 | so this| drops b|
|00004070| 69 74 73 20 61 6e 64 20 | 66 6c 69 70 20 74 68 65 |its and |flip the|
|00004080| 0d 73 69 67 6e 20 69 66 | 20 74 68 65 20 72 65 73 |.sign if| the res|
|00004090| 75 6c 74 20 69 73 20 6e | 6f 74 20 6c 65 73 73 20 |ult is n|ot less |
|000040a0| 74 68 61 6e 20 24 32 5e | 7b 33 31 7d 24 20 69 6e |than $2^|{31}$ in|
|000040b0| 20 61 62 73 6f 6c 75 74 | 65 20 76 61 6c 75 65 2e | absolut|e value.|
|000040c0| 0d 0d 4e 65 67 61 74 69 | 76 65 20 73 68 69 66 74 |..Negati|ve shift|
|000040d0| 20 63 6f 75 6e 74 73 20 | 72 61 69 73 65 20 61 20 | counts |raise a |
|000040e0| 5c 76 65 72 62 40 56 61 | 6c 75 65 45 72 72 6f 72 |\verb@Va|lueError|
|000040f0| 40 20 65 78 63 65 70 74 | 69 6f 6e 2e 0d 5c 65 78 |@ except|ion..\ex|
|00004100| 69 6e 64 65 78 7b 56 61 | 6c 75 65 45 72 72 6f 72 |index{Va|lueError|
|00004110| 7d 0d 0d 5c 73 65 63 74 | 69 6f 6e 7b 42 69 6e 61 |}..\sect|ion{Bina|
|00004120| 72 79 20 62 69 74 2d 77 | 69 73 65 20 6f 70 65 72 |ry bit-w|ise oper|
|00004130| 61 74 69 6f 6e 73 7d 0d | 5c 69 6e 64 65 78 69 69 |ations}.|\indexii|
|00004140| 69 7b 62 69 6e 61 72 79 | 7d 7b 62 69 74 2d 77 69 |i{binary|}{bit-wi|
|00004150| 73 65 7d 7b 6f 70 65 72 | 61 74 69 6f 6e 7d 0d 0d |se}{oper|ation}..|
|00004160| 45 61 63 68 20 6f 66 20 | 74 68 65 20 74 68 72 65 |Each of |the thre|
|00004170| 65 20 62 69 74 77 69 73 | 65 20 6f 70 65 72 61 74 |e bitwis|e operat|
|00004180| 69 6f 6e 73 20 68 61 73 | 20 61 20 64 69 66 66 65 |ions has| a diffe|
|00004190| 72 65 6e 74 20 70 72 69 | 6f 72 69 74 79 20 6c 65 |rent pri|ority le|
|000041a0| 76 65 6c 3a 0d 0d 5c 62 | 65 67 69 6e 7b 76 65 72 |vel:..\b|egin{ver|
|000041b0| 62 61 74 69 6d 7d 0d 61 | 6e 64 5f 65 78 70 72 3a |batim}.a|nd_expr:|
|000041c0| 20 20 20 20 20 20 20 73 | 68 69 66 74 5f 65 78 70 | s|hift_exp|
|000041d0| 72 20 7c 20 61 6e 64 5f | 65 78 70 72 20 22 26 22 |r | and_|expr "&"|
|000041e0| 20 73 68 69 66 74 5f 65 | 78 70 72 0d 78 6f 72 5f | shift_e|xpr.xor_|
|000041f0| 65 78 70 72 3a 20 20 20 | 20 20 20 20 61 6e 64 5f |expr: | and_|
|00004200| 65 78 70 72 20 7c 20 78 | 6f 72 5f 65 78 70 72 20 |expr | x|or_expr |
|00004210| 22 5e 22 20 61 6e 64 5f | 65 78 70 72 0d 6f 72 5f |"^" and_|expr.or_|
|00004220| 65 78 70 72 3a 20 20 20 | 20 20 20 20 78 6f 72 5f |expr: | xor_|
|00004230| 65 78 70 72 20 7c 20 6f | 72 5f 65 78 70 72 20 22 |expr | o|r_expr "|
|00004240| 7c 22 20 78 6f 72 5f 65 | 78 70 72 0d 5c 65 6e 64 ||" xor_e|xpr.\end|
|00004250| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 0d 54 68 65 20 |{verbati|m}..The |
|00004260| 5c 76 65 72 62 40 22 26 | 22 40 20 6f 70 65 72 61 |\verb@"&|"@ opera|
|00004270| 74 6f 72 20 79 69 65 6c | 64 73 20 74 68 65 20 62 |tor yiel|ds the b|
|00004280| 69 74 77 69 73 65 20 41 | 4e 44 20 6f 66 20 69 74 |itwise A|ND of it|
|00004290| 73 20 61 72 67 75 6d 65 | 6e 74 73 2c 20 77 68 69 |s argume|nts, whi|
|000042a0| 63 68 0d 6d 75 73 74 20 | 62 65 20 70 6c 61 69 6e |ch.must |be plain|
|000042b0| 20 6f 72 20 6c 6f 6e 67 | 20 69 6e 74 65 67 65 72 | or long| integer|
|000042c0| 73 2e 20 20 54 68 65 20 | 61 72 67 75 6d 65 6e 74 |s. The |argument|
|000042d0| 73 20 61 72 65 20 63 6f | 6e 76 65 72 74 65 64 20 |s are co|nverted |
|000042e0| 74 6f 20 61 0d 63 6f 6d | 6d 6f 6e 20 74 79 70 65 |to a.com|mon type|
|000042f0| 2e 0d 5c 69 6e 64 65 78 | 69 69 7b 62 69 74 2d 77 |..\index|ii{bit-w|
|00004300| 69 73 65 7d 7b 61 6e 64 | 7d 0d 0d 54 68 65 20 5c |ise}{and|}..The \|
|00004310| 76 65 72 62 40 22 5e 22 | 40 20 6f 70 65 72 61 74 |verb@"^"|@ operat|
|00004320| 6f 72 20 79 69 65 6c 64 | 73 20 74 68 65 20 62 69 |or yield|s the bi|
|00004330| 74 77 69 73 65 20 58 4f | 52 20 28 65 78 63 6c 75 |twise XO|R (exclu|
|00004340| 73 69 76 65 20 4f 52 29 | 20 6f 66 20 69 74 73 0d |sive OR)| of its.|
|00004350| 61 72 67 75 6d 65 6e 74 | 73 2c 20 77 68 69 63 68 |argument|s, which|
|00004360| 20 6d 75 73 74 20 62 65 | 20 70 6c 61 69 6e 20 6f | must be| plain o|
|00004370| 72 20 6c 6f 6e 67 20 69 | 6e 74 65 67 65 72 73 2e |r long i|ntegers.|
|00004380| 20 20 54 68 65 20 61 72 | 67 75 6d 65 6e 74 73 20 | The ar|guments |
|00004390| 61 72 65 0d 63 6f 6e 76 | 65 72 74 65 64 20 74 6f |are.conv|erted to|
|000043a0| 20 61 20 63 6f 6d 6d 6f | 6e 20 74 79 70 65 2e 0d | a commo|n type..|
|000043b0| 5c 69 6e 64 65 78 69 69 | 7b 62 69 74 2d 77 69 73 |\indexii|{bit-wis|
|000043c0| 65 7d 7b 78 6f 72 7d 0d | 5c 69 6e 64 65 78 69 69 |e}{xor}.|\indexii|
|000043d0| 7b 65 78 63 6c 75 73 69 | 76 65 7d 7b 6f 72 7d 0d |{exclusi|ve}{or}.|
|000043e0| 0d 54 68 65 20 5c 76 65 | 72 62 40 22 7c 22 40 20 |.The \ve|rb@"|"@ |
|000043f0| 6f 70 65 72 61 74 6f 72 | 20 79 69 65 6c 64 73 20 |operator| yields |
|00004400| 74 68 65 20 62 69 74 77 | 69 73 65 20 28 69 6e 63 |the bitw|ise (inc|
|00004410| 6c 75 73 69 76 65 29 20 | 4f 52 20 6f 66 20 69 74 |lusive) |OR of it|
|00004420| 73 0d 61 72 67 75 6d 65 | 6e 74 73 2c 20 77 68 69 |s.argume|nts, whi|
|00004430| 63 68 20 6d 75 73 74 20 | 62 65 20 70 6c 61 69 6e |ch must |be plain|
|00004440| 20 6f 72 20 6c 6f 6e 67 | 20 69 6e 74 65 67 65 72 | or long| integer|
|00004450| 73 2e 20 20 54 68 65 20 | 61 72 67 75 6d 65 6e 74 |s. The |argument|
|00004460| 73 20 61 72 65 0d 63 6f | 6e 76 65 72 74 65 64 20 |s are.co|nverted |
|00004470| 74 6f 20 61 20 63 6f 6d | 6d 6f 6e 20 74 79 70 65 |to a com|mon type|
|00004480| 2e 0d 5c 69 6e 64 65 78 | 69 69 7b 62 69 74 2d 77 |..\index|ii{bit-w|
|00004490| 69 73 65 7d 7b 6f 72 7d | 0d 5c 69 6e 64 65 78 69 |ise}{or}|.\indexi|
|000044a0| 69 7b 69 6e 63 6c 75 73 | 69 76 65 7d 7b 6f 72 7d |i{inclus|ive}{or}|
|000044b0| 0d 0d 5c 73 65 63 74 69 | 6f 6e 7b 43 6f 6d 70 61 |..\secti|on{Compa|
|000044c0| 72 69 73 6f 6e 73 7d 0d | 5c 69 6e 64 65 78 7b 63 |risons}.|\index{c|
|000044d0| 6f 6d 70 61 72 69 73 6f | 6e 7d 0d 0d 43 6f 6e 74 |ompariso|n}..Cont|
|000044e0| 72 61 72 79 20 74 6f 20 | 43 2c 20 61 6c 6c 20 63 |rary to |C, all c|
|000044f0| 6f 6d 70 61 72 69 73 6f | 6e 20 6f 70 65 72 61 74 |ompariso|n operat|
|00004500| 69 6f 6e 73 20 69 6e 20 | 50 79 74 68 6f 6e 20 68 |ions in |Python h|
|00004510| 61 76 65 20 74 68 65 20 | 73 61 6d 65 0d 70 72 69 |ave the |same.pri|
|00004520| 6f 72 69 74 79 2c 20 77 | 68 69 63 68 20 69 73 20 |ority, w|hich is |
|00004530| 6c 6f 77 65 72 20 74 68 | 61 6e 20 74 68 61 74 20 |lower th|an that |
|00004540| 6f 66 20 61 6e 79 20 61 | 72 69 74 68 6d 65 74 69 |of any a|rithmeti|
|00004550| 63 2c 20 73 68 69 66 74 | 69 6e 67 20 6f 72 0d 62 |c, shift|ing or.b|
|00004560| 69 74 77 69 73 65 20 6f | 70 65 72 61 74 69 6f 6e |itwise o|peration|
|00004570| 2e 20 20 41 6c 73 6f 20 | 63 6f 6e 74 72 61 72 79 |. Also |contrary|
|00004580| 20 74 6f 20 43 2c 20 65 | 78 70 72 65 73 73 69 6f | to C, e|xpressio|
|00004590| 6e 73 20 6c 69 6b 65 0d | 5c 76 65 72 62 40 61 20 |ns like.|\verb@a |
|000045a0| 3c 20 62 20 3c 20 63 40 | 20 68 61 76 65 20 74 68 |< b < c@| have th|
|000045b0| 65 20 69 6e 74 65 72 70 | 72 65 74 61 74 69 6f 6e |e interp|retation|
|000045c0| 20 74 68 61 74 20 69 73 | 20 63 6f 6e 76 65 6e 74 | that is| convent|
|000045d0| 69 6f 6e 61 6c 20 69 6e | 0d 6d 61 74 68 65 6d 61 |ional in|.mathema|
|000045e0| 74 69 63 73 3a 0d 5c 69 | 6e 64 65 78 7b 43 7d 0d |tics:.\i|ndex{C}.|
|000045f0| 0d 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00004600| 7d 0d 63 6f 6d 70 61 72 | 69 73 6f 6e 3a 20 20 20 |}.compar|ison: |
|00004610| 20 20 6f 72 5f 65 78 70 | 72 20 28 63 6f 6d 70 5f | or_exp|r (comp_|
|00004620| 6f 70 65 72 61 74 6f 72 | 20 6f 72 5f 65 78 70 72 |operator| or_expr|
|00004630| 29 2a 0d 63 6f 6d 70 5f | 6f 70 65 72 61 74 6f 72 |)*.comp_|operator|
|00004640| 3a 20 20 22 3c 22 7c 22 | 3e 22 7c 22 3d 3d 22 7c |: "<"|"|>"|"=="||
|00004650| 22 3e 3d 22 7c 22 3c 3d | 22 7c 22 3c 3e 22 7c 22 |">="|"<=|"|"<>"|"|
|00004660| 21 3d 22 7c 22 69 73 22 | 20 5b 22 6e 6f 74 22 5d |!="|"is"| ["not"]|
|00004670| 7c 5b 22 6e 6f 74 22 5d | 20 22 69 6e 22 0d 5c 65 ||["not"]| "in".\e|
|00004680| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0d 0d 43 6f |nd{verba|tim}..Co|
|00004690| 6d 70 61 72 69 73 6f 6e | 73 20 79 69 65 6c 64 20 |mparison|s yield |
|000046a0| 69 6e 74 65 67 65 72 20 | 76 61 6c 75 65 73 3a 20 |integer |values: |
|000046b0| 31 20 66 6f 72 20 74 72 | 75 65 2c 20 30 20 66 6f |1 for tr|ue, 0 fo|
|000046c0| 72 20 66 61 6c 73 65 2e | 0d 0d 43 6f 6d 70 61 72 |r false.|..Compar|
|000046d0| 69 73 6f 6e 73 20 63 61 | 6e 20 62 65 20 63 68 61 |isons ca|n be cha|
|000046e0| 69 6e 65 64 20 61 72 62 | 69 74 72 61 72 69 6c 79 |ined arb|itrarily|
|000046f0| 2c 20 65 2e 67 2e 20 24 | 78 20 3c 20 79 20 3c 3d |, e.g. $|x < y <=|
|00004700| 20 7a 24 20 69 73 0d 65 | 71 75 69 76 61 6c 65 6e | z$ is.e|quivalen|
|00004710| 74 20 74 6f 20 24 78 20 | 3c 20 79 24 20 5c 76 65 |t to $x |< y$ \ve|
|00004720| 72 62 40 61 6e 64 40 20 | 24 79 20 3c 3d 20 7a 24 |rb@and@ |$y <= z$|
|00004730| 2c 20 65 78 63 65 70 74 | 20 74 68 61 74 20 24 79 |, except| that $y|
|00004740| 24 20 69 73 0d 65 76 61 | 6c 75 61 74 65 64 20 6f |$ is.eva|luated o|
|00004750| 6e 6c 79 20 6f 6e 63 65 | 20 28 62 75 74 20 69 6e |nly once| (but in|
|00004760| 20 62 6f 74 68 20 63 61 | 73 65 73 20 24 7a 24 20 | both ca|ses $z$ |
|00004770| 69 73 20 6e 6f 74 20 65 | 76 61 6c 75 61 74 65 64 |is not e|valuated|
|00004780| 20 61 74 20 61 6c 6c 0d | 77 68 65 6e 20 24 78 20 | at all.|when $x |
|00004790| 3c 20 79 24 20 69 73 20 | 66 6f 75 6e 64 20 74 6f |< y$ is |found to|
|000047a0| 20 62 65 20 66 61 6c 73 | 65 29 2e 0d 5c 69 6e 64 | be fals|e)..\ind|
|000047b0| 65 78 69 69 7b 63 68 61 | 69 6e 69 6e 67 7d 7b 63 |exii{cha|ining}{c|
|000047c0| 6f 6d 70 61 72 69 73 6f | 6e 73 7d 0d 0d 5c 63 61 |ompariso|ns}..\ca|
|000047d0| 74 63 6f 64 65 60 5c 5f | 3d 38 0d 46 6f 72 6d 61 |tcode`\_|=8.Forma|
|000047e0| 6c 6c 79 2c 20 24 65 5f | 30 20 6f 70 5f 31 20 65 |lly, $e_|0 op_1 e|
|000047f0| 5f 31 20 6f 70 5f 32 20 | 65 5f 32 20 2e 2e 2e 65 |_1 op_2 |e_2 ...e|
|00004800| 5f 7b 6e 2d 31 7d 20 6f | 70 5f 6e 20 65 5f 6e 24 |_{n-1} o|p_n e_n$|
|00004810| 20 69 73 20 65 71 75 69 | 76 61 6c 65 6e 74 20 74 | is equi|valent t|
|00004820| 6f 0d 24 65 5f 30 20 6f | 70 5f 31 20 65 5f 31 24 |o.$e_0 o|p_1 e_1$|
|00004830| 20 5c 76 65 72 62 40 61 | 6e 64 40 20 24 65 5f 31 | \verb@a|nd@ $e_1|
|00004840| 20 6f 70 5f 32 20 65 5f | 32 24 20 5c 76 65 72 62 | op_2 e_|2$ \verb|
|00004850| 40 61 6e 64 40 20 2e 2e | 2e 20 5c 76 65 72 62 40 |@and@ ..|. \verb@|
|00004860| 61 6e 64 40 0d 24 65 5f | 7b 6e 2d 31 7d 20 6f 70 |and@.$e_|{n-1} op|
|00004870| 5f 6e 20 65 5f 6e 24 2c | 20 65 78 63 65 70 74 20 |_n e_n$,| except |
|00004880| 74 68 61 74 20 65 61 63 | 68 20 65 78 70 72 65 73 |that eac|h expres|
|00004890| 73 69 6f 6e 20 69 73 20 | 65 76 61 6c 75 61 74 65 |sion is |evaluate|
|000048a0| 64 20 61 74 20 6d 6f 73 | 74 20 6f 6e 63 65 2e 0d |d at mos|t once..|
|000048b0| 0d 4e 6f 74 65 20 74 68 | 61 74 20 24 65 5f 30 20 |.Note th|at $e_0 |
|000048c0| 6f 70 5f 31 20 65 5f 31 | 20 6f 70 5f 32 20 65 5f |op_1 e_1| op_2 e_|
|000048d0| 32 24 20 64 6f 65 73 20 | 6e 6f 74 20 69 6d 70 6c |2$ does |not impl|
|000048e0| 79 20 61 6e 79 20 6b 69 | 6e 64 20 6f 66 20 63 6f |y any ki|nd of co|
|000048f0| 6d 70 61 72 69 73 6f 6e | 0d 62 65 74 77 65 65 6e |mparison|.between|
|00004900| 20 24 65 5f 30 24 20 61 | 6e 64 20 24 65 5f 32 24 | $e_0$ a|nd $e_2$|
|00004910| 2c 20 65 2e 67 2e 20 24 | 78 20 3c 20 79 20 3e 20 |, e.g. $|x < y > |
|00004920| 7a 24 20 69 73 20 70 65 | 72 66 65 63 74 6c 79 20 |z$ is pe|rfectly |
|00004930| 6c 65 67 61 6c 2e 0d 5c | 63 61 74 63 6f 64 65 60 |legal..\|catcode`|
|00004940| 5c 5f 3d 31 32 0d 0d 54 | 68 65 20 66 6f 72 6d 73 |\_=12..T|he forms|
|00004950| 20 5c 76 65 72 62 40 3c | 3e 40 20 61 6e 64 20 5c | \verb@<|>@ and \|
|00004960| 76 65 72 62 40 21 3d 40 | 20 61 72 65 20 65 71 75 |verb@!=@| are equ|
|00004970| 69 76 61 6c 65 6e 74 3b | 20 66 6f 72 20 63 6f 6e |ivalent;| for con|
|00004980| 73 69 73 74 65 6e 63 79 | 20 77 69 74 68 0d 43 2c |sistency| with.C,|
|00004990| 20 5c 76 65 72 62 40 21 | 3d 40 20 69 73 20 70 72 | \verb@!|=@ is pr|
|000049a0| 65 66 65 72 72 65 64 3b | 20 77 68 65 72 65 20 5c |eferred;| where \|
|000049b0| 76 65 72 62 40 21 3d 40 | 20 69 73 20 6d 65 6e 74 |verb@!=@| is ment|
|000049c0| 69 6f 6e 65 64 20 62 65 | 6c 6f 77 0d 5c 76 65 72 |ioned be|low.\ver|
|000049d0| 62 40 3c 3e 40 20 69 73 | 20 61 6c 73 6f 20 69 6d |b@<>@ is| also im|
|000049e0| 70 6c 69 65 64 2e 0d 0d | 54 68 65 20 6f 70 65 72 |plied...|The oper|
|000049f0| 61 74 6f 72 73 20 7b 5c | 74 74 20 22 3c 22 2c 20 |ators {\|tt "<", |
|00004a00| 22 3e 22 2c 20 22 3d 3d | 22 2c 20 22 3e 3d 22 2c |">", "==|", ">=",|
|00004a10| 20 22 3c 3d 22 7d 2c 20 | 61 6e 64 20 7b 5c 74 74 | "<="}, |and {\tt|
|00004a20| 20 22 21 3d 22 7d 20 63 | 6f 6d 70 61 72 65 0d 74 | "!="} c|ompare.t|
|00004a30| 68 65 20 76 61 6c 75 65 | 73 20 6f 66 20 74 77 6f |he value|s of two|
|00004a40| 20 6f 62 6a 65 63 74 73 | 2e 20 20 54 68 65 20 6f | objects|. The o|
|00004a50| 62 6a 65 63 74 73 20 6e | 65 65 64 6e 27 74 20 68 |bjects n|eedn't h|
|00004a60| 61 76 65 20 74 68 65 20 | 73 61 6d 65 20 74 79 70 |ave the |same typ|
|00004a70| 65 2e 0d 49 66 20 62 6f | 74 68 20 61 72 65 20 6e |e..If bo|th are n|
|00004a80| 75 6d 62 65 72 73 2c 20 | 74 68 65 79 20 61 72 65 |umbers, |they are|
|00004a90| 20 63 6f 76 65 72 74 65 | 64 20 74 6f 20 61 20 63 | coverte|d to a c|
|00004aa0| 6f 6d 6d 6f 6e 20 74 79 | 70 65 2e 20 20 4f 74 68 |ommon ty|pe. Oth|
|00004ab0| 65 72 77 69 73 65 2c 0d | 6f 62 6a 65 63 74 73 20 |erwise,.|objects |
|00004ac0| 6f 66 20 64 69 66 66 65 | 72 65 6e 74 20 74 79 70 |of diffe|rent typ|
|00004ad0| 65 73 20 7b 5c 65 6d 20 | 61 6c 77 61 79 73 7d 20 |es {\em |always} |
|00004ae0| 63 6f 6d 70 61 72 65 20 | 75 6e 65 71 75 61 6c 2c |compare |unequal,|
|00004af0| 20 61 6e 64 20 61 72 65 | 0d 6f 72 64 65 72 65 64 | and are|.ordered|
|00004b00| 20 63 6f 6e 73 69 73 74 | 65 6e 74 6c 79 20 62 75 | consist|ently bu|
|00004b10| 74 20 61 72 62 69 74 72 | 61 72 69 6c 79 2e 0d 0d |t arbitr|arily...|
|00004b20| 28 54 68 69 73 20 75 6e | 75 73 75 61 6c 20 64 65 |(This un|usual de|
|00004b30| 66 69 6e 69 74 69 6f 6e | 20 6f 66 20 63 6f 6d 70 |finition| of comp|
|00004b40| 61 72 69 73 6f 6e 20 69 | 73 20 64 6f 6e 65 20 74 |arison i|s done t|
|00004b50| 6f 20 73 69 6d 70 6c 69 | 66 79 20 74 68 65 0d 64 |o simpli|fy the.d|
|00004b60| 65 66 69 6e 69 74 69 6f | 6e 20 6f 66 20 6f 70 65 |efinitio|n of ope|
|00004b70| 72 61 74 69 6f 6e 73 20 | 6c 69 6b 65 20 73 6f 72 |rations |like sor|
|00004b80| 74 69 6e 67 20 61 6e 64 | 20 74 68 65 20 5c 76 65 |ting and| the \ve|
|00004b90| 72 62 40 69 6e 40 20 61 | 6e 64 0d 5c 76 65 72 62 |rb@in@ a|nd.\verb|
|00004ba0| 40 6e 6f 74 20 69 6e 40 | 20 6f 70 65 72 61 74 6f |@not in@| operato|
|00004bb0| 72 73 2e 29 0d 0d 43 6f | 6d 70 61 72 69 73 6f 6e |rs.)..Co|mparison|
|00004bc0| 20 6f 66 20 6f 62 6a 65 | 63 74 73 20 6f 66 20 74 | of obje|cts of t|
|00004bd0| 68 65 20 73 61 6d 65 20 | 74 79 70 65 20 64 65 70 |he same |type dep|
|00004be0| 65 6e 64 73 20 6f 6e 20 | 74 68 65 20 74 79 70 65 |ends on |the type|
|00004bf0| 3a 0d 0d 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |:..\begi|n{itemiz|
|00004c00| 65 7d 0d 0d 5c 69 74 65 | 6d 0d 4e 75 6d 62 65 72 |e}..\ite|m.Number|
|00004c10| 73 20 61 72 65 20 63 6f | 6d 70 61 72 65 64 20 61 |s are co|mpared a|
|00004c20| 72 69 74 68 6d 65 74 69 | 63 61 6c 6c 79 2e 0d 0d |rithmeti|cally...|
|00004c30| 5c 69 74 65 6d 0d 53 74 | 72 69 6e 67 73 20 61 72 |\item.St|rings ar|
|00004c40| 65 20 63 6f 6d 70 61 72 | 65 64 20 6c 65 78 69 63 |e compar|ed lexic|
|00004c50| 6f 67 72 61 70 68 69 63 | 61 6c 6c 79 20 75 73 69 |ographic|ally usi|
|00004c60| 6e 67 20 74 68 65 20 6e | 75 6d 65 72 69 63 20 65 |ng the n|umeric e|
|00004c70| 71 75 69 76 61 6c 65 6e | 74 73 0d 28 74 68 65 20 |quivalen|ts.(the |
|00004c80| 72 65 73 75 6c 74 20 6f | 66 20 74 68 65 20 62 75 |result o|f the bu|
|00004c90| 69 6c 74 2d 69 6e 20 66 | 75 6e 63 74 69 6f 6e 20 |ilt-in f|unction |
|00004ca0| 5c 76 65 72 62 40 6f 72 | 64 40 29 20 6f 66 20 74 |\verb@or|d@) of t|
|00004cb0| 68 65 69 72 20 63 68 61 | 72 61 63 74 65 72 73 2e |heir cha|racters.|
|00004cc0| 0d 0d 5c 69 74 65 6d 0d | 54 75 70 6c 65 73 20 61 |..\item.|Tuples a|
|00004cd0| 6e 64 20 6c 69 73 74 73 | 20 61 72 65 20 63 6f 6d |nd lists| are com|
|00004ce0| 70 61 72 65 64 20 6c 65 | 78 69 63 6f 67 72 61 70 |pared le|xicograp|
|00004cf0| 68 69 63 61 6c 6c 79 20 | 75 73 69 6e 67 20 63 6f |hically |using co|
|00004d00| 6d 70 61 72 69 73 6f 6e | 20 6f 66 0d 63 6f 72 72 |mparison| of.corr|
|00004d10| 65 73 70 6f 6e 64 69 6e | 67 20 69 74 65 6d 73 2e |espondin|g items.|
|00004d20| 0d 0d 5c 69 74 65 6d 0d | 4d 61 70 70 69 6e 67 73 |..\item.|Mappings|
|00004d30| 20 28 64 69 63 74 69 6f | 6e 61 72 69 65 73 29 20 | (dictio|naries) |
|00004d40| 61 72 65 20 63 6f 6d 70 | 61 72 65 64 20 74 68 72 |are comp|ared thr|
|00004d50| 6f 75 67 68 20 6c 65 78 | 69 63 6f 67 72 61 70 68 |ough lex|icograph|
|00004d60| 69 63 0d 63 6f 6d 70 61 | 72 69 73 6f 6e 20 6f 66 |ic.compa|rison of|
|00004d70| 20 74 68 65 69 72 20 73 | 6f 72 74 65 64 20 28 6b | their s|orted (k|
|00004d80| 65 79 2c 20 76 61 6c 75 | 65 29 20 6c 69 73 74 73 |ey, valu|e) lists|
|00004d90| 2e 25 0d 5c 66 6f 6f 74 | 6e 6f 74 65 7b 54 68 69 |.%.\foot|note{Thi|
|00004da0| 73 20 69 73 20 65 78 70 | 65 6e 73 69 76 65 20 73 |s is exp|ensive s|
|00004db0| 69 6e 63 65 20 69 74 20 | 72 65 71 75 69 72 65 73 |ince it |requires|
|00004dc0| 20 73 6f 72 74 69 6e 67 | 20 74 68 65 20 6b 65 79 | sorting| the key|
|00004dd0| 73 20 66 69 72 73 74 2c | 0d 62 75 74 20 61 62 6f |s first,|.but abo|
|00004de0| 75 74 20 74 68 65 20 6f | 6e 6c 79 20 73 65 6e 73 |ut the o|nly sens|
|00004df0| 69 62 6c 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 2e |ible def|inition.|
|00004e00| 20 20 41 6e 20 65 61 72 | 6c 69 65 72 20 76 65 72 | An ear|lier ver|
|00004e10| 73 69 6f 6e 20 6f 66 20 | 50 79 74 68 6f 6e 0d 63 |sion of |Python.c|
|00004e20| 6f 6d 70 61 72 65 64 20 | 64 69 63 74 69 6f 6e 61 |ompared |dictiona|
|00004e30| 72 69 65 73 20 62 79 20 | 69 64 65 6e 74 69 74 79 |ries by |identity|
|00004e40| 20 6f 6e 6c 79 2c 20 62 | 75 74 20 74 68 69 73 20 | only, b|ut this |
|00004e50| 63 61 75 73 65 64 20 73 | 75 72 70 72 69 73 65 73 |caused s|urprises|
|00004e60| 0d 62 65 63 61 75 73 65 | 20 70 65 6f 70 6c 65 20 |.because| people |
|00004e70| 65 78 70 65 63 74 65 64 | 20 74 6f 20 62 65 20 61 |expected| to be a|
|00004e80| 62 6c 65 20 74 6f 20 74 | 65 73 74 20 61 20 64 69 |ble to t|est a di|
|00004e90| 63 74 69 6f 6e 61 72 79 | 20 66 6f 72 20 65 6d 70 |ctionary| for emp|
|00004ea0| 74 69 6e 65 73 73 0d 62 | 79 20 63 6f 6d 70 61 72 |tiness.b|y compar|
|00004eb0| 69 6e 67 20 69 74 20 74 | 6f 20 7b 5c 74 74 20 5c |ing it t|o {\tt \|
|00004ec0| 7b 5c 7d 7d 2e 7d 0d 0d | 5c 69 74 65 6d 0d 4d 6f |{\}}.}..|\item.Mo|
|00004ed0| 73 74 20 6f 74 68 65 72 | 20 74 79 70 65 73 20 63 |st other| types c|
|00004ee0| 6f 6d 70 61 72 65 20 75 | 6e 65 71 75 61 6c 20 75 |ompare u|nequal u|
|00004ef0| 6e 6c 65 73 73 20 74 68 | 65 79 20 61 72 65 20 74 |nless th|ey are t|
|00004f00| 68 65 20 73 61 6d 65 20 | 6f 62 6a 65 63 74 3b 0d |he same |object;.|
|00004f10| 74 68 65 20 63 68 6f 69 | 63 65 20 77 68 65 74 68 |the choi|ce wheth|
|00004f20| 65 72 20 6f 6e 65 20 6f | 62 6a 65 63 74 20 69 73 |er one o|bject is|
|00004f30| 20 63 6f 6e 73 69 64 65 | 72 65 64 20 73 6d 61 6c | conside|red smal|
|00004f40| 6c 65 72 20 6f 72 20 6c | 61 72 67 65 72 20 74 68 |ler or l|arger th|
|00004f50| 61 6e 0d 61 6e 6f 74 68 | 65 72 20 6f 6e 65 20 69 |an.anoth|er one i|
|00004f60| 73 20 6d 61 64 65 20 61 | 72 62 69 74 72 61 72 69 |s made a|rbitrari|
|00004f70| 6c 79 20 62 75 74 20 63 | 6f 6e 73 69 73 74 65 6e |ly but c|onsisten|
|00004f80| 74 6c 79 20 77 69 74 68 | 69 6e 20 6f 6e 65 0d 65 |tly with|in one.e|
|00004f90| 78 65 63 75 74 69 6f 6e | 20 6f 66 20 61 20 70 72 |xecution| of a pr|
|00004fa0| 6f 67 72 61 6d 2e 0d 0d | 5c 65 6e 64 7b 69 74 65 |ogram...|\end{ite|
|00004fb0| 6d 69 7a 65 7d 0d 0d 54 | 68 65 20 6f 70 65 72 61 |mize}..T|he opera|
|00004fc0| 74 6f 72 73 20 5c 76 65 | 72 62 40 69 6e 40 20 61 |tors \ve|rb@in@ a|
|00004fd0| 6e 64 20 5c 76 65 72 62 | 40 6e 6f 74 20 69 6e 40 |nd \verb|@not in@|
|00004fe0| 20 74 65 73 74 20 66 6f | 72 20 73 65 71 75 65 6e | test fo|r sequen|
|00004ff0| 63 65 0d 6d 65 6d 62 65 | 72 73 68 69 70 3a 20 69 |ce.membe|rship: i|
|00005000| 66 20 24 79 24 20 69 73 | 20 61 20 73 65 71 75 65 |f $y$ is| a seque|
|00005010| 6e 63 65 2c 20 24 78 20 | 7e 5c 76 65 72 62 40 69 |nce, $x |~\verb@i|
|00005020| 6e 40 7e 20 79 24 20 69 | 73 20 74 72 75 65 20 69 |n@~ y$ i|s true i|
|00005030| 66 20 61 6e 64 0d 6f 6e | 6c 79 20 69 66 20 74 68 |f and.on|ly if th|
|00005040| 65 72 65 20 65 78 69 73 | 74 73 20 61 6e 20 69 6e |ere exis|ts an in|
|00005050| 64 65 78 20 24 69 24 20 | 73 75 63 68 20 74 68 61 |dex $i$ |such tha|
|00005060| 74 20 24 78 20 3d 20 79 | 5b 69 5d 24 2e 0d 24 78 |t $x = y|[i]$..$x|
|00005070| 20 7e 5c 76 65 72 62 40 | 6e 6f 74 20 69 6e 40 7e | ~\verb@|not in@~|
|00005080| 20 79 24 20 79 69 65 6c | 64 73 20 74 68 65 20 69 | y$ yiel|ds the i|
|00005090| 6e 76 65 72 73 65 20 74 | 72 75 74 68 20 76 61 6c |nverse t|ruth val|
|000050a0| 75 65 2e 20 20 54 68 65 | 20 65 78 63 65 70 74 69 |ue. The| excepti|
|000050b0| 6f 6e 0d 5c 76 65 72 62 | 40 54 79 70 65 45 72 72 |on.\verb|@TypeErr|
|000050c0| 6f 72 40 20 69 73 20 72 | 61 69 73 65 64 20 77 68 |or@ is r|aised wh|
|000050d0| 65 6e 20 24 79 24 20 69 | 73 20 6e 6f 74 20 61 20 |en $y$ i|s not a |
|000050e0| 73 65 71 75 65 6e 63 65 | 2c 20 6f 72 20 77 68 65 |sequence|, or whe|
|000050f0| 6e 20 24 79 24 20 69 73 | 0d 61 20 73 74 72 69 6e |n $y$ is|.a strin|
|00005100| 67 20 61 6e 64 20 24 78 | 24 20 69 73 20 6e 6f 74 |g and $x|$ is not|
|00005110| 20 61 20 73 74 72 69 6e | 67 20 6f 66 20 6c 65 6e | a strin|g of len|
|00005120| 67 74 68 20 6f 6e 65 2e | 25 0d 5c 66 6f 6f 74 6e |gth one.|%.\footn|
|00005130| 6f 74 65 7b 54 68 65 20 | 6c 61 74 74 65 72 20 72 |ote{The |latter r|
|00005140| 65 73 74 72 69 63 74 69 | 6f 6e 20 69 73 20 73 6f |estricti|on is so|
|00005150| 6d 65 74 69 6d 65 73 20 | 61 20 6e 75 69 73 61 6e |metimes |a nuisan|
|00005160| 63 65 2e 7d 0d 5c 6f 70 | 69 6e 64 65 78 7b 69 6e |ce.}.\op|index{in|
|00005170| 7d 0d 5c 6f 70 69 6e 64 | 65 78 7b 6e 6f 74 20 69 |}.\opind|ex{not i|
|00005180| 6e 7d 0d 5c 69 6e 64 65 | 78 69 69 7b 6d 65 6d 62 |n}.\inde|xii{memb|
|00005190| 65 72 73 68 69 70 7d 7b | 74 65 73 74 7d 0d 5c 6f |ership}{|test}.\o|
|000051a0| 62 69 6e 64 65 78 7b 73 | 65 71 75 65 6e 63 65 7d |bindex{s|equence}|
|000051b0| 0d 0d 54 68 65 20 6f 70 | 65 72 61 74 6f 72 73 20 |..The op|erators |
|000051c0| 5c 76 65 72 62 40 69 73 | 40 20 61 6e 64 20 5c 76 |\verb@is|@ and \v|
|000051d0| 65 72 62 40 69 73 20 6e | 6f 74 40 20 74 65 73 74 |erb@is n|ot@ test|
|000051e0| 20 66 6f 72 20 6f 62 6a | 65 63 74 20 69 64 65 6e | for obj|ect iden|
|000051f0| 74 69 74 79 3a 0d 24 78 | 20 7e 5c 76 65 72 62 40 |tity:.$x| ~\verb@|
|00005200| 69 73 40 7e 20 79 24 20 | 69 73 20 74 72 75 65 20 |is@~ y$ |is true |
|00005210| 69 66 20 61 6e 64 20 6f | 6e 6c 79 20 69 66 20 24 |if and o|nly if $|
|00005220| 78 24 20 61 6e 64 20 24 | 79 24 20 61 72 65 20 74 |x$ and $|y$ are t|
|00005230| 68 65 20 73 61 6d 65 0d | 6f 62 6a 65 63 74 2e 20 |he same.|object. |
|00005240| 20 24 78 20 7e 5c 76 65 | 72 62 40 69 73 20 6e 6f | $x ~\ve|rb@is no|
|00005250| 74 40 7e 20 79 24 20 79 | 69 65 6c 64 73 20 74 68 |t@~ y$ y|ields th|
|00005260| 65 20 69 6e 76 65 72 73 | 65 20 74 72 75 74 68 20 |e invers|e truth |
|00005270| 76 61 6c 75 65 2e 0d 5c | 6f 70 69 6e 64 65 78 7b |value..\|opindex{|
|00005280| 69 73 7d 0d 5c 6f 70 69 | 6e 64 65 78 7b 69 73 20 |is}.\opi|ndex{is |
|00005290| 6e 6f 74 7d 0d 5c 69 6e | 64 65 78 69 69 7b 69 64 |not}.\in|dexii{id|
|000052a0| 65 6e 74 69 74 79 7d 7b | 74 65 73 74 7d 0d 0d 5c |entity}{|test}..\|
|000052b0| 73 65 63 74 69 6f 6e 7b | 42 6f 6f 6c 65 61 6e 20 |section{|Boolean |
|000052c0| 6f 70 65 72 61 74 69 6f | 6e 73 7d 20 5c 6c 61 62 |operatio|ns} \lab|
|000052d0| 65 6c 7b 42 6f 6f 6c 65 | 61 6e 73 7d 0d 5c 69 6e |el{Boole|ans}.\in|
|000052e0| 64 65 78 69 69 7b 42 6f | 6f 6c 65 61 6e 7d 7b 6f |dexii{Bo|olean}{o|
|000052f0| 70 65 72 61 74 69 6f 6e | 7d 0d 0d 42 6f 6f 6c 65 |peration|}..Boole|
|00005300| 61 6e 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 68 61 |an opera|tions ha|
|00005310| 76 65 20 74 68 65 20 6c | 6f 77 65 73 74 20 70 72 |ve the l|owest pr|
|00005320| 69 6f 72 69 74 79 20 6f | 66 20 61 6c 6c 20 50 79 |iority o|f all Py|
|00005330| 74 68 6f 6e 20 6f 70 65 | 72 61 74 69 6f 6e 73 3a |thon ope|rations:|
|00005340| 0d 0d 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |..\begin|{verbati|
|00005350| 6d 7d 0d 63 6f 6e 64 69 | 74 69 6f 6e 3a 20 20 20 |m}.condi|tion: |
|00005360| 20 20 20 6f 72 5f 74 65 | 73 74 20 7c 20 6c 61 6d | or_te|st | lam|
|00005370| 62 64 61 5f 66 6f 72 6d | 0d 6f 72 5f 74 65 73 74 |bda_form|.or_test|
|00005380| 3a 20 20 20 20 20 20 20 | 20 61 6e 64 5f 74 65 73 |: | and_tes|
|00005390| 74 20 7c 20 6f 72 5f 74 | 65 73 74 20 22 6f 72 22 |t | or_t|est "or"|
|000053a0| 20 61 6e 64 5f 74 65 73 | 74 0d 61 6e 64 5f 74 65 | and_tes|t.and_te|
|000053b0| 73 74 3a 20 20 20 20 20 | 20 20 6e 6f 74 5f 74 65 |st: | not_te|
|000053c0| 73 74 20 7c 20 61 6e 64 | 5f 74 65 73 74 20 22 61 |st | and|_test "a|
|000053d0| 6e 64 22 20 6e 6f 74 5f | 74 65 73 74 0d 6e 6f 74 |nd" not_|test.not|
|000053e0| 5f 74 65 73 74 3a 20 20 | 20 20 20 20 20 63 6f 6d |_test: | com|
|000053f0| 70 61 72 69 73 6f 6e 20 | 7c 20 22 6e 6f 74 22 20 |parison || "not" |
|00005400| 6e 6f 74 5f 74 65 73 74 | 0d 6c 61 6d 62 64 61 5f |not_test|.lambda_|
|00005410| 66 6f 72 6d 3a 09 22 6c | 61 6d 62 64 61 22 20 5b |form:."l|ambda" [|
|00005420| 70 61 72 61 6d 65 74 65 | 72 5f 6c 69 73 74 5d 3a |paramete|r_list]:|
|00005430| 20 63 6f 6e 64 69 74 69 | 6f 6e 0d 5c 65 6e 64 7b | conditi|on.\end{|
|00005440| 76 65 72 62 61 74 69 6d | 7d 0d 0d 49 6e 20 74 68 |verbatim|}..In th|
|00005450| 65 20 63 6f 6e 74 65 78 | 74 20 6f 66 20 42 6f 6f |e contex|t of Boo|
|00005460| 6c 65 61 6e 20 6f 70 65 | 72 61 74 69 6f 6e 73 2c |lean ope|rations,|
|00005470| 20 61 6e 64 20 61 6c 73 | 6f 20 77 68 65 6e 20 63 | and als|o when c|
|00005480| 6f 6e 64 69 74 69 6f 6e | 73 20 61 72 65 0d 75 73 |ondition|s are.us|
|00005490| 65 64 20 62 79 20 63 6f | 6e 74 72 6f 6c 20 66 6c |ed by co|ntrol fl|
|000054a0| 6f 77 20 73 74 61 74 65 | 6d 65 6e 74 73 2c 20 74 |ow state|ments, t|
|000054b0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 76 61 6c |he follo|wing val|
|000054c0| 75 65 73 20 61 72 65 20 | 69 6e 74 65 72 70 72 65 |ues are |interpre|
|000054d0| 74 65 64 0d 61 73 20 66 | 61 6c 73 65 3a 20 5c 76 |ted.as f|alse: \v|
|000054e0| 65 72 62 40 4e 6f 6e 65 | 40 2c 20 6e 75 6d 65 72 |erb@None|@, numer|
|000054f0| 69 63 20 7a 65 72 6f 20 | 6f 66 20 61 6c 6c 20 74 |ic zero |of all t|
|00005500| 79 70 65 73 2c 20 65 6d | 70 74 79 20 73 65 71 75 |ypes, em|pty sequ|
|00005510| 65 6e 63 65 73 0d 28 73 | 74 72 69 6e 67 73 2c 20 |ences.(s|trings, |
|00005520| 74 75 70 6c 65 73 20 61 | 6e 64 20 6c 69 73 74 73 |tuples a|nd lists|
|00005530| 29 2c 20 61 6e 64 20 65 | 6d 70 74 79 20 6d 61 70 |), and e|mpty map|
|00005540| 70 69 6e 67 73 20 28 64 | 69 63 74 69 6f 6e 61 72 |pings (d|ictionar|
|00005550| 69 65 73 29 2e 20 20 41 | 6c 6c 0d 6f 74 68 65 72 |ies). A|ll.other|
|00005560| 20 76 61 6c 75 65 73 20 | 61 72 65 20 69 6e 74 65 | values |are inte|
|00005570| 72 70 72 65 74 65 64 20 | 61 73 20 74 72 75 65 2e |rpreted |as true.|
|00005580| 0d 0d 54 68 65 20 6f 70 | 65 72 61 74 6f 72 20 5c |..The op|erator \|
|00005590| 76 65 72 62 40 6e 6f 74 | 40 20 79 69 65 6c 64 73 |verb@not|@ yields|
|000055a0| 20 31 20 69 66 20 69 74 | 73 20 61 72 67 75 6d 65 | 1 if it|s argume|
|000055b0| 6e 74 20 69 73 20 66 61 | 6c 73 65 2c 20 30 20 6f |nt is fa|lse, 0 o|
|000055c0| 74 68 65 72 77 69 73 65 | 2e 0d 5c 6f 70 69 6e 64 |therwise|..\opind|
|000055d0| 65 78 7b 6e 6f 74 7d 0d | 0d 54 68 65 20 63 6f 6e |ex{not}.|.The con|
|000055e0| 64 69 74 69 6f 6e 20 24 | 78 20 7e 5c 76 65 72 62 |dition $|x ~\verb|
|000055f0| 40 61 6e 64 40 7e 20 79 | 24 20 66 69 72 73 74 20 |@and@~ y|$ first |
|00005600| 65 76 61 6c 75 61 74 65 | 73 20 24 78 24 3b 20 69 |evaluate|s $x$; i|
|00005610| 66 20 24 78 24 20 69 73 | 20 66 61 6c 73 65 2c 0d |f $x$ is| false,.|
|00005620| 69 74 73 20 76 61 6c 75 | 65 20 69 73 20 72 65 74 |its valu|e is ret|
|00005630| 75 72 6e 65 64 3b 20 6f | 74 68 65 72 77 69 73 65 |urned; o|therwise|
|00005640| 2c 20 24 79 24 20 69 73 | 20 65 76 61 6c 75 61 74 |, $y$ is| evaluat|
|00005650| 65 64 20 61 6e 64 20 74 | 68 65 20 72 65 73 75 6c |ed and t|he resul|
|00005660| 74 69 6e 67 0d 76 61 6c | 75 65 20 69 73 20 72 65 |ting.val|ue is re|
|00005670| 74 75 72 6e 65 64 2e 0d | 5c 6f 70 69 6e 64 65 78 |turned..|\opindex|
|00005680| 7b 61 6e 64 7d 0d 0d 54 | 68 65 20 63 6f 6e 64 69 |{and}..T|he condi|
|00005690| 74 69 6f 6e 20 24 78 20 | 7e 5c 76 65 72 62 40 6f |tion $x |~\verb@o|
|000056a0| 72 40 7e 20 79 24 20 66 | 69 72 73 74 20 65 76 61 |r@~ y$ f|irst eva|
|000056b0| 6c 75 61 74 65 73 20 24 | 78 24 3b 20 69 66 20 24 |luates $|x$; if $|
|000056c0| 78 24 20 69 73 20 74 72 | 75 65 2c 0d 69 74 73 20 |x$ is tr|ue,.its |
|000056d0| 76 61 6c 75 65 20 69 73 | 20 72 65 74 75 72 6e 65 |value is| returne|
|000056e0| 64 3b 20 6f 74 68 65 72 | 77 69 73 65 2c 20 24 79 |d; other|wise, $y|
|000056f0| 24 20 69 73 20 65 76 61 | 6c 75 61 74 65 64 20 61 |$ is eva|luated a|
|00005700| 6e 64 20 74 68 65 20 72 | 65 73 75 6c 74 69 6e 67 |nd the r|esulting|
|00005710| 0d 76 61 6c 75 65 20 69 | 73 20 72 65 74 75 72 6e |.value i|s return|
|00005720| 65 64 2e 0d 5c 6f 70 69 | 6e 64 65 78 7b 6f 72 7d |ed..\opi|ndex{or}|
|00005730| 0d 0d 28 4e 6f 74 65 20 | 74 68 61 74 20 5c 76 65 |..(Note |that \ve|
|00005740| 72 62 40 61 6e 64 40 20 | 61 6e 64 20 5c 76 65 72 |rb@and@ |and \ver|
|00005750| 62 40 6f 72 40 20 64 6f | 20 6e 6f 74 20 72 65 73 |b@or@ do| not res|
|00005760| 74 72 69 63 74 20 74 68 | 65 20 76 61 6c 75 65 20 |trict th|e value |
|00005770| 61 6e 64 20 74 79 70 65 | 0d 74 68 65 79 20 72 65 |and type|.they re|
|00005780| 74 75 72 6e 20 74 6f 20 | 30 20 61 6e 64 20 31 2c |turn to |0 and 1,|
|00005790| 20 62 75 74 20 72 61 74 | 68 65 72 20 72 65 74 75 | but rat|her retu|
|000057a0| 72 6e 20 74 68 65 20 6c | 61 73 74 20 65 76 61 6c |rn the l|ast eval|
|000057b0| 75 61 74 65 64 20 61 72 | 67 75 6d 65 6e 74 2e 0d |uated ar|gument..|
|000057c0| 54 68 69 73 20 69 73 20 | 73 6f 6d 65 74 69 6d 65 |This is |sometime|
|000057d0| 73 20 75 73 65 66 75 6c | 2c 20 65 2e 67 2e 20 69 |s useful|, e.g. i|
|000057e0| 66 20 5c 76 65 72 62 40 | 73 40 20 69 73 20 61 20 |f \verb@|s@ is a |
|000057f0| 73 74 72 69 6e 67 20 74 | 68 61 74 20 73 68 6f 75 |string t|hat shou|
|00005800| 6c 64 20 62 65 0d 72 65 | 70 6c 61 63 65 64 20 62 |ld be.re|placed b|
|00005810| 79 20 61 20 64 65 66 61 | 75 6c 74 20 76 61 6c 75 |y a defa|ult valu|
|00005820| 65 20 69 66 20 69 74 20 | 69 73 20 65 6d 70 74 79 |e if it |is empty|
|00005830| 2c 20 74 68 65 20 65 78 | 70 72 65 73 73 69 6f 6e |, the ex|pression|
|00005840| 0d 5c 76 65 72 62 40 73 | 20 6f 72 20 27 66 6f 6f |.\verb@s| or 'foo|
|00005850| 27 40 20 79 69 65 6c 64 | 73 20 74 68 65 20 64 65 |'@ yield|s the de|
|00005860| 73 69 72 65 64 20 76 61 | 6c 75 65 2e 20 20 42 65 |sired va|lue. Be|
|00005870| 63 61 75 73 65 20 5c 76 | 65 72 62 40 6e 6f 74 40 |cause \v|erb@not@|
|00005880| 20 68 61 73 20 74 6f 0d | 69 6e 76 65 6e 74 20 61 | has to.|invent a|
|00005890| 20 76 61 6c 75 65 20 61 | 6e 79 77 61 79 2c 20 69 | value a|nyway, i|
|000058a0| 74 20 64 6f 65 73 20 6e | 6f 74 20 62 6f 74 68 65 |t does n|ot bothe|
|000058b0| 72 20 74 6f 20 72 65 74 | 75 72 6e 20 61 20 76 61 |r to ret|urn a va|
|000058c0| 6c 75 65 20 6f 66 20 74 | 68 65 0d 73 61 6d 65 20 |lue of t|he.same |
|000058d0| 74 79 70 65 20 61 73 20 | 69 74 73 20 61 72 67 75 |type as |its argu|
|000058e0| 6d 65 6e 74 2c 20 73 6f | 20 65 2e 67 2e 20 5c 76 |ment, so| e.g. \v|
|000058f0| 65 72 62 40 6e 6f 74 20 | 27 66 6f 6f 27 40 20 79 |erb@not |'foo'@ y|
|00005900| 69 65 6c 64 73 20 5c 76 | 65 72 62 40 30 40 2c 0d |ields \v|erb@0@,.|
|00005910| 6e 6f 74 20 5c 76 65 72 | 62 40 27 27 40 2e 29 0d |not \ver|b@''@.).|
|00005920| 0d 4c 61 6d 62 64 61 20 | 66 6f 72 6d 73 20 28 6c |.Lambda |forms (l|
|00005930| 61 6d 62 64 61 20 65 78 | 70 72 65 73 73 69 6f 6e |ambda ex|pression|
|00005940| 73 29 20 68 61 76 65 20 | 74 68 65 20 73 61 6d 65 |s) have |the same|
|00005950| 20 73 79 6e 74 61 63 74 | 69 63 20 70 6f 73 69 74 | syntact|ic posit|
|00005960| 69 6f 6e 20 61 73 0d 63 | 6f 6e 64 69 74 69 6f 6e |ion as.c|ondition|
|00005970| 73 2e 20 20 54 68 65 79 | 20 61 72 65 20 61 20 73 |s. They| are a s|
|00005980| 68 6f 72 74 68 61 6e 64 | 20 74 6f 20 63 72 65 61 |horthand| to crea|
|00005990| 74 65 20 61 6e 6f 6e 79 | 6d 6f 75 73 20 66 75 6e |te anony|mous fun|
|000059a0| 63 74 69 6f 6e 73 3b 20 | 74 68 65 0d 65 78 70 72 |ctions; |the.expr|
|000059b0| 65 73 73 69 6f 6e 20 7b | 5c 65 6d 20 7b 5c 74 74 |ession {|\em {\tt|
|000059c0| 20 6c 61 6d 62 64 61 7d | 20 61 72 67 75 6d 65 6e | lambda}| argumen|
|000059d0| 74 73 7b 5c 74 74 20 3a | 7d 20 63 6f 6e 64 69 74 |ts{\tt :|} condit|
|000059e0| 69 6f 6e 7d 0d 79 69 65 | 6c 64 73 20 61 20 66 75 |ion}.yie|lds a fu|
|000059f0| 6e 63 74 69 6f 6e 20 6f | 62 6a 65 63 74 20 74 68 |nction o|bject th|
|00005a00| 61 74 20 62 65 68 61 76 | 65 73 20 76 69 72 74 75 |at behav|es virtu|
|00005a10| 61 6c 6c 79 20 69 64 65 | 6e 74 69 63 61 6c 20 74 |ally ide|ntical t|
|00005a20| 6f 20 6f 6e 65 0d 64 65 | 66 69 6e 65 64 20 77 69 |o one.de|fined wi|
|00005a30| 74 68 0d 7b 5c 65 6d 20 | 7b 5c 74 74 20 64 65 66 |th.{\em |{\tt def|
|00005a40| 7d 20 6e 61 6d 65 20 7b | 5c 74 74 20 28 7d 61 72 |} name {|\tt (}ar|
|00005a50| 67 75 6d 65 6e 74 73 7b | 5c 74 74 20 29 3a 20 72 |guments{|\tt ): r|
|00005a60| 65 74 75 72 6e 7d 20 63 | 6f 6e 64 69 74 69 6f 6e |eturn} c|ondition|
|00005a70| 7d 2e 0d 53 65 65 20 73 | 65 63 74 69 6f 6e 20 5c |}..See s|ection \|
|00005a80| 72 65 66 7b 66 75 6e 63 | 74 69 6f 6e 7d 20 66 6f |ref{func|tion} fo|
|00005a90| 72 20 74 68 65 20 73 79 | 6e 74 61 78 20 6f 66 0d |r the sy|ntax of.|
|00005aa0| 70 61 72 61 6d 65 74 65 | 72 20 6c 69 73 74 73 2e |paramete|r lists.|
|00005ab0| 20 20 4e 6f 74 65 20 74 | 68 61 74 20 66 75 6e 63 | Note t|hat func|
|00005ac0| 74 69 6f 6e 73 20 63 72 | 65 61 74 65 64 20 77 69 |tions cr|eated wi|
|00005ad0| 74 68 20 6c 61 6d 62 64 | 61 20 66 6f 72 6d 73 20 |th lambd|a forms |
|00005ae0| 63 61 6e 6e 6f 74 0d 63 | 6f 6e 74 61 69 6e 20 73 |cannot.c|ontain s|
|00005af0| 74 61 74 65 6d 65 6e 74 | 73 2e 0d 5c 6c 61 62 65 |tatement|s..\labe|
|00005b00| 6c 7b 6c 61 6d 62 64 61 | 7d 0d 5c 69 6e 64 65 78 |l{lambda|}.\index|
|00005b10| 69 69 7b 6c 61 6d 62 64 | 61 7d 7b 65 78 70 72 65 |ii{lambd|a}{expre|
|00005b20| 73 73 69 6f 6e 7d 0d 5c | 69 6e 64 65 78 69 69 7b |ssion}.\|indexii{|
|00005b30| 6c 61 6d 62 64 61 7d 7b | 66 6f 72 6d 7d 0d 5c 69 |lambda}{|form}.\i|
|00005b40| 6e 64 65 78 69 69 7b 61 | 6e 6f 6e 6d 79 6d 6f 75 |ndexii{a|nonmymou|
|00005b50| 73 7d 7b 66 75 6e 63 74 | 69 6f 6e 7d 0d 0d 5c 73 |s}{funct|ion}..\s|
|00005b60| 65 63 74 69 6f 6e 7b 45 | 78 70 72 65 73 73 69 6f |ection{E|xpressio|
|00005b70| 6e 20 6c 69 73 74 73 20 | 61 6e 64 20 63 6f 6e 64 |n lists |and cond|
|00005b80| 69 74 69 6f 6e 20 6c 69 | 73 74 73 7d 0d 5c 69 6e |ition li|sts}.\in|
|00005b90| 64 65 78 69 69 7b 65 78 | 70 72 65 73 73 69 6f 6e |dexii{ex|pression|
|00005ba0| 7d 7b 6c 69 73 74 7d 0d | 5c 69 6e 64 65 78 69 69 |}{list}.|\indexii|
|00005bb0| 7b 63 6f 6e 64 69 74 69 | 6f 6e 7d 7b 6c 69 73 74 |{conditi|on}{list|
|00005bc0| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |}..\begi|n{verbat|
|00005bd0| 69 6d 7d 0d 65 78 70 72 | 5f 6c 69 73 74 3a 20 20 |im}.expr|_list: |
|00005be0| 20 20 20 20 6f 72 5f 65 | 78 70 72 20 28 22 2c 22 | or_e|xpr (","|
|00005bf0| 20 6f 72 5f 65 78 70 72 | 29 2a 20 5b 22 2c 22 5d | or_expr|)* [","]|
|00005c00| 0d 63 6f 6e 64 5f 6c 69 | 73 74 3a 20 20 20 20 20 |.cond_li|st: |
|00005c10| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 28 22 2c 22 20 | conditi|on ("," |
|00005c20| 63 6f 6e 64 69 74 69 6f | 6e 29 2a 20 5b 22 2c 22 |conditio|n)* [","|
|00005c30| 5d 0d 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |].\end{v|erbatim}|
|00005c40| 0d 0d 54 68 65 20 6f 6e | 6c 79 20 64 69 66 66 65 |..The on|ly diffe|
|00005c50| 72 65 6e 63 65 20 62 65 | 74 77 65 65 6e 20 65 78 |rence be|tween ex|
|00005c60| 70 72 65 73 73 69 6f 6e | 20 6c 69 73 74 73 20 61 |pression| lists a|
|00005c70| 6e 64 20 63 6f 6e 64 69 | 74 69 6f 6e 20 6c 69 73 |nd condi|tion lis|
|00005c80| 74 73 20 69 73 0d 74 68 | 65 20 6c 6f 77 65 73 74 |ts is.th|e lowest|
|00005c90| 20 70 72 69 6f 72 69 74 | 79 20 6f 66 20 6f 70 65 | priorit|y of ope|
|00005ca0| 72 61 74 6f 72 73 20 74 | 68 61 74 20 63 61 6e 20 |rators t|hat can |
|00005cb0| 62 65 20 75 73 65 64 20 | 69 6e 20 74 68 65 6d 20 |be used |in them |
|00005cc0| 77 69 74 68 6f 75 74 0d | 62 65 69 6e 67 20 65 6e |without.|being en|
|00005cd0| 63 6c 6f 73 65 64 20 69 | 6e 20 70 61 72 65 6e 74 |closed i|n parent|
|00005ce0| 68 65 73 65 73 3b 20 63 | 6f 6e 64 69 74 69 6f 6e |heses; c|ondition|
|00005cf0| 20 6c 69 73 74 73 20 61 | 6c 6c 6f 77 20 61 6c 6c | lists a|llow all|
|00005d00| 20 6f 70 65 72 61 74 6f | 72 73 2c 0d 77 68 69 6c | operato|rs,.whil|
|00005d10| 65 20 65 78 70 72 65 73 | 73 69 6f 6e 20 6c 69 73 |e expres|sion lis|
|00005d20| 74 73 20 64 6f 6e 27 74 | 20 61 6c 6c 6f 77 20 63 |ts don't| allow c|
|00005d30| 6f 6d 70 61 72 69 73 6f | 6e 73 20 61 6e 64 20 42 |ompariso|ns and B|
|00005d40| 6f 6f 6c 65 61 6e 20 6f | 70 65 72 61 74 6f 72 73 |oolean o|perators|
|00005d50| 0d 28 74 68 65 79 20 64 | 6f 20 61 6c 6c 6f 77 20 |.(they d|o allow |
|00005d60| 62 69 74 77 69 73 65 20 | 61 6e 64 20 73 68 69 66 |bitwise |and shif|
|00005d70| 74 20 6f 70 65 72 61 74 | 6f 72 73 20 74 68 6f 75 |t operat|ors thou|
|00005d80| 67 68 29 2e 0d 0d 45 78 | 70 72 65 73 73 69 6f 6e |gh)...Ex|pression|
|00005d90| 20 6c 69 73 74 73 20 61 | 72 65 20 75 73 65 64 20 | lists a|re used |
|00005da0| 69 6e 20 65 78 70 72 65 | 73 73 69 6f 6e 20 73 74 |in expre|ssion st|
|00005db0| 61 74 65 6d 65 6e 74 73 | 20 61 6e 64 20 61 73 73 |atements| and ass|
|00005dc0| 69 67 6e 6d 65 6e 74 73 | 3b 0d 63 6f 6e 64 69 74 |ignments|;.condit|
|00005dd0| 69 6f 6e 20 6c 69 73 74 | 73 20 61 72 65 20 75 73 |ion list|s are us|
|00005de0| 65 64 20 65 76 65 72 79 | 77 68 65 72 65 20 65 6c |ed every|where el|
|00005df0| 73 65 20 77 68 65 72 65 | 20 61 20 6c 69 73 74 20 |se where| a list |
|00005e00| 6f 66 0d 63 6f 6d 6d 61 | 2d 73 65 70 61 72 61 74 |of.comma|-separat|
|00005e10| 65 64 20 76 61 6c 75 65 | 73 20 69 73 20 72 65 71 |ed value|s is req|
|00005e20| 75 69 72 65 64 2e 0d 0d | 41 6e 20 65 78 70 72 65 |uired...|An expre|
|00005e30| 73 73 69 6f 6e 20 28 63 | 6f 6e 64 69 74 69 6f 6e |ssion (c|ondition|
|00005e40| 29 20 6c 69 73 74 20 63 | 6f 6e 74 61 69 6e 69 6e |) list c|ontainin|
|00005e50| 67 20 61 74 20 6c 65 61 | 73 74 20 6f 6e 65 20 63 |g at lea|st one c|
|00005e60| 6f 6d 6d 61 20 79 69 65 | 6c 64 73 20 61 0d 74 75 |omma yie|lds a.tu|
|00005e70| 70 6c 65 2e 20 20 54 68 | 65 20 6c 65 6e 67 74 68 |ple. Th|e length|
|00005e80| 20 6f 66 20 74 68 65 20 | 74 75 70 6c 65 20 69 73 | of the |tuple is|
|00005e90| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 65 | the num|ber of e|
|00005ea0| 78 70 72 65 73 73 69 6f | 6e 73 0d 28 63 6f 6e 64 |xpressio|ns.(cond|
|00005eb0| 69 74 69 6f 6e 73 29 20 | 69 6e 20 74 68 65 20 6c |itions) |in the l|
|00005ec0| 69 73 74 2e 20 20 54 68 | 65 20 65 78 70 72 65 73 |ist. Th|e expres|
|00005ed0| 73 69 6f 6e 73 20 28 63 | 6f 6e 64 69 74 69 6f 6e |sions (c|ondition|
|00005ee0| 73 29 20 61 72 65 20 65 | 76 61 6c 75 61 74 65 64 |s) are e|valuated|
|00005ef0| 0d 66 72 6f 6d 20 6c 65 | 66 74 20 74 6f 20 72 69 |.from le|ft to ri|
|00005f00| 67 68 74 2e 20 20 28 43 | 6f 6e 64 69 74 69 6f 6e |ght. (C|ondition|
|00005f10| 20 6c 69 73 74 73 20 61 | 72 65 20 75 73 65 64 20 | lists a|re used |
|00005f20| 73 79 6e 74 61 63 74 69 | 63 61 6c 6c 79 20 69 73 |syntacti|cally is|
|00005f30| 20 61 20 66 65 77 0d 70 | 6c 61 63 65 73 20 77 68 | a few.p|laces wh|
|00005f40| 65 72 65 20 6e 6f 20 74 | 75 70 6c 65 20 69 73 20 |ere no t|uple is |
|00005f50| 63 6f 6e 73 74 72 75 63 | 74 65 64 20 62 75 74 20 |construc|ted but |
|00005f60| 61 20 6c 69 73 74 20 6f | 66 20 76 61 6c 75 65 73 |a list o|f values|
|00005f70| 20 69 73 20 6e 65 65 64 | 65 64 0d 6e 65 76 65 72 | is need|ed.never|
|00005f80| 74 68 65 6c 65 73 73 2e | 29 0d 5c 6f 62 69 6e 64 |theless.|).\obind|
|00005f90| 65 78 7b 74 75 70 6c 65 | 7d 0d 0d 54 68 65 20 74 |ex{tuple|}..The t|
|00005fa0| 72 61 69 6c 69 6e 67 20 | 63 6f 6d 6d 61 20 69 73 |railing |comma is|
|00005fb0| 20 72 65 71 75 69 72 65 | 64 20 6f 6e 6c 79 20 74 | require|d only t|
|00005fc0| 6f 20 63 72 65 61 74 65 | 20 61 20 73 69 6e 67 6c |o create| a singl|
|00005fd0| 65 20 74 75 70 6c 65 20 | 28 61 2e 6b 2e 61 2e 20 |e tuple |(a.k.a. |
|00005fe0| 61 0d 7b 5c 65 6d 20 73 | 69 6e 67 6c 65 74 6f 6e |a.{\em s|ingleton|
|00005ff0| 7d 29 3b 20 69 74 20 69 | 73 20 6f 70 74 69 6f 6e |}); it i|s option|
|00006000| 61 6c 20 69 6e 20 61 6c | 6c 20 6f 74 68 65 72 20 |al in al|l other |
|00006010| 63 61 73 65 73 2e 20 20 | 41 20 73 69 6e 67 6c 65 |cases. |A single|
|00006020| 0d 65 78 70 72 65 73 73 | 69 6f 6e 20 28 63 6f 6e |.express|ion (con|
|00006030| 64 69 74 69 6f 6e 29 20 | 77 69 74 68 6f 75 74 20 |dition) |without |
|00006040| 61 20 74 72 61 69 6c 69 | 6e 67 20 63 6f 6d 6d 61 |a traili|ng comma|
|00006050| 20 64 6f 65 73 6e 27 74 | 20 63 72 65 61 74 65 20 | doesn't| create |
|00006060| 61 0d 74 75 70 6c 65 2c | 20 62 75 74 20 72 61 74 |a.tuple,| but rat|
|00006070| 68 65 72 20 79 69 65 6c | 64 73 20 74 68 65 20 76 |her yiel|ds the v|
|00006080| 61 6c 75 65 20 6f 66 20 | 74 68 61 74 20 65 78 70 |alue of |that exp|
|00006090| 72 65 73 73 69 6f 6e 20 | 28 63 6f 6e 64 69 74 69 |ression |(conditi|
|000060a0| 6f 6e 29 2e 0d 5c 69 6e | 64 65 78 69 69 7b 74 72 |on)..\in|dexii{tr|
|000060b0| 61 69 6c 69 6e 67 7d 7b | 63 6f 6d 6d 61 7d 0d 0d |ailing}{|comma}..|
|000060c0| 28 54 6f 20 63 72 65 61 | 74 65 20 61 6e 20 65 6d |(To crea|te an em|
|000060d0| 70 74 79 20 74 75 70 6c | 65 2c 20 75 73 65 20 61 |pty tupl|e, use a|
|000060e0| 6e 20 65 6d 70 74 79 20 | 70 61 69 72 20 6f 66 20 |n empty |pair of |
|000060f0| 70 61 72 65 6e 74 68 65 | 73 65 73 3a 0d 5c 76 65 |parenthe|ses:.\ve|
|00006100| 72 62 40 28 29 40 2e 29 | 0d |rb@()@.)|. |
+--------+-------------------------+-------------------------+--------+--------+