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: 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
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 42 75 69 6c 74 2d 69 |\section|{Built-i|
|00000010| 6e 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |n Module| \sectco|
|00000020| 64 65 7b 61 72 72 61 79 | 7d 7d 0a 5c 62 69 6d 6f |de{array|}}.\bimo|
|00000030| 64 69 6e 64 65 78 7b 61 | 72 72 61 79 7d 0a 5c 69 |dindex{a|rray}.\i|
|00000040| 6e 64 65 78 7b 61 72 72 | 61 79 73 7d 0a 0a 54 68 |ndex{arr|ays}..Th|
|00000050| 69 73 20 6d 6f 64 75 6c | 65 20 64 65 66 69 6e 65 |is modul|e define|
|00000060| 73 20 61 20 6e 65 77 20 | 6f 62 6a 65 63 74 20 74 |s a new |object t|
|00000070| 79 70 65 20 77 68 69 63 | 68 20 63 61 6e 20 65 66 |ype whic|h can ef|
|00000080| 66 69 63 69 65 6e 74 6c | 79 20 72 65 70 72 65 73 |ficientl|y repres|
|00000090| 65 6e 74 0a 61 6e 20 61 | 72 72 61 79 20 6f 66 20 |ent.an a|rray of |
|000000a0| 62 61 73 69 63 20 76 61 | 6c 75 65 73 3a 20 63 68 |basic va|lues: ch|
|000000b0| 61 72 61 63 74 65 72 73 | 2c 20 69 6e 74 65 67 65 |aracters|, intege|
|000000c0| 72 73 2c 20 66 6c 6f 61 | 74 69 6e 67 20 70 6f 69 |rs, floa|ting poi|
|000000d0| 6e 74 0a 6e 75 6d 62 65 | 72 73 2e 20 20 41 72 72 |nt.numbe|rs. Arr|
|000000e0| 61 79 73 20 61 72 65 20 | 73 65 71 75 65 6e 63 65 |ays are |sequence|
|000000f0| 20 74 79 70 65 73 20 61 | 6e 64 20 62 65 68 61 76 | types a|nd behav|
|00000100| 65 20 76 65 72 79 20 6d | 75 63 68 20 6c 69 6b 65 |e very m|uch like|
|00000110| 20 6c 69 73 74 73 2c 0a | 65 78 63 65 70 74 20 74 | lists,.|except t|
|00000120| 68 61 74 20 74 68 65 20 | 74 79 70 65 20 6f 66 20 |hat the |type of |
|00000130| 6f 62 6a 65 63 74 73 20 | 73 74 6f 72 65 64 20 69 |objects |stored i|
|00000140| 6e 20 74 68 65 6d 20 69 | 73 20 63 6f 6e 73 74 72 |n them i|s constr|
|00000150| 61 69 6e 65 64 2e 20 20 | 54 68 65 0a 74 79 70 65 |ained. |The.type|
|00000160| 20 69 73 20 73 70 65 63 | 69 66 69 65 64 20 61 74 | is spec|ified at|
|00000170| 20 6f 62 6a 65 63 74 20 | 63 72 65 61 74 69 6f 6e | object |creation|
|00000180| 20 74 69 6d 65 20 62 79 | 20 75 73 69 6e 67 20 61 | time by| using a|
|00000190| 20 5c 64 66 6e 7b 74 79 | 70 65 20 63 6f 64 65 7d | \dfn{ty|pe code}|
|000001a0| 2c 0a 77 68 69 63 68 20 | 69 73 20 61 20 73 69 6e |,.which |is a sin|
|000001b0| 67 6c 65 20 63 68 61 72 | 61 63 74 65 72 2e 20 20 |gle char|acter. |
|000001c0| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 74 79 |The foll|owing ty|
|000001d0| 70 65 20 63 6f 64 65 73 | 20 61 72 65 20 64 65 66 |pe codes| are def|
|000001e0| 69 6e 65 64 3a 0a 0a 5c | 62 65 67 69 6e 7b 74 61 |ined:..\|begin{ta|
|000001f0| 62 6c 65 69 69 69 7d 7b | 7c 63 7c 63 7c 63 7c 7d |bleiii}{||c|c|c|}|
|00000200| 7b 63 6f 64 65 7d 7b 54 | 79 70 65 63 6f 64 65 7d |{code}{T|ypecode}|
|00000210| 7b 54 79 70 65 7d 7b 4d | 69 6e 69 6d 61 6c 20 73 |{Type}{M|inimal s|
|00000220| 69 7a 65 20 69 6e 20 62 | 79 74 65 73 7d 0a 5c 6c |ize in b|ytes}.\l|
|00000230| 69 6e 65 69 69 69 7b 27 | 63 27 7d 7b 63 68 61 72 |ineiii{'|c'}{char|
|00000240| 61 63 74 65 72 7d 7b 31 | 7d 0a 5c 6c 69 6e 65 69 |acter}{1|}.\linei|
|00000250| 69 69 7b 27 62 27 7d 7b | 73 69 67 6e 65 64 20 69 |ii{'b'}{|signed i|
|00000260| 6e 74 65 67 65 72 7d 7b | 31 7d 0a 5c 6c 69 6e 65 |nteger}{|1}.\line|
|00000270| 69 69 69 7b 27 68 27 7d | 7b 73 69 67 6e 65 64 20 |iii{'h'}|{signed |
|00000280| 69 6e 74 65 67 65 72 7d | 7b 32 7d 0a 5c 6c 69 6e |integer}|{2}.\lin|
|00000290| 65 69 69 69 7b 27 69 27 | 7d 7b 73 69 67 6e 65 64 |eiii{'i'|}{signed|
|000002a0| 20 69 6e 74 65 67 65 72 | 7d 7b 32 7d 0a 5c 6c 69 | integer|}{2}.\li|
|000002b0| 6e 65 69 69 69 7b 27 6c | 27 7d 7b 73 69 67 6e 65 |neiii{'l|'}{signe|
|000002c0| 64 20 69 6e 74 65 67 65 | 72 7d 7b 34 7d 0a 5c 6c |d intege|r}{4}.\l|
|000002d0| 69 6e 65 69 69 69 7b 27 | 66 27 7d 7b 66 6c 6f 61 |ineiii{'|f'}{floa|
|000002e0| 74 69 6e 67 20 70 6f 69 | 6e 74 7d 7b 34 7d 0a 5c |ting poi|nt}{4}.\|
|000002f0| 6c 69 6e 65 69 69 69 7b | 27 64 27 7d 7b 66 6c 6f |lineiii{|'d'}{flo|
|00000300| 61 74 69 6e 67 20 70 6f | 69 6e 74 7d 7b 38 7d 0a |ating po|int}{8}.|
|00000310| 5c 65 6e 64 7b 74 61 62 | 6c 65 69 69 69 7d 0a 0a |\end{tab|leiii}..|
|00000320| 54 68 65 20 61 63 74 75 | 61 6c 20 72 65 70 72 65 |The actu|al repre|
|00000330| 73 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 76 61 6c |sentatio|n of val|
|00000340| 75 65 73 20 69 73 20 64 | 65 74 65 72 6d 69 6e 65 |ues is d|etermine|
|00000350| 64 20 62 79 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |d by the| machine|
|00000360| 0a 61 72 63 68 69 74 65 | 63 74 75 72 65 20 28 73 |.archite|cture (s|
|00000370| 74 72 69 63 74 6c 79 20 | 73 70 65 61 6b 69 6e 67 |trictly |speaking|
|00000380| 2c 20 62 79 20 74 68 65 | 20 43 20 69 6d 70 6c 65 |, by the| C imple|
|00000390| 6d 65 6e 74 61 74 69 6f | 6e 29 2e 20 20 54 68 65 |mentatio|n). The|
|000003a0| 20 61 63 74 75 61 6c 0a | 73 69 7a 65 20 63 61 6e | actual.|size can|
|000003b0| 20 62 65 20 61 63 63 65 | 73 73 65 64 20 74 68 72 | be acce|ssed thr|
|000003c0| 6f 75 67 68 20 74 68 65 | 20 5c 76 61 72 7b 69 74 |ough the| \var{it|
|000003d0| 65 6d 73 69 7a 65 7d 20 | 61 74 74 72 69 62 75 74 |emsize} |attribut|
|000003e0| 65 2e 0a 0a 53 65 65 20 | 61 6c 73 6f 20 62 75 69 |e...See |also bui|
|000003f0| 6c 74 2d 69 6e 20 6d 6f | 64 75 6c 65 20 5c 63 6f |lt-in mo|dule \co|
|00000400| 64 65 7b 73 74 72 75 63 | 74 7d 2e 0a 5c 62 69 6d |de{struc|t}..\bim|
|00000410| 6f 64 69 6e 64 65 78 7b | 73 74 72 75 63 74 7d 0a |odindex{|struct}.|
|00000420| 0a 54 68 65 20 6d 6f 64 | 75 6c 65 20 64 65 66 69 |.The mod|ule defi|
|00000430| 6e 65 73 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |nes the |followin|
|00000440| 67 20 66 75 6e 63 74 69 | 6f 6e 3a 0a 0a 5c 72 65 |g functi|on:..\re|
|00000450| 6e 65 77 63 6f 6d 6d 61 | 6e 64 7b 5c 69 6e 64 65 |newcomma|nd{\inde|
|00000460| 78 73 75 62 69 74 65 6d | 7d 7b 28 69 6e 20 6d 6f |xsubitem|}{(in mo|
|00000470| 64 75 6c 65 20 61 72 72 | 61 79 29 7d 0a 0a 5c 62 |dule arr|ay)}..\b|
|00000480| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 61 |egin{fun|cdesc}{a|
|00000490| 72 72 61 79 7d 7b 74 79 | 70 65 63 6f 64 65 5c 6f |rray}{ty|pecode\o|
|000004a0| 70 74 69 6f 6e 61 6c 7b | 5c 2c 20 69 6e 69 74 69 |ptional{|\, initi|
|000004b0| 61 6c 69 7a 65 72 7d 7d | 0a 52 65 74 75 72 6e 20 |alizer}}|.Return |
|000004c0| 61 20 6e 65 77 20 61 72 | 72 61 79 20 77 68 6f 73 |a new ar|ray whos|
|000004d0| 65 20 69 74 65 6d 73 20 | 61 72 65 20 72 65 73 74 |e items |are rest|
|000004e0| 72 69 63 74 65 64 20 62 | 79 20 5c 76 61 72 7b 74 |ricted b|y \var{t|
|000004f0| 79 70 65 63 6f 64 65 7d | 2c 20 61 6e 64 0a 69 6e |ypecode}|, and.in|
|00000500| 69 74 69 61 6c 69 7a 65 | 64 20 66 72 6f 6d 20 74 |itialize|d from t|
|00000510| 68 65 20 6f 70 74 69 6f | 6e 61 6c 20 5c 76 61 72 |he optio|nal \var|
|00000520| 7b 69 6e 69 74 69 61 6c | 69 7a 65 72 7d 20 76 61 |{initial|izer} va|
|00000530| 6c 75 65 2c 20 77 68 69 | 63 68 20 6d 75 73 74 20 |lue, whi|ch must |
|00000540| 62 65 20 61 0a 6c 69 73 | 74 20 6f 72 20 61 20 73 |be a.lis|t or a s|
|00000550| 74 72 69 6e 67 2e 20 20 | 54 68 65 20 6c 69 73 74 |tring. |The list|
|00000560| 20 6f 72 20 73 74 72 69 | 6e 67 20 69 73 20 70 61 | or stri|ng is pa|
|00000570| 73 73 65 64 20 74 6f 20 | 74 68 65 20 6e 65 77 20 |ssed to |the new |
|00000580| 61 72 72 61 79 27 73 0a | 5c 63 6f 64 65 7b 66 72 |array's.|\code{fr|
|00000590| 6f 6d 6c 69 73 74 28 29 | 7d 20 6f 72 20 5c 63 6f |omlist()|} or \co|
|000005a0| 64 65 7b 66 72 6f 6d 73 | 74 72 69 6e 67 28 29 7d |de{froms|tring()}|
|000005b0| 20 6d 65 74 68 6f 64 20 | 28 73 65 65 20 62 65 6c | method |(see bel|
|000005c0| 6f 77 29 20 74 6f 20 61 | 64 64 0a 69 6e 69 74 69 |ow) to a|dd.initi|
|000005d0| 61 6c 20 69 74 65 6d 73 | 20 74 6f 20 74 68 65 20 |al items| to the |
|000005e0| 61 72 72 61 79 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |array..\|end{func|
|000005f0| 64 65 73 63 7d 0a 0a 41 | 72 72 61 79 20 6f 62 6a |desc}..A|rray obj|
|00000600| 65 63 74 73 20 73 75 70 | 70 6f 72 74 20 74 68 65 |ects sup|port the|
|00000610| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 64 61 74 61 20 | followi|ng data |
|00000620| 69 74 65 6d 73 20 61 6e | 64 20 6d 65 74 68 6f 64 |items an|d method|
|00000630| 73 3a 0a 0a 5c 62 65 67 | 69 6e 7b 64 61 74 61 64 |s:..\beg|in{datad|
|00000640| 65 73 63 7d 7b 74 79 70 | 65 63 6f 64 65 7d 0a 54 |esc}{typ|ecode}.T|
|00000650| 68 65 20 74 79 70 65 63 | 6f 64 65 20 63 68 61 72 |he typec|ode char|
|00000660| 61 63 74 65 72 20 75 73 | 65 64 20 74 6f 20 63 72 |acter us|ed to cr|
|00000670| 65 61 74 65 20 74 68 65 | 20 61 72 72 61 79 2e 0a |eate the| array..|
|00000680| 5c 65 6e 64 7b 64 61 74 | 61 64 65 73 63 7d 0a 0a |\end{dat|adesc}..|
|00000690| 5c 62 65 67 69 6e 7b 64 | 61 74 61 64 65 73 63 7d |\begin{d|atadesc}|
|000006a0| 7b 69 74 65 6d 73 69 7a | 65 7d 0a 54 68 65 20 6c |{itemsiz|e}.The l|
|000006b0| 65 6e 67 74 68 20 69 6e | 20 62 79 74 65 73 20 6f |ength in| bytes o|
|000006c0| 66 20 6f 6e 65 20 61 72 | 72 61 79 20 69 74 65 6d |f one ar|ray item|
|000006d0| 20 69 6e 20 74 68 65 20 | 69 6e 74 65 72 6e 61 6c | in the |internal|
|000006e0| 20 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 2e | represe|ntation.|
|000006f0| 0a 5c 65 6e 64 7b 64 61 | 74 61 64 65 73 63 7d 0a |.\end{da|tadesc}.|
|00000700| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000710| 7d 7b 61 70 70 65 6e 64 | 7d 7b 78 7d 0a 41 70 70 |}{append|}{x}.App|
|00000720| 65 6e 64 20 61 20 6e 65 | 77 20 69 74 65 6d 20 77 |end a ne|w item w|
|00000730| 69 74 68 20 76 61 6c 75 | 65 20 5c 76 61 72 7b 78 |ith valu|e \var{x|
|00000740| 7d 20 74 6f 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |} to the| end of |
|00000750| 74 68 65 20 61 72 72 61 | 79 2e 0a 5c 65 6e 64 7b |the arra|y..\end{|
|00000760| 66 75 6e 63 64 65 73 63 | 7d 0a 0a 5c 62 65 67 69 |funcdesc|}..\begi|
|00000770| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 62 79 74 65 |n{funcde|sc}{byte|
|00000780| 73 77 61 70 7d 7b 78 7d | 0a 60 60 42 79 74 65 73 |swap}{x}|.``Bytes|
|00000790| 77 61 70 27 27 20 61 6c | 6c 20 69 74 65 6d 73 20 |wap'' al|l items |
|000007a0| 6f 66 20 74 68 65 20 61 | 72 72 61 79 2e 20 20 54 |of the a|rray. T|
|000007b0| 68 69 73 20 69 73 20 6f | 6e 6c 79 20 73 75 70 70 |his is o|nly supp|
|000007c0| 6f 72 74 65 64 20 66 6f | 72 0a 69 6e 74 65 67 65 |orted fo|r.intege|
|000007d0| 72 20 76 61 6c 75 65 73 | 2e 20 20 49 74 20 69 73 |r values|. It is|
|000007e0| 20 75 73 65 66 75 6c 20 | 77 68 65 6e 20 72 65 61 | useful |when rea|
|000007f0| 64 69 6e 67 20 64 61 74 | 61 20 66 72 6f 6d 20 61 |ding dat|a from a|
|00000800| 20 66 69 6c 65 20 77 72 | 69 74 74 65 6e 0a 6f 6e | file wr|itten.on|
|00000810| 20 61 20 6d 61 63 68 69 | 6e 65 20 77 69 74 68 20 | a machi|ne with |
|00000820| 61 20 64 69 66 66 65 72 | 65 6e 74 20 62 79 74 65 |a differ|ent byte|
|00000830| 20 6f 72 64 65 72 2e 0a | 5c 65 6e 64 7b 66 75 6e | order..|\end{fun|
|00000840| 63 64 65 73 63 7d 0a 0a | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00000850| 75 6e 63 64 65 73 63 7d | 7b 66 72 6f 6d 66 69 6c |uncdesc}|{fromfil|
|00000860| 65 7d 7b 66 5c 2c 20 6e | 7d 0a 52 65 61 64 20 5c |e}{f\, n|}.Read \|
|00000870| 76 61 72 7b 6e 7d 20 69 | 74 65 6d 73 20 28 61 73 |var{n} i|tems (as|
|00000880| 20 6d 61 63 68 69 6e 65 | 20 76 61 6c 75 65 73 29 | machine| values)|
|00000890| 20 66 72 6f 6d 20 74 68 | 65 20 66 69 6c 65 20 6f | from th|e file o|
|000008a0| 62 6a 65 63 74 20 5c 76 | 61 72 7b 66 7d 0a 61 6e |bject \v|ar{f}.an|
|000008b0| 64 20 61 70 70 65 6e 64 | 20 74 68 65 6d 20 74 6f |d append| them to|
|000008c0| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 74 68 65 20 | the end| of the |
|000008d0| 61 72 72 61 79 2e 20 20 | 49 66 20 6c 65 73 73 20 |array. |If less |
|000008e0| 74 68 61 6e 20 5c 76 61 | 72 7b 6e 7d 20 69 74 65 |than \va|r{n} ite|
|000008f0| 6d 73 0a 61 72 65 20 61 | 76 61 69 6c 61 62 6c 65 |ms.are a|vailable|
|00000900| 2c 20 5c 63 6f 64 65 7b | 45 4f 46 45 72 72 6f 72 |, \code{|EOFError|
|00000910| 7d 20 69 73 20 72 61 69 | 73 65 64 2c 20 62 75 74 |} is rai|sed, but|
|00000920| 20 74 68 65 20 69 74 65 | 6d 73 20 74 68 61 74 20 | the ite|ms that |
|00000930| 77 65 72 65 0a 61 76 61 | 69 6c 61 62 6c 65 20 61 |were.ava|ilable a|
|00000940| 72 65 20 73 74 69 6c 6c | 20 69 6e 73 65 72 74 65 |re still| inserte|
|00000950| 64 20 69 6e 74 6f 20 74 | 68 65 20 61 72 72 61 79 |d into t|he array|
|00000960| 2e 20 20 5c 76 61 72 7b | 66 7d 20 6d 75 73 74 20 |. \var{|f} must |
|00000970| 62 65 20 61 20 72 65 61 | 6c 0a 62 75 69 6c 74 2d |be a rea|l.built-|
|00000980| 69 6e 20 66 69 6c 65 20 | 6f 62 6a 65 63 74 3b 20 |in file |object; |
|00000990| 73 6f 6d 65 74 68 69 6e | 67 20 65 6c 73 65 20 77 |somethin|g else w|
|000009a0| 69 74 68 20 61 20 5c 63 | 6f 64 65 7b 72 65 61 64 |ith a \c|ode{read|
|000009b0| 28 29 7d 20 6d 65 74 68 | 6f 64 20 77 6f 6e 27 74 |()} meth|od won't|
|000009c0| 0a 64 6f 2e 0a 5c 65 6e | 64 7b 66 75 6e 63 64 65 |.do..\en|d{funcde|
|000009d0| 73 63 7d 0a 0a 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|000009e0| 64 65 73 63 7d 7b 66 72 | 6f 6d 6c 69 73 74 7d 7b |desc}{fr|omlist}{|
|000009f0| 6c 69 73 74 7d 0a 41 70 | 70 65 6e 64 20 69 74 65 |list}.Ap|pend ite|
|00000a00| 6d 73 20 66 72 6f 6d 20 | 74 68 65 20 6c 69 73 74 |ms from |the list|
|00000a10| 2e 20 20 54 68 69 73 20 | 69 73 20 65 71 75 69 76 |. This |is equiv|
|00000a20| 61 6c 65 6e 74 20 74 6f | 0a 5c 63 6f 64 65 7b 66 |alent to|.\code{f|
|00000a30| 6f 72 20 78 20 69 6e 20 | 5c 76 61 72 7b 6c 69 73 |or x in |\var{lis|
|00000a40| 74 7d 3a 5c 20 61 2e 61 | 70 70 65 6e 64 28 78 29 |t}:\ a.a|ppend(x)|
|00000a50| 7d 0a 65 78 63 65 70 74 | 20 74 68 61 74 20 69 66 |}.except| that if|
|00000a60| 20 74 68 65 72 65 20 69 | 73 20 61 20 74 79 70 65 | there i|s a type|
|00000a70| 20 65 72 72 6f 72 2c 20 | 74 68 65 20 61 72 72 61 | error, |the arra|
|00000a80| 79 20 69 73 20 75 6e 63 | 68 61 6e 67 65 64 2e 0a |y is unc|hanged..|
|00000a90| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00000aa0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00000ab0| 7b 66 72 6f 6d 73 74 72 | 69 6e 67 7d 7b 73 7d 0a |{fromstr|ing}{s}.|
|00000ac0| 41 70 70 65 6e 64 73 20 | 69 74 65 6d 73 20 66 72 |Appends |items fr|
|00000ad0| 6f 6d 20 74 68 65 20 73 | 74 72 69 6e 67 2c 20 69 |om the s|tring, i|
|00000ae0| 6e 74 65 72 70 72 65 74 | 69 6e 67 20 74 68 65 20 |nterpret|ing the |
|00000af0| 73 74 72 69 6e 67 20 61 | 73 20 61 6e 0a 61 72 72 |string a|s an.arr|
|00000b00| 61 79 20 6f 66 20 6d 61 | 63 68 69 6e 65 20 76 61 |ay of ma|chine va|
|00000b10| 6c 75 65 73 20 28 69 2e | 65 2e 20 61 73 20 69 66 |lues (i.|e. as if|
|00000b20| 20 69 74 20 68 61 64 20 | 62 65 65 6e 20 72 65 61 | it had |been rea|
|00000b30| 64 20 66 72 6f 6d 20 61 | 0a 66 69 6c 65 20 75 73 |d from a|.file us|
|00000b40| 69 6e 67 20 74 68 65 20 | 5c 63 6f 64 65 7b 66 72 |ing the |\code{fr|
|00000b50| 6f 6d 66 69 6c 65 28 29 | 7d 20 6d 65 74 68 6f 64 |omfile()|} method|
|00000b60| 29 2e 0a 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |)..\end{|funcdesc|
|00000b70| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00000b80| 73 63 7d 7b 69 6e 73 65 | 72 74 7d 7b 69 5c 2c 20 |sc}{inse|rt}{i\, |
|00000b90| 78 7d 0a 49 6e 73 65 72 | 74 20 61 20 6e 65 77 20 |x}.Inser|t a new |
|00000ba0| 69 74 65 6d 20 77 69 74 | 68 20 76 61 6c 75 65 20 |item wit|h value |
|00000bb0| 5c 76 61 72 7b 78 7d 20 | 69 6e 20 74 68 65 20 61 |\var{x} |in the a|
|00000bc0| 72 72 61 79 20 62 65 66 | 6f 72 65 20 70 6f 73 69 |rray bef|ore posi|
|00000bd0| 74 69 6f 6e 0a 5c 76 61 | 72 7b 69 7d 2e 0a 5c 65 |tion.\va|r{i}..\e|
|00000be0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|00000bf0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 74 |egin{fun|cdesc}{t|
|00000c00| 6f 66 69 6c 65 7d 7b 66 | 7d 0a 57 72 69 74 65 20 |ofile}{f|}.Write |
|00000c10| 61 6c 6c 20 69 74 65 6d | 73 20 28 61 73 20 6d 61 |all item|s (as ma|
|00000c20| 63 68 69 6e 65 20 76 61 | 6c 75 65 73 29 20 74 6f |chine va|lues) to|
|00000c30| 20 74 68 65 20 66 69 6c | 65 20 6f 62 6a 65 63 74 | the fil|e object|
|00000c40| 20 5c 76 61 72 7b 66 7d | 2e 0a 5c 65 6e 64 7b 66 | \var{f}|..\end{f|
|00000c50| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00000c60| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 74 6f 6c 69 73 |{funcdes|c}{tolis|
|00000c70| 74 7d 7b 7d 0a 43 6f 6e | 76 65 72 74 20 74 68 65 |t}{}.Con|vert the|
|00000c80| 20 61 72 72 61 79 20 74 | 6f 20 61 6e 20 6f 72 64 | array t|o an ord|
|00000c90| 69 6e 61 72 79 20 6c 69 | 73 74 20 77 69 74 68 20 |inary li|st with |
|00000ca0| 74 68 65 20 73 61 6d 65 | 20 69 74 65 6d 73 2e 0a |the same| items..|
|00000cb0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a 0a |\end{fun|cdesc}..|
|00000cc0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00000cd0| 7b 74 6f 73 74 72 69 6e | 67 7d 7b 7d 0a 43 6f 6e |{tostrin|g}{}.Con|
|00000ce0| 76 65 72 74 20 74 68 65 | 20 61 72 72 61 79 20 74 |vert the| array t|
|00000cf0| 6f 20 61 6e 20 61 72 72 | 61 79 20 6f 66 20 6d 61 |o an arr|ay of ma|
|00000d00| 63 68 69 6e 65 20 76 61 | 6c 75 65 73 20 61 6e 64 |chine va|lues and|
|00000d10| 20 72 65 74 75 72 6e 20 | 74 68 65 0a 73 74 72 69 | return |the.stri|
|00000d20| 6e 67 20 72 65 70 72 65 | 73 65 6e 74 61 74 69 6f |ng repre|sentatio|
|00000d30| 6e 20 28 74 68 65 20 73 | 61 6d 65 20 73 65 71 75 |n (the s|ame sequ|
|00000d40| 65 6e 63 65 20 6f 66 20 | 62 79 74 65 73 20 74 68 |ence of |bytes th|
|00000d50| 61 74 20 77 6f 75 6c 64 | 0a 62 65 20 77 72 69 74 |at would|.be writ|
|00000d60| 74 65 6e 20 74 6f 20 61 | 20 66 69 6c 65 20 62 79 |ten to a| file by|
|00000d70| 20 74 68 65 20 5c 63 6f | 64 65 7b 74 6f 66 69 6c | the \co|de{tofil|
|00000d80| 65 28 29 7d 20 6d 65 74 | 68 6f 64 2e 29 0a 5c 65 |e()} met|hod.).\e|
|00000d90| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 57 68 |nd{funcd|esc}..Wh|
|00000da0| 65 6e 20 61 6e 20 61 72 | 72 61 79 20 6f 62 6a 65 |en an ar|ray obje|
|00000db0| 63 74 20 69 73 20 70 72 | 69 6e 74 65 64 20 6f 72 |ct is pr|inted or|
|00000dc0| 20 63 6f 6e 76 65 72 74 | 65 64 20 74 6f 20 61 20 | convert|ed to a |
|00000dd0| 73 74 72 69 6e 67 2c 20 | 69 74 20 69 73 0a 72 65 |string, |it is.re|
|00000de0| 70 72 65 73 65 6e 74 65 | 64 20 61 73 20 5c 63 6f |presente|d as \co|
|00000df0| 64 65 7b 61 72 72 61 79 | 28 5c 76 61 72 7b 74 79 |de{array|(\var{ty|
|00000e00| 70 65 63 6f 64 65 7d 2c | 20 5c 76 61 72 7b 69 6e |pecode},| \var{in|
|00000e10| 69 74 69 61 6c 69 7a 65 | 72 7d 29 7d 2e 20 20 54 |itialize|r})}. T|
|00000e20| 68 65 0a 5c 76 61 72 7b | 69 6e 69 74 69 61 6c 69 |he.\var{|initiali|
|00000e30| 7a 65 72 7d 20 69 73 20 | 6f 6d 69 74 74 65 64 20 |zer} is |omitted |
|00000e40| 69 66 20 74 68 65 20 61 | 72 72 61 79 20 69 73 20 |if the a|rray is |
|00000e50| 65 6d 70 74 79 2c 20 6f | 74 68 65 72 77 69 73 65 |empty, o|therwise|
|00000e60| 20 69 74 20 69 73 20 61 | 0a 73 74 72 69 6e 67 20 | it is a|.string |
|00000e70| 69 66 20 74 68 65 20 5c | 76 61 72 7b 74 79 70 65 |if the \|var{type|
|00000e80| 63 6f 64 65 7d 20 69 73 | 20 5c 63 6f 64 65 7b 27 |code} is| \code{'|
|00000e90| 63 27 7d 2c 20 6f 74 68 | 65 72 77 69 73 65 20 69 |c'}, oth|erwise i|
|00000ea0| 74 20 69 73 20 61 20 6c | 69 73 74 20 6f 66 0a 6e |t is a l|ist of.n|
|00000eb0| 75 6d 62 65 72 73 2e 20 | 20 54 68 65 20 73 74 72 |umbers. | The str|
|00000ec0| 69 6e 67 20 69 73 20 67 | 75 61 72 61 6e 74 65 65 |ing is g|uarantee|
|00000ed0| 64 20 74 6f 20 62 65 20 | 61 62 6c 65 20 74 6f 20 |d to be |able to |
|00000ee0| 62 65 20 63 6f 6e 76 65 | 72 74 65 64 20 62 61 63 |be conve|rted bac|
|00000ef0| 6b 20 74 6f 0a 61 6e 20 | 61 72 72 61 79 20 77 69 |k to.an |array wi|
|00000f00| 74 68 20 74 68 65 20 73 | 61 6d 65 20 74 79 70 65 |th the s|ame type|
|00000f10| 20 61 6e 64 20 76 61 6c | 75 65 20 75 73 69 6e 67 | and val|ue using|
|00000f20| 20 72 65 76 65 72 73 65 | 20 71 75 6f 74 65 73 0a | reverse| quotes.|
|00000f30| 28 5c 63 6f 64 65 7b 60 | 60 7d 29 2e 20 20 45 78 |(\code{`|`}). Ex|
|00000f40| 61 6d 70 6c 65 73 3a 0a | 0a 5c 62 63 6f 64 65 5c |amples:.|.\bcode\|
|00000f50| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0a |begin{ve|rbatim}.|
|00000f60| 61 72 72 61 79 28 27 6c | 27 29 0a 61 72 72 61 79 |array('l|').array|
|00000f70| 28 27 63 27 2c 20 27 68 | 65 6c 6c 6f 20 77 6f 72 |('c', 'h|ello wor|
|00000f80| 6c 64 27 29 0a 61 72 72 | 61 79 28 27 6c 27 2c 20 |ld').arr|ay('l', |
|00000f90| 5b 31 2c 20 32 2c 20 33 | 2c 20 34 2c 20 35 5d 29 |[1, 2, 3|, 4, 5])|
|00000fa0| 0a 61 72 72 61 79 28 27 | 64 27 2c 20 5b 31 2e 30 |.array('|d', [1.0|
|00000fb0| 2c 20 32 2e 30 2c 20 33 | 2e 31 34 5d 29 0a 5c 65 |, 2.0, 3|.14]).\e|
|00000fc0| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 5c 65 63 6f |nd{verba|tim}\eco|
|00000fd0| 64 65 0a | |de. | |
+--------+-------------------------+-------------------------+--------+--------+