%!PS %%Version: 3.3.2 %%DocumentFonts: (atend) %%Pages: (atend) %%EndComments % % Version 3.3.2 prologue for troff files. % /#copies 1 store /aspectratio 1 def /formsperpage 1 def /landscape false def /linewidth .3 def /magnification 1 def /margin 0 def /orientation 0 def /resolution 720 def /rotation 1 def /xoffset 0 def /yoffset 0 def /roundpage true def /useclippath true def /pagebbox [0 0 612 792] def /R /Times-Roman def /I /Times-Italic def /B /Times-Bold def /BI /Times-BoldItalic def /H /Helvetica def /HI /Helvetica-Oblique def /HB /Helvetica-Bold def /HX /Helvetica-BoldOblique def /CW /Courier def /CO /Courier def /CI /Courier-Oblique def /CB /Courier-Bold def /CX /Courier-BoldOblique def /PA /Palatino-Roman def /PI /Palatino-Italic def /PB /Palatino-Bold def /PX /Palatino-BoldItalic def /Hr /Helvetica-Narrow def /Hi /Helvetica-Narrow-Oblique def /Hb /Helvetica-Narrow-Bold def /Hx /Helvetica-Narrow-BoldOblique def /KR /Bookman-Light def /KI /Bookman-LightItalic def /KB /Bookman-Demi def /KX /Bookman-DemiItalic def /AR /AvantGarde-Book def /AI /AvantGarde-BookOblique def /AB /AvantGarde-Demi def /AX /AvantGarde-DemiOblique def /NR /NewCenturySchlbk-Roman def /NI /NewCenturySchlbk-Italic def /NB /NewCenturySchlbk-Bold def /NX /NewCenturySchlbk-BoldItalic def /ZD /ZapfDingbats def /ZI /ZapfChancery-MediumItalic def /S /S def /S1 /S1 def /GR /Symbol def /inch {72 mul} bind def /min {2 copy gt {exch} if pop} bind def /show {{//show} 0 get exec} bind def % so later references don't bind /widthshow {{//widthshow} 0 get exec} bind def /stringwidth {{//stringwidth} 0 get exec} bind def /setup { counttomark 2 idiv {def} repeat pop landscape {/orientation 90 orientation add def} if /scaling 72 resolution div def linewidth setlinewidth 1 setlinecap pagedimensions xcenter ycenter translate orientation rotation mul rotate width 2 div neg height 2 div translate xoffset inch yoffset inch neg translate margin 2 div dup neg translate magnification dup aspectratio mul scale scaling scaling scale addmetrics 0 0 moveto } def /pagedimensions { useclippath userdict /gotpagebbox known not and { /pagebbox [clippath pathbbox newpath] def roundpage currentdict /roundpagebbox known and {roundpagebbox} if } if pagebbox aload pop 4 -1 roll exch 4 1 roll 4 copy landscape {4 2 roll} if sub /width exch def sub /height exch def add 2 div /xcenter exch def add 2 div /ycenter exch def userdict /gotpagebbox true put } def /addmetrics { /Symbol /S null Sdefs cf /Times-Roman /S1 StandardEncoding dup length array copy S1defs cf } def /pagesetup { /page exch def currentdict /pagedict known currentdict page known and { page load pagedict exch get cvx exec } if } def /decodingdefs [ {counttomark 2 idiv {y moveto show} repeat} {neg /y exch def counttomark 2 idiv {y moveto show} repeat} {neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat} {neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat} {counttomark 2 idiv {y moveto show} repeat} {neg setfunnytext} ] def /setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def /w {neg moveto show} bind def /m {neg dup /y exch def moveto} bind def /done {/lastpage where {pop lastpage} if} def /f { dup /font exch def findfont exch dup /ptsize exch def scaling div dup /size exch def scalefont setfont linewidth ptsize mul scaling 10 mul div setlinewidth /spacewidth ( ) stringwidth pop def } bind def /changefont { /fontheight exch def /fontslant exch def currentfont [ 1 0 fontheight ptsize div fontslant sin mul fontslant cos div fontheight ptsize div 0 0 ] makefont setfont } bind def /sf {f} bind def /cf { dup length 2 idiv /entries exch def /chtab exch def /newencoding exch def /newfont exch def findfont dup length 1 add dict /newdict exch def {1 index /FID ne {newdict 3 1 roll put}{pop pop} ifelse} forall newencoding type /arraytype eq {newdict /Encoding newencoding put} if newdict /Metrics entries dict put newdict /Metrics get begin chtab aload pop 1 1 entries {pop def} for newfont newdict definefont pop end } bind def % % A few arrays used to adjust reference points and character widths in some % of the printer resident fonts. If square roots are too high try changing % the lines describing /radical and /radicalex to, % % /radical [0 -75 550 0] % /radicalex [-50 -75 500 0] % % Move braceleftbt a bit - default PostScript character is off a bit. % /Sdefs [ /bracketlefttp [201 500] /bracketleftbt [201 500] /bracketrighttp [-81 380] /bracketrightbt [-83 380] /braceleftbt [203 490] /bracketrightex [220 -125 500 0] /radical [0 0 550 0] /radicalex [-50 0 500 0] /parenleftex [-20 -170 0 0] /integral [100 -50 500 0] /infinity [10 -75 730 0] ] def /S1defs [ /underscore [0 80 500 0] /endash [7 90 650 0] ] def % % Tries to round clipping path dimensions, as stored in array pagebbox, so they % match one of the known sizes in the papersizes array. Lower left coordinates % are always set to 0. % /roundpagebbox { 7 dict begin /papersizes [8.5 inch 11 inch 14 inch 17 inch] def /mappapersize { /val exch def /slop .5 inch def /diff slop def /j 0 def 0 1 papersizes length 1 sub { /i exch def papersizes i get val sub abs dup diff le {/diff exch def /j i def} {pop} ifelse } for diff slop lt {papersizes j get} {val} ifelse } def pagebbox 0 0 put pagebbox 1 0 put pagebbox dup 2 get mappapersize 2 exch put pagebbox dup 3 get mappapersize 3 exch put end } bind def %%EndProlog %%BeginSetup mark /linewidth 0.5 def /#copies 1 store /landscape false def /resolution 720 def % % Encoding vector and redefinition of findfont for the ISO Latin1 standard. % The 18 characters missing from ROM based fonts on older printers are noted % below. % /ISOLatin1Encoding [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /minus /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron /space /exclamdown /cent /sterling /currency /yen /brokenbar % missing /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree % missing /plusminus % missing /twosuperior % missing /threesuperior % missing /acute /mu % missing /paragraph /periodcentered /cedilla /onesuperior % missing /ordmasculine /guillemotright /onequarter % missing /onehalf % missing /threequarters % missing /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth % missing /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply % missing /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute % missing /Thorn % missing /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth % missing /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide % missing /oslash /ugrave /uacute /ucircumflex /udieresis /yacute % missing /thorn % missing /ydieresis ] def /NewFontDirectory FontDirectory maxlength dict def % % Apparently no guarantee findfont is defined in systemdict so the obvious % % systemdict /findfont get exec % % can generate an error. So far the only exception is a VT600 (version 48.0). % userdict /@RealFindfont known not { userdict begin /@RealFindfont systemdict begin /findfont load end def end } if /findfont { dup NewFontDirectory exch known not { dup %dup systemdict /findfont get exec % not always in systemdict dup userdict /@RealFindfont get exec dup /Encoding get StandardEncoding eq { dup length dict begin {1 index /FID ne {def}{pop pop} ifelse} forall /Encoding ISOLatin1Encoding def currentdict end /DummyFontName exch definefont } if NewFontDirectory 3 1 roll put } if NewFontDirectory exch get } bind def setup 2 setdecoding %%EndSetup %%Page: 1 1 /saveobj save def mark 1 pagesetup 12 B f (ALEF Language Reference Manual)3 1828 1 1966 1220 t 10 I f (Phil Winterbottom)1 742 1 2509 1480 t (philw@research.att.com)2387 1620 w 10 B f (Introduction)720 2280 w 10 R f ( language designed for systems programming. Exception handling,)7 2700(Alef is a concurrent programming)4 1370 2 970 2436 t ( the language. Programs can be)5 1312(process management and synchronisation primitives are implemented by)7 3008 2 720 2556 t ( passing paradigms. Expressions use the same syntax as C,)9 2399(written using both shared variable and message)6 1921 2 720 2676 t ( substantially different. The language does not provide garbage collection, so pro\255)11 3401(but the type system is)4 919 2 720 2796 t ( a bare description of the syntax)6 1329( manual provides)2 704( This)1 236(grams are expected to manage their own memory.)7 2051 4 720 2916 t (and semantics of the current implementation.)5 1803 1 720 3036 t ( reference manual and)3 888( is borrowed from the C language)6 1348( manual)1 345(Much of the terminology used in this)6 1489 4 970 3192 t (the Plan 9 manual. The manual expects familiarity with both.)9 2445 1 720 3312 t 10 B f (1. Lexical)1 436 1 720 3552 t 10 R f ( preprocessor)1 543( The)1 214( C preprocessor is used.)4 987(Compilation starts with a preprocessing phase. An ANSI)7 2326 4 970 3708 t ( the)1 147(performs file inclusion and macro substitution. Comments and lines beginning with)10 3351 2 720 3828 t 10 CW f (#)4243 3828 w 10 R f (character are con\255)2 712 1 4328 3828 t ( is a)2 169( token)1 250( A)1 125(sumed by the preprocessor. The preprocessor produces a sequence of tokens for the compiler.)13 3776 4 720 3948 t ( space, new line, tab, form)5 1073(sequence of characters separated by white space. The white space characters are)11 3247 2 720 4068 t (feed and vertical tab.)3 836 1 720 4188 t 10 B f (1.1. Tokens)1 512 1 720 4428 t 10 R f ( classifies tokens as: identifiers, typenames, keywords, constants and operators.)9 3251(The lexical analyser)2 819 2 970 4584 t ( to separate)2 474( space is ignored in the source except as needed)9 2002( White)1 305(Tokens are separated by white space.)5 1539 4 720 4704 t ( lexical analyser is greedy: if tokens have)7 1698( The)1 212( which would otherwise be ambiguous.)5 1600(sequences of tokens)2 810 4 720 4824 t ( be the longest string of characters which)7 1687(been consumed up to a given character, then the next token will)11 2633 2 720 4944 t (forms a legal token.)3 793 1 720 5064 t 10 B f ( Words)1 314(1.2. Reserved)1 593 2 720 5304 t 10 R f (The following keywords are reserved by the language and may not be used as identifiers:)14 3559 1 970 5460 t 9 CW f ( alloc)1 918(adt aggr)1 1080 2 1440 5630 t ( break)1 810(alt become)1 1188 2 1440 5740 t (byte case chan)2 1944 1 1440 5850 t ( default)1 810(check continue)1 1296 2 1440 5960 t ( enum)1 864(do else)1 1080 2 1440 6070 t ( for)1 756(extern float)1 1134 2 1440 6180 t ( int)1 918(goto if)1 972 2 1440 6290 t ( nil)1 810(intern lint)1 1080 2 1440 6400 t ( raise)1 918(par proc)1 1080 2 1440 6510 t (rescue return sint)2 1944 1 1440 6620 t (sizeof switch task)2 1944 1 1440 6730 t ( uint)1 702(tuple typedef)1 1242 2 1440 6840 t ( union)1 756(ulint unalloc)1 1242 2 1440 6950 t ( while)1 918(usint void)1 1080 2 1440 7060 t 10 R f (The following symbols are used as separators and operators in the language:)11 3047 1 720 7240 t cleartomark showpage saveobj restore %%EndPage: 1 1 %%Page: 2 2 /saveobj save def mark 2 pagesetup 10 R f (\255 2 \255)2 166 1 2797 480 t 9 CW f (+ \255 / =)3 1350 1 1440 830 t (> < ! %)3 1350 1 1440 940 t (& | ? .)3 1350 1 1440 1050 t (" ' { })3 1350 1 1440 1160 t ([ ] \( \))3 1350 1 1440 1270 t (* ;)1 486 1 1440 1380 t 10 R f (The following multi\255character sequences are used as operators:)7 2518 1 720 1560 t 9 CW f (+= \255= /= *=)3 1404 1 1440 1730 t (%= &= |= ^=)3 1404 1 1440 1840 t ( !=)1 432(<<= >>= ==)2 972 2 1440 1950 t (\255\255 <\255 \255> ++)3 1404 1 1440 2060 t 10 B f (1.3. Comments)1 660 1 720 2360 t 10 R f (Comments are removed by the preprocessor. A comment starts with the characters)11 3315 1 970 2516 t 10 CW f (/*)4312 2516 w 10 R f (and finishes at)2 581 1 4459 2516 t (the characters)1 559 1 720 2636 t 10 CW f (*/)1313 2636 w 10 R f ( comment may include any sequence of characters including)8 2483(. A)1 156 2 1433 2636 t 10 CW f (/*)4106 2636 w 10 R f ( do not)2 296(. Comments)1 518 2 4226 2636 t (nest.)720 2756 w 10 B f (1.4. Identifiers)1 644 1 720 2996 t 10 R f (An identifier is any sequence of alpha\255numeric characters and the character)10 3106 1 970 3152 t 10 CW f (_)4112 3152 w 10 R f ( may not)2 372(. Identifiers)1 496 2 4172 3152 t ( prefixed by)2 488( names)1 284( Identifier)1 425( are case sensitive. All characters are significant.)7 1969( Identifiers)1 464(start with a digit.)3 690 6 720 3272 t 10 CW f (ALEF)720 3392 w 10 R f (are reserved for use by the runtime system.)7 1718 1 985 3392 t 10 B f (1.5. Constants)1 628 1 720 3632 t 10 R f (There are five types of constant:)5 1288 1 970 3788 t 10 I f (constant:)1330 3968 w (integer\255const)1580 4088 w (character\255const)1580 4208 w (floating\255const)1580 4328 w (string\255const)1580 4448 w (rune\255string\255const)1580 4568 w 10 R f ( Defined)1 373( to modify the base of a number.)7 1312( prefix may be used)4 791( A)1 123(An integer constant is a sequence of digits.)7 1721 5 720 4748 t (prefixes, bases and digit sets are:)5 1314 1 720 4868 t 9 CW f ( 0\2559)1 648(none decimal)1 810 2 1440 5038 t ( a\255f A\255F)2 432( 0\2559)1 432(0x hexadecimal)1 1026 3 1440 5148 t ( 0\2557)1 756(0 octal)1 702 2 1440 5258 t 10 R f (A character constant may contain one or more characters surrounded by the single quote mark)14 3911 1 720 5438 t 10 CW f (')4668 5438 w 10 R f ( the)1 159(. If)1 153 2 4728 5438 t ( following table)2 667( The)1 222( or more characters the first must be the escape character \\.)11 2529(constant contains two)2 902 4 720 5558 t (shows valid characters after an escape and the value of the constant:)11 2717 1 720 5678 t 9 CW f ( character)1 540( Null)1 486(0 NUL)1 594 3 1440 5848 t ( Newline)1 702(n NL)1 540 2 1440 5958 t ( return)1 378( Carriage)1 756(r CR)1 540 3 1440 6068 t ( tab)1 216( Horizontal)1 864(t HT)1 540 3 1440 6178 t ( Backspace)1 810(b BS)1 540 2 1440 6288 t ( feed)1 270( Form)1 540(f FF)1 540 3 1440 6398 t ( Buzz)1 486(a BEL)1 594 2 1440 6508 t ( tab)1 216( Vertical)1 756(v VT)1 540 3 1440 6618 t (\\ \\ Backslash)2 1350 1 1440 6728 t ( quote)1 324(" " Double)2 1188 2 1440 6838 t 10 R f (Character constants have the type)4 1341 1 720 7018 t 10 CW f (int)2086 7018 w 10 R f ( manual\))1 353( the character is a unicode rune \(see Rune\(2\) in the Plan9)11 2280(. If)1 141 3 2266 7018 t (the value of the integer will be the 16\255bit unicode representation of the rune.)13 3044 1 720 7138 t ( integer part, a period, a fractional part, the letter)9 2038(A floating point constant consists of an)6 1626 2 970 7294 t 10 CW f (e)4670 7294 w 10 R f (and an)1 274 1 4766 7294 t cleartomark showpage saveobj restore %%EndPage: 2 2 %%Page: 3 3 /saveobj save def mark 3 pagesetup 10 R f (\255 3 \255)2 166 1 2797 480 t ( of decimal digits. Either the integer or)7 1569(exponent part. The integer, fraction and exponent parts must consist)9 2751 2 720 840 t (fractional parts may be omitted. Either the decimal point or the letter)11 2812 1 720 960 t 10 CW f (e)3563 960 w 10 R f ( be omitted.)2 489(and the exponent may)3 897 2 3654 960 t ( the unary)2 411(The integer part or period and the exponent part may be preceded by)12 2821 2 720 1080 t 10 CW f (+)3983 1080 w 10 R f (or)4074 1080 w 10 CW f (\255)4188 1080 w 10 R f (operators. Floating)1 761 1 4279 1080 t (point constants have the type)4 1160 1 720 1200 t 10 CW f (float)1905 1200 w 10 R f (.)2205 1200 w ( marks)1 281(A string constant is a sequence of characters between the double quote)11 2939 2 970 1356 t 10 CW f (")4227 1356 w 10 R f ( string has the)3 594(. A)1 159 2 4287 1356 t ( The)1 207( array of byte'. The NUL character is automatically appended to the string by the compiler.)15 3669(type 'static)1 444 3 720 1476 t ( The)1 221( string constant is implementation dependent.)5 1896(effect of modifying a)3 890 3 720 1596 t 10 CW f (sizeof)3768 1596 w 10 R f (operator applied to a)3 871 1 4169 1596 t (string constant yields the number of bytes including the appended NUL.)10 2883 1 720 1716 t (A rune string constant is a sequence of unicode characters introduced by)11 2923 1 970 1872 t 10 CW f ($")3922 1872 w 10 R f (and terminated by)2 729 1 4071 1872 t 10 CW f (")4829 1872 w 10 R f (. A)1 151 1 4889 1872 t ( zero rune character is automatically appended to the string)9 2367( A)1 123( of usint'.)2 388(rune string has the type 'static array)6 1442 4 720 1992 t ( The)1 206(by the compiler.)2 654 2 720 2112 t 10 CW f (sizeof)1606 2112 w 10 R f ( runes includ\255)2 553(operator applied to a rune string constant yields the number of)10 2495 2 1992 2112 t (ing the appended zero.)3 903 1 720 2232 t 10 B f (1.6. Programs)1 621 1 720 2508 t 10 R f ( may)1 208( Identifiers)1 471( declarations introduce identifiers.)3 1397( The)1 215(An ALEF program is a list of declarations.)7 1779 5 970 2664 t ( that)1 179( have storage classes)3 843( Identifiers)1 465(define variables, types, functions, function prototypes or enumerators.)7 2833 4 720 2784 t ( func\255)1 237( For)1 191( storage class applied to a complex type controls the scope of the members.)13 3032( A)1 124(define their scope.)2 736 5 720 2904 t ( declared at the file scope the storage class determines if a definition can be accessed)15 3547(tions and variables)2 773 2 720 3024 t (from another file.)2 701 1 720 3144 t 10 B f ( and Tasks)2 463(1.7. Processes)1 604 2 720 3384 t 10 R f (The term)1 371 1 970 3540 t 10 I f (process)1374 3540 w 10 R f ( refer to a preemptively scheduled)5 1405(is used to)2 394 2 1712 3540 t 10 I f (thread)3545 3540 w 10 R f ( process may)2 539( A)1 131(of execution.)1 530 3 3840 3540 t ( A)1 137(contain several tasks.)2 881 2 720 3660 t 10 I f (task)1778 3660 w 10 R f ( non\255preemptively scheduled coroutine within a process. The memory)8 2910(is a)1 151 2 1979 3660 t ( a shared memory computer processes)5 1531( On)1 174(model does not define the sharing of memory between processes.)9 2615 3 720 3780 t ( may be located on physically)5 1230( a multicomputer processes)3 1117( On)1 181(will typically share the same address space.)6 1792 4 720 3900 t ( access only to local memory. In such a system processes would not share the same)15 3562(distant nodes with)2 758 2 720 4020 t (address space, and must communicate using message passing.)7 2477 1 720 4140 t ( tasks executing within the context of a process are defined to be in the same address)16 3606(A group of)2 464 2 970 4296 t ( term)1 209( The)1 206(space. Tasks are scheduled during communication and synchronisation operations.)8 3316 3 720 4416 t 10 I f (thread)4477 4416 w 10 R f (is used)1 276 1 4764 4416 t (wherever the distinction between a process and task is unimportant.)9 2701 1 720 4536 t 10 B f ( and Declarations)2 750(2. Definitions)1 592 2 720 4776 t 10 R f ( declaration that also)3 865( definition is a)3 608( A)1 133(A declaration introduces an identifier and specifies its type.)8 2464 4 970 4932 t ( known type produced by a definition.)6 1541( object is an area of memory of)7 1272( An)1 176(reserves storage for an identifier.)4 1331 4 720 5052 t (Function prototypes, variable declarations preceded by)5 2310 1 720 5172 t 10 CW f (extern)3079 5172 w 10 R f (, and type specifiers are declarations.)5 1601 1 3439 5172 t (Function declarations with bodies and variable declarations are examples of definitions.)10 3508 1 720 5292 t 10 B f (2.1. Scope)1 450 1 720 5532 t 10 R f ( are four levels of scope: file, type, function and local.)10 2159( There)1 282(Identifiers within a program have scope.)5 1613 3 970 5688 t 10 S f (\267)720 5844 w 10 R f ( has scope starting from its declaration to)7 1680(A local identifier is declared at the start of a block. A local)12 2390 2 970 5844 t (the end of the block in which it was declared.)9 1813 1 970 5964 t 10 S f (\267)720 6120 w 10 R f ( a function. These identifiers can be referenced)7 1983(Exception identifiers and labels have the scope of)7 2087 2 970 6120 t (from the start of a function to its end, regardless of position of the declaration.)14 3123 1 970 6240 t 10 S f (\267)720 6396 w 10 R f ( is in scope only when the dereference operators)8 1930(A member of a complex type)5 1167 2 970 6396 t 10 CW f (.)4093 6396 w 10 R f (and)4179 6396 w 10 CW f (\255>)4349 6396 w 10 R f (are applied to)2 545 1 4495 6396 t ( scope and may only be referenced by function members)9 2267( type members have special)4 1111( Hidden)1 346(the type.)1 346 4 970 6516 t (of the type.)2 452 1 970 6636 t 10 S f (\267)720 6792 w 10 R f ( Unqualified declarations at the file)5 1446(All definitions outside of a function body have the scope of file.)11 2624 2 970 6792 t (scope have static storage class.)4 1233 1 970 6912 t cleartomark showpage saveobj restore %%EndPage: 3 3 %%Page: 4 4 /saveobj save def mark 4 pagesetup 10 R f (\255 4 \255)2 166 1 2797 480 t 10 B f ( classes)1 308(2.2. Storage)1 527 2 720 840 t 10 R f ( objects are created at)4 923( Automatic)1 487( storage classes: automatic, parameter and static.)6 2030(There are three)2 630 4 970 996 t ( block in which they were declared. The value of automatics is undefined upon creation. Auto\255)15 3853(entry to the)2 467 2 720 1116 t ( destroyed)1 414( are created by function invocation and are)7 1703( Parameters)1 493(matic variables are destroyed at block exit.)6 1710 4 720 1236 t ( invocation of the program until termination. Static)7 2101(at function exit. Uninitialised static objects exist from)7 2219 2 720 1356 t (objects which have not been initialised have the value 0.)9 2252 1 720 1476 t 10 B f (3. Types)1 381 1 720 1716 t 10 R f ( types may be derived from the)6 1260(A small set of basic types are defined by the language. More complex)12 2810 2 970 1872 t (basic types.)1 466 1 720 1992 t 10 B f ( types)1 247(3.1. Basic)1 428 2 720 2232 t 10 R f (The basic types are:)3 795 1 970 2388 t 10 S f (_ __________________________________________)1 2133 1 1813 2468 t 10 R f ( type)1 487(name size)1 701 2 1992 2588 t 10 S f (_ __________________________________________)1 2133 1 1813 2608 t 10 CW f (byte)1993 2728 w 10 R f ( character)1 389( unsigned)1 586(8 bits)1 245 3 2538 2728 t 10 S f (_ __________________________________________)1 2133 1 1813 2748 t 10 CW f (sint)1993 2868 w 10 R f ( short integer)2 527( signed)1 461(16 bits)1 270 3 2538 2868 t 10 S f (_ __________________________________________)1 2133 1 1813 2888 t 10 CW f (usint)1963 3008 w 10 R f ( short integer)2 527( unsigned)1 561(16 bits)1 270 3 2538 3008 t 10 S f (_ __________________________________________)1 2133 1 1813 3028 t 10 CW f (int)2023 3148 w 10 R f ( integer)1 302( signed)1 461(32 bits)1 270 3 2538 3148 t 10 S f (_ __________________________________________)1 2133 1 1813 3168 t 10 CW f (uint)1993 3288 w 10 R f ( integer)1 302( unsigned)1 561(32 bits)1 270 3 2538 3288 t 10 S f (_ __________________________________________)1 2133 1 1813 3308 t 10 CW f (float)1963 3428 w 10 R f ( point)1 231( floating)1 511(64 bits)1 270 3 2538 3428 t 10 S f (_ __________________________________________)1 2133 1 1813 3448 t 10 CW f (lint)1993 3568 w 10 R f ( signed integer)2 588( long)1 378(64 bits)1 270 3 2538 3568 t 10 S f (_ __________________________________________)1 2133 1 1813 3588 t 10 CW f (ulint)1963 3708 w 10 R f ( long integer)2 505( unsigned)1 561(64 bits)1 270 3 2538 3708 t 10 S f (_ __________________________________________)1 2133 1 1813 3728 t 10 CW f (chan)1993 3848 w 10 R f ( channel)1 510(32 bits)1 270 2 2538 3848 t 10 S f ( \347)1 -2133(_ __________________________________________)1 2133 2 1813 3868 t (\347)1813 3768 w (\347)1813 3668 w (\347)1813 3568 w (\347)1813 3468 w (\347)1813 3368 w (\347)1813 3268 w (\347)1813 3168 w (\347)1813 3068 w (\347)1813 2968 w (\347)1813 2868 w (\347)1813 2768 w (\347)1813 2668 w (\347)1813 2568 w (\347)2438 3868 w (\347)2438 3768 w (\347)2438 3668 w (\347)2438 3568 w (\347)2438 3468 w (\347)2438 3368 w (\347)2438 3268 w (\347)2438 3168 w (\347)2438 3068 w (\347)2438 2968 w (\347)2438 2868 w (\347)2438 2768 w (\347)2438 2668 w (\347)2438 2568 w (\347)2908 3868 w (\347)2908 3768 w (\347)2908 3668 w (\347)2908 3568 w (\347)2908 3468 w (\347)2908 3368 w (\347)2908 3268 w (\347)2908 3168 w (\347)2908 3068 w (\347)2908 2968 w (\347)2908 2868 w (\347)2908 2768 w (\347)2908 2668 w (\347)2908 2568 w (\347)3946 3868 w (\347)3946 3768 w (\347)3946 3668 w (\347)3946 3568 w (\347)3946 3468 w (\347)3946 3368 w (\347)3946 3268 w (\347)3946 3168 w (\347)3946 3068 w (\347)3946 2968 w (\347)3946 2868 w (\347)3946 2768 w (\347)3946 2668 w (\347)3946 2568 w 10 R f ( that type. The format)4 872(The size given for the basic types is the minimum number of bits required to represent)15 3448 2 720 4048 t (and precision of)2 669 1 720 4168 t 10 CW f (float)1427 4168 w 10 R f (is implementation dependent. The)3 1399 1 1765 4168 t 10 CW f (float)3202 4168 w 10 R f (type should be the highest precision)5 1500 1 3540 4168 t ( The)1 205(floating point provided by the hardware.)5 1614 2 720 4288 t 10 CW f (lint)2564 4288 w 10 R f (and)2829 4288 w 10 CW f (ulint)2998 4288 w 10 R f (types are not part of the current implemen\255)7 1717 1 3323 4288 t ( are)1 148( Channels)1 424( is implementation dependent.)3 1211( alignment of the basic types)5 1161( The)1 208(tation but have been defined.)4 1168 6 720 4408 t ( The)1 210( are the size of a pointer.)6 1013(implemented by the runtime system and must be initialised before use. They)11 3097 3 720 4528 t 10 CW f (void)720 4648 w 10 R f ( as part of a derived)5 839(type performs the special task of declaring procedures returning no value and)11 3205 2 996 4648 t (type to form generic pointers. The)5 1364 1 720 4768 t 10 CW f (void)2109 4768 w 10 R f (type may not be used as a basic type.)8 1478 1 2374 4768 t 10 B f ( types)1 247(3.2. Derived)1 538 2 720 5008 t 10 R f ( of the basic types)4 733( applied in declarations use one)5 1266( Operators)1 445(Types are derived in the same way as C.)8 1626 4 970 5164 t (to derive a new type. The deriving operators are:)8 1942 1 720 5284 t 9 CW f ( a pointer to)3 702(* create)1 756 2 1440 5454 t ( the address of)3 810(& yield)1 702 2 1440 5564 t ( function returning)2 1026(\(\) a)1 486 2 1440 5674 t ( array of)2 486([] an)1 540 2 1440 5784 t 10 R f ( examples are:)2 576( Some)1 278(These operators bind to the name of each identifier in a declaration or definition.)13 3221 3 720 5964 t 9 CW f ( A pointer to an integer */)6 1458( /*)1 702(int *ptr;)1 702 3 1440 6134 t ( A vector of 10 characters */)6 1566( /*)1 648(char c[10];)1 756 3 1440 6244 t ( A function returning a pointer to a float */)9 2430( /*)1 594(float *pow\(\);)1 810 3 1440 6354 t 10 R f ( types may be either)4 816( Complex)1 420( types and the deriving operators.)5 1346(Complex types may be built from the basic)7 1738 4 720 6534 t ( complex types contain sequences of basic types and)8 2096( These)1 288( abstract data types \(ADT\).)4 1083(aggregates, unions or)2 853 4 720 6654 t ( of basic and derived types. Each element of the)9 2002( aggregate is a simple collection)5 1329( An)1 181(other derived types.)2 808 4 720 6774 t ( the same storage allocation as an aggregate but also)9 2096(aggregate has unique storage. An abstract data type has)8 2224 2 720 6894 t ( of functions to manipulate the type, and a set of protection attributes for each of its members. A)18 3970(has a set)2 350 2 720 7014 t ( size of a)3 384(union type contains a sequence of basic and derived types which occupy the same storage. The)15 3936 2 720 7134 t (union is determined by the size of the largest member.)9 2169 1 720 7254 t cleartomark showpage saveobj restore %%EndPage: 4 4 %%Page: 5 5 /saveobj save def mark 5 pagesetup 10 R f (\255 5 \255)2 166 1 2797 480 t (The declaration of complex types introduces)5 1817 1 970 840 t 10 I f (typenames)2820 840 w 10 R f ( declaration a type\255)3 794(into the language. After)3 972 2 3274 840 t ( be used wherever a basic type is permitted. Derived types and basic types may be renamed using)17 3937(name can)1 383 2 720 960 t (the)720 1080 w 10 CW f (typedef)867 1080 w 10 R f (statement.)1312 1080 w (The integral types are)3 888 1 970 1236 t 10 CW f (int)1890 1236 w 10 R f (,)2070 1236 w 10 CW f (uint)2127 1236 w 10 R f (,)2367 1236 w 10 CW f (sint)2424 1236 w 10 R f (,)2664 1236 w 10 CW f (suint)2721 1236 w 10 R f (,)3021 1236 w 10 CW f (byte)3078 1236 w 10 R f (,)3318 1236 w 10 CW f (lint)3375 1236 w 10 R f (and)3647 1236 w 10 CW f (ulint)3823 1236 w 10 R f ( arithmetic types)2 680(. The)1 237 2 4123 1236 t ( and the type)3 513(are the integral types)3 837 2 720 1356 t 10 CW f (float)2095 1356 w 10 R f ( pointer type is a type derived from the)8 1553(. The)1 230 2 2395 1356 t 10 CW f (&)4203 1356 w 10 R f (\(address of\) opera\255)2 752 1 4288 1356 t (tor or derived from a pointer declaration.)6 1632 1 720 1476 t 10 B f ( and Promotions)2 706(3.3. Conversions)1 728 2 720 1716 t 10 R f ( exception of complex)3 920(ALEF performs the same implicit conversions and promotions as C with the)11 3150 2 970 1872 t ( or function returns, ALEF will promote)6 1643(type promotion. Under assignment, function parameter evaluation)6 2677 2 720 1992 t (an unnamed member of a complex type into the type of the lefthand side, formal parameter or function.)17 4128 1 720 2112 t 10 B f (4. Declarations)1 663 1 720 2352 t 10 R f ( declaration which)2 781( A)1 144( not reserve storage.)3 869(A declaration attaches a type to an identifier; it need)9 2276 4 970 2508 t (reserves storage is called a definition. A program consists of a list of declarations:)13 3272 1 720 2628 t 10 I f (program:)1330 2808 w (declaration\255list)1580 2928 w (declaration\255list:)1330 3168 w (declaration)1580 3288 w (declaration\255list declaration)1 1103 1 1580 3408 t 10 R f ( function, a type)3 673(A declaration can define a simple variable, a function, a prototype to a function, an ADT)15 3647 2 720 3588 t (specification or a type definition:)4 1326 1 720 3708 t 10 I f (declaration:)1330 3888 w (simple\255declarations)1580 4008 w (type\255declaration)1580 4128 w (type\255definition)1580 4248 w (function\255declaration)1580 4368 w 10 B f ( declarations)1 547(4.1. Simple)1 495 2 720 4668 t 10 R f ( declaration consists of a type specifier and a list of identifiers. Each identifier may be quali\255)16 3706(A simple)1 364 2 970 4824 t (fied by deriving operators. Simple declarations at the file scope may be initialised.)12 3290 1 720 4944 t 10 I f (simple\255declarations:)1330 5124 w (type\255specifier simple\255decl\255list)1 1184 1 1580 5244 t 10 CW f (;)2789 5244 w 10 I f (simple\255decl\255list:)1330 5484 w (simple\255declaration)1580 5604 w (simple\255decl\255list , simple\255declaration)2 1446 1 1580 5724 t (simple\255declaration:)1330 5964 w (pointer)1580 6084 w 8 I f (opt)1869 6134 w 10 I f (identifier array\255spec)1 824 1 1996 6084 t 8 I f (opt)2820 6134 w 10 I f (pointer)1580 6204 w 8 I f (opt)1869 6254 w 10 I f (identifier array\255spec)1 824 1 1996 6204 t 8 I f (opt)2820 6254 w 10 CW f (=)2947 6204 w 10 I f (initialiser\255list)3032 6204 w (pointer:)1330 6444 w 10 CW f (*)1580 6564 w 10 I f (pointer)1580 6684 w 10 CW f (*)1894 6684 w 10 I f (array\255spec:)1330 6924 w 10 CW f ([)1580 7044 w 10 I f (constant\255expression)1665 7044 w 10 CW f (])2489 7044 w ([)1580 7164 w 10 I f (constant\255expression)1665 7164 w 10 CW f (])2489 7164 w 10 I f (array\255spec)2574 7164 w cleartomark showpage saveobj restore %%EndPage: 5 5 %%Page: 6 6 /saveobj save def mark 6 pagesetup 10 R f (\255 6 \255)2 166 1 2797 480 t 10 B f ( Specifiers)1 441(4.2. Array)1 460 2 720 840 t 10 R f ( an array must be non\255zero positive constant. Arrays have a lower bound of 0 and)15 3353(The dimension of)2 717 2 970 996 t (an upper bound of)3 729 1 720 1116 t 10 CW f (n\2551)1474 1116 w 10 R f (. Where)1 340 1 1654 1116 t 10 CW f (n)2019 1116 w 10 R f (is the bound specified by the constant expression.)7 1981 1 2104 1116 t 10 B f ( Specifiers)1 441(4.3. Type)1 417 2 720 1356 t 10 I f (type\255specifier:)1330 1572 w (storage\255class)1580 1692 w 8 I f (opt)2113 1742 w 10 I f (type)2240 1692 w (type:)1330 1932 w 10 CW f (byte)1580 2052 w (int)1580 2172 w (uint)1580 2292 w (sint)1580 2412 w (usint)1580 2532 w (lint)1580 2652 w (ulint)1580 2772 w (void)1580 2892 w (float)1580 3012 w 10 I f (typename)1580 3132 w (channel\255specifier)1580 3252 w (storage\255class:)1330 3492 w 10 CW f (intern)1580 3612 w (extern)1580 3732 w 10 I f (channel\255specifier:)1330 3972 w 10 CW f (chan \()1 325 1 1580 4092 t 10 I f (chan\255type)1930 4092 w 10 CW f (\))2348 4092 w 10 I f (buffer\255spec)2433 4092 w 8 I f (opt)2882 4142 w 10 I f (buffer\255spec:)1330 4332 w 10 CW f ([)1580 4452 w 10 I f (constant\255expression)1665 4452 w 10 CW f (])2489 4452 w 10 R f ( to declarations)2 616( classes may only be applied)5 1150( Storage)1 357(The storage class controls the scope of the declaration.)8 2197 4 720 4632 t ( scope of a definition qualified with)6 1534( The)1 223(at the file scope.)3 708 3 720 4752 t 10 CW f (intern)3228 4752 w 10 R f ( by)1 142(is file. A declaration qualified)4 1267 2 3631 4752 t 10 CW f (extern)720 4872 w 10 R f (references a definition in this or another file.)7 1779 1 1105 4872 t 10 I f (Typename)970 5028 w 10 R f (is an identifier defined by a complex type declaration or a)10 2306 1 1405 5028 t 10 CW f (typedef)3736 5028 w 10 R f (statement.)4181 5028 w 10 B f ( Type Specification)2 817(4.3.1. Channel)1 637 2 720 5268 t 10 I f (chan\255type:)1330 5484 w (basic)1580 5604 w (basic)1580 5724 w 10 CW f (,)1816 5724 w 10 I f (chan\255type)1901 5724 w (basic:)1330 5964 w (type pointer)1 480 1 1580 6084 t 8 I f (opt)2060 6134 w 10 R f (The type specified by a)4 935 1 720 6264 t 10 CW f (chan)1681 6264 w 10 R f ( anonymous type)2 687(declaration is actually a pointer to an internal object with an)10 2406 2 1947 6264 t ( defined in declarations; instead)4 1270( of their anonymity, objects of this special type cannot be)10 2299(specifier. Because)1 751 3 720 6384 t (they must be created by an)5 1092 1 720 6504 t 10 CW f (alloc)1842 6504 w 10 R f (statement referring to a)3 943 1 2172 6504 t 10 CW f (chan)3146 6504 w 10 R f ( channel declaration without a buffer)5 1501(. A)1 153 2 3386 6504 t ( on the channel will)4 800( sending values)2 624( Threads)1 375(specification produces a synchronous communication channel.)5 2521 4 720 6624 t ( a value is passed)4 705( two threads rendezvous and)4 1144( The)1 207(block until some other thread receives from the channel.)8 2264 4 720 6744 t ( The)1 225( produced.)1 441(between sender and receiver. If buffers are specified then an asynchronous channel is)12 3654 3 720 6864 t 10 I f (constant\255expression)720 6984 w 10 R f (defines the number of buffers to be allocated. A send operation will complete immedi\255)13 3494 1 1546 6984 t ( all buffers are in use. A receive operation will block)10 2113(ately while buffers are available. A thread will block if)9 2207 2 720 7104 t ( and deallocate the buffer. Any)5 1320(if no value is buffered. If a value is buffered the receive will complete)13 3000 2 720 7224 t cleartomark showpage saveobj restore %%EndPage: 6 6 %%Page: 7 7 /saveobj save def mark 7 pagesetup 10 R f (\255 7 \255)2 166 1 2797 480 t (senders waiting for buffers will then be allowed to continue.)9 2407 1 720 840 t (Values of)1 386 1 970 996 t 10 I f (chan\255type)1382 996 w 10 R f ( using the channel for communication. If)6 1640(are passed between threads)3 1085 2 1801 996 t 10 I f (chan\255type)4553 996 w 10 R f (is)4973 996 w (a comma separated list of types the channel supplies a .)10 2240 1 720 1116 t 10 I f (variant)2960 1116 w 10 R f ( allows messages)2 692(protocol A variant protocol)3 1099 2 3249 1116 t ( of the)2 275( form)1 228( A)1 131(to be demultiplexed by type during a receive operation.)8 2282 4 720 1236 t 10 CW f (alt)3671 1236 w 10 R f (statement allows the control)3 1154 1 3886 1236 t (flow to be modified based on the type of a value received from a channel supplying a variant protocol.)18 4089 1 720 1356 t 10 B f (4.4. Initialisers)1 656 1 720 1596 t 10 R f (Only simple declarations at the file scope may be initialised.)9 2414 1 970 1752 t 10 I f (initialiser\255list:)1330 1932 w (constant\255expression)1580 2052 w 10 CW f ([)1580 2172 w 10 I f (constant\255expression)1665 2172 w 10 CW f (])2489 2172 w 10 I f (constant\255expression)2574 2172 w 10 CW f ({)1580 2292 w 10 I f (initialiser\255list)1665 2292 w 10 CW f (})2236 2292 w 10 I f (initialiser\255list , initialiser\255list)2 1167 1 1580 2412 t 10 R f ( consists of a)3 555(An initialisation)1 659 2 720 2592 t 10 I f (constant\255expression)1971 2592 w 10 R f (or a list of constant\255expressions separated by commas)7 2233 1 2807 2592 t ( each level of nest\255)4 769( array or complex type requires an explicit set of braces for)11 2412( An)1 177(and enclosed by braces.)3 962 4 720 2712 t ( components of a variable need not be explicitly initialised; uninitialised elements are set to)14 3820( the)1 158(ing. All)1 342 3 720 2832 t ( members)1 400(zero. ADT types are initialised in the same way as aggregates with exception of ADT function)15 3920 2 720 2952 t ( supply\255)1 329( of sparse arrays can be initialised by)7 1498( Elements)1 425(which are ignored for the purposes of initialisation.)7 2068 4 720 3072 t (ing a bracketed index for an element. Successive elements without the index notation continue to initialise)15 4320 1 720 3192 t (the array in sequence. For example:)5 1424 1 720 3312 t 9 CW f (char a[256] = {)3 810 1 1440 3482 t ( Set element 97 to 65 */)6 1296( /*)1 324(['a'] 'A',)1 648 3 2304 3592 t ( Set element 98 to 66 */)6 1296( /*)1 324(['a'+1] 'B',)1 648 3 2304 3702 t ( Set element 99 to 67 */)6 1296('C' /*)1 540 2 2736 3812 t (};)1440 3922 w 10 R f (If the dimensions of the array are omitted from the)9 2048 1 720 4102 t 10 I f (array\255spec)2796 4102 w 10 R f ( each dimension)2 657(the compiler sets the size of)5 1127 2 3256 4102 t (to be large enough to accommodate the initialisation. The size of the array can be found using)16 3746 1 720 4222 t 10 CW f (sizeof)4491 4222 w 10 R f (.)4851 4222 w 10 B f ( Declarations)1 563(4.5. Type)1 417 2 720 4462 t 10 R f ( introduces an identifier representing that type into the lan\255)9 2385(A type declaration creates a new type and)7 1685 2 970 4618 t (guage.)720 4738 w 10 I f (type\255declaration:)1330 4918 w (complex typename)1 739 1 1580 5038 t 10 CW f ({)2344 5038 w 10 I f (memberlist)2429 5038 w 10 CW f (} ;)1 145 1 2898 5038 t 10 I f (complex)1580 5158 w 10 CW f ({)1937 5158 w 10 I f (memberlist)2022 5158 w 10 CW f (})2491 5158 w 10 I f (decl\255tag)2576 5158 w 10 CW f (;)2928 5158 w 10 I f (complex typename)1 739 1 1580 5278 t 10 CW f ({)2344 5278 w 10 I f (memberlist)2429 5278 w 10 CW f (})2898 5278 w 10 I f (decl\255tag)2983 5278 w 10 CW f (;)3335 5278 w 10 I f (enumeration\255type)1580 5398 w (tupletype)1580 5518 w (complex:)1330 5758 w 10 CW f (adt)1580 5878 w (aggr)1580 5998 w (union)1580 6118 w 10 I f (decl\255tag:)1330 6358 w (identifier)1580 6478 w (tupletype:)1330 6718 w 10 CW f (tuple)1580 6838 w 8 I f (opt)1880 6888 w 10 CW f (\()2032 6838 w 10 I f (typelist)2117 6838 w 10 CW f (\))2431 6838 w 10 I f (typelist:)1330 7078 w (typelist)1580 7198 w 10 CW f (,)1894 7198 w 10 I f (type\255declaration)1979 7198 w cleartomark showpage saveobj restore %%EndPage: 7 7 %%Page: 8 8 /saveobj save def mark 8 pagesetup 10 R f (\255 8 \255)2 166 1 2797 480 t ( member may be a complex type, a derived type or)10 2046( Each)1 251( of a list of members.)5 859(A complex type is composed)4 1164 4 720 840 t ( are referenced by tag or by type. Members without tags are called unnamed.)13 3334( Members)1 448(a basic type.)2 538 3 720 960 t ( assignment or when supplied as)5 1311(Unnamed members are referenced by type or by implicit promotion during)10 3009 2 720 1080 t ( type declaration must have either a type name or a tag.)11 2206( A)1 122(function arguments.)1 799 3 720 1200 t 10 I f (memberlist:)1330 1380 w (member)1580 1500 w (memberlist member)1 790 1 1580 1620 t (member:)1330 1860 w (tname pointer)1 558 1 1580 1980 t 8 I f (opt)2138 2030 w 10 I f (decl\255tag array\255spec)1 784 1 2265 1980 t 8 I f (opt)3049 2030 w 10 CW f (;)3176 1980 w 10 I f (tname decl\255tag)1 596 1 1580 2100 t 10 CW f (\()2201 2100 w 10 I f (arglist)2286 2100 w 10 CW f (\) ;)1 145 1 2573 2100 t 10 I f (tname)720 2280 w 10 R f (is one of the basic types or a new type introduced by)11 2187 1 997 2280 t 10 CW f (aggr)3217 2280 w 10 R f (,)3457 2280 w 10 CW f (adt)3515 2280 w 10 R f (,)3695 2280 w 10 CW f (union)3754 2280 w 10 R f (, or)1 142 1 4054 2280 t 10 CW f (typedef)4230 2280 w 10 R f ( tuple)1 234(. A)1 156 2 4650 2280 t ( may only be addressed by assignment into)7 1725( Tuples)1 323( are all unnamed.)3 690(type is a complex type whose members)6 1582 4 720 2400 t (other complex types or an l\255valued tuple expression. For example:)9 2646 1 720 2520 t 9 CW f (\(int, byte*\))1 648 1 1440 2690 t (func\(\))1440 2800 w ({)1440 2910 w (return \(10, "hello"\);)2 1134 1 1872 3020 t (})1440 3130 w (void)1440 3350 w (main\(\))1440 3460 w ({)1440 3570 w (int a;)1 540 1 1872 3680 t (byte *str;)1 702 1 1872 3790 t (\(a, str\) = func\(\);)3 972 1 1872 4010 t (})1440 4120 w 10 R f (This example demonstrates multiple return values. The return type of)9 2777 1 720 4300 t 10 CW f (func)3523 4300 w 10 R f (is a complex type consisting of)5 1251 1 3789 4300 t ( returned by)2 510(three integers. The tuple type)4 1227 2 720 4420 t 10 CW f (func)2496 4420 w 10 R f (will match any other complex type consisting of three)8 2265 1 2775 4420 t ( the following is legal:)4 900( So)1 156(arithmetic types.)1 666 3 720 4540 t 9 CW f (aggr T)1 324 1 1440 4710 t ({)1440 4820 w (int a;)1 324 1 1872 4930 t (byte b;)1 378 1 1872 5040 t (float c;)1 432 1 1872 5150 t (};)1440 5260 w (void)1440 5480 w (main\(\))1440 5590 w ({)1440 5700 w (\(a, b, c\) = func\(\);)4 1026 1 1872 5810 t (})1440 5920 w 10 B f ( Data Types)2 511(4.6. Abstract)1 571 2 720 6220 t 10 R f ( both storage for members, like an aggregate, and the operations)10 2601(An abstract data type \(ADT\) defines)5 1469 2 970 6376 t ( to the members of an abstract data type is restricted to enforce a)13 2587( Access)1 333(that can be performed on that type.)6 1400 3 720 6496 t ( The mechanism is designed to encourage modular program design and pro\255)11 3135(policy of information hiding.)3 1185 2 720 6616 t ( data type depends on their type. By)7 1465( scope of the members of an abstract)7 1495( The)1 210(vide clean library interfaces.)3 1150 4 720 6736 t ( member functions. Members can be explicitly)6 1909(default access to members that define data is limited to the)10 2411 2 720 6856 t (exported from the type using the)5 1336 1 720 6976 t 10 CW f (extern)2088 6976 w 10 R f ( declaration. Member functions are)4 1423(storage class in the member)4 1137 2 2480 6976 t ( data members. Access to a member function may be)9 2211(visible by default, that is the opposite behaviour of)8 2109 2 720 7096 t ( functions by qualifying the declaration with the)7 1923(restricted to other member)3 1059 2 720 7216 t 10 CW f (intern)3727 7216 w 10 R f ( four)1 191( The)1 205(storage class.)1 532 3 4112 7216 t cleartomark showpage saveobj restore %%EndPage: 8 8 %%Page: 9 9 /saveobj save def mark 9 pagesetup 10 R f (\255 9 \255)2 166 1 2797 480 t (combinations are:)1 713 1 720 840 t 9 CW f (adt Point)1 486 1 1440 1010 t ({)1440 1120 w ( Access by member functions only */)6 1890( /*)1 864(int x;)1 540 3 2304 1230 t ( Access by everybody */)4 1242( /*)1 864( y;)1 378(extern int)1 594 4 1872 1340 t ( Access by everybody */)4 1242( /*)1 432(Point set\(Point*\);)1 972 3 2304 1560 t ( Access only from Point.set */)5 1620( /*)1 486( tst\(Point\);)1 648(intern Point)1 702 4 1872 1670 t (};)1440 1780 w 10 R f ( form a unique name for the function, so the same)10 1998(Member functions are defined by type and name. The pair)9 2322 2 720 1960 t ( the last example, the member function)6 1646( Using)1 304( be used in many types.)5 1013(member function name can)3 1137 4 720 2080 t 10 CW f (set)4860 2080 w 10 R f (could be defined as:)3 801 1 720 2200 t 9 CW f (Point)1440 2370 w (Point.set\(Point *a\))1 1026 1 1440 2480 t ({)1440 2590 w ( Set the value of the point to zero */)9 2052( /*)1 486(a\255>x = 0;)2 486 3 1872 2700 t (a\255>y = 0;)2 486 1 1872 2810 t (return *a;)1 540 1 1872 3030 t (})1440 3140 w 10 R f ( the first argument of)4 867( If)1 122( may be passed to a member function.)7 1556(An implicit pointer to the abstract data type)7 1775 4 720 3320 t ( the * precedes the name\))5 1041(the member function declaration in the ADT specification is `* typename' \(Note)11 3279 2 720 3440 t (the first parameter is passed implicitly.)5 1554 1 720 3560 t 9 CW f (adt Point)1 486 1 1440 3730 t ({)1440 3840 w (int x;)1 540 1 2304 3950 t ( y;)1 378(extern int)1 594 2 1872 4060 t ( Pass &Point as first argument */)6 1782( /*)1 432(Point set\(*Point\);)1 972 3 2304 4280 t ( tst\(Point\);)1 648(intern Point)1 702 2 1872 4390 t (};)1440 4500 w (void)1440 4720 w (func\(\))1440 4830 w ({)1440 4940 w (Point p;)1 432 1 1872 5050 t ( Set receives &p as first argument */)7 1998(p.set\(\); /*)1 972 2 1872 5270 t (})1440 5380 w 10 R f ( an unnamed substruc\255)3 934(The implicit parameter passing mechanism is particularly useful when the ADT is)11 3386 2 720 5560 t (ture. The receiving function is defined as:)6 1666 1 720 5680 t 9 CW f (void)1440 5850 w (Point.set\(Point *p\))1 1026 1 1440 5960 t ({)1440 6070 w (...)1872 6180 w (};)1440 6290 w 10 B f ( Types)1 281(4.7. Enumeration)1 767 2 720 6590 t cleartomark showpage saveobj restore %%EndPage: 9 9 %%Page: 10 10 /saveobj save def mark 10 pagesetup 10 R f (\255 10 \255)2 216 1 2772 480 t 10 I f (enumeration\255type:)1330 900 w 10 CW f (enum)1580 1020 w 10 I f (typename)1845 1020 w 10 CW f ({)2252 1020 w 10 I f (enum\255list)2337 1020 w 10 CW f (} ;)1 145 1 2734 1020 t 10 I f (enum\255list:)1330 1260 w (identifier)1580 1380 w (identifier)1580 1500 w 10 CW f (=)1972 1500 w 10 I f (constant\255expression)2057 1500 w (enum\255list , enum\255list)2 819 1 1580 1620 t 10 R f ( members of an enumera\255)4 1043( The)1 211( limited to a set of integer constants.)7 1491(Enumerations are types whose value is)5 1575 4 720 1800 t ( con\255)1 209( Enumeration)1 573( to integer variables.)3 836( variables are equivalent)3 996( Enumeration)1 574(tion are called enumerators.)3 1132 6 720 1920 t ( undefined the)2 583(stants may appear wherever an integer constant is legal. If the values of the enumerators are)15 3737 2 720 2040 t ( constant, values are)3 845(compiler assigns incrementing values from 0. If a value is given to an enumeration)13 3475 2 720 2160 t (assigned to the following enumerators by incrementing the value for each successive member until the next)15 4320 1 720 2280 t (assigned value is reached.)3 1036 1 720 2400 t 10 B f ( Definition)1 453(4.8. Type)1 417 2 720 2640 t 10 R f ( renamed, and forward referenc\255)4 1313(Type definition allows derived types to be named, basic types to be)11 2757 2 970 2796 t (ing between complex types.)3 1115 1 720 2916 t 10 I f (type\255definition:)1330 3096 w 10 CW f (typedef)1580 3216 w 10 I f (tname identifier;)1 669 1 2025 3216 t 10 R f (A)720 3396 w 10 CW f (typedef)821 3396 w 10 R f ( does not per\255)3 561( ALEF)1 305( types with mututally dependent pointers.)5 1680(is required to declare complex)4 1224 4 1270 3396 t (mit mutually dependent complex types; only references between them. For example:)10 3381 1 720 3516 t 9 CW f (typedef aggr A;)2 810 1 1440 3686 t (aggr B)1 324 1 1440 3906 t ({)1440 4016 w (A *aptr;)1 756 1 1872 4126 t (B *bptr;)1 756 1 1872 4236 t (})1440 4346 w (aggr A)1 324 1 1440 4566 t ({)1440 4676 w (A *aptr;)1 756 1 1872 4786 t (B *bptr;)1 756 1 1872 4896 t (})1440 5006 w 10 B f ( Declarations)1 563(4.9. Function)1 584 2 720 5306 t 10 R f ( three forms of function declaration: function definition, prototype declaration, and function)11 3691(There are)1 379 2 970 5462 t (pointer declaration.)1 776 1 720 5582 t cleartomark showpage saveobj restore %%EndPage: 10 10 %%Page: 11 11 /saveobj save def mark 11 pagesetup 10 R f (\255 11 \255)2 216 1 2772 480 t 10 I f (function\255declaration:)1330 900 w (type\255specifier identifier)1 935 1 1580 1020 t 10 CW f (\()2540 1020 w 10 I f (arglist)2625 1020 w 10 CW f (\))2912 1020 w 10 I f (block)2997 1020 w (type\255specifier function\255id)1 1007 1 1580 1140 t 10 CW f (\()2612 1140 w 10 I f (arglist)2697 1140 w 10 CW f (\) ;)1 145 1 2984 1140 t 10 I f (type\255specifier)1580 1260 w 10 CW f (\()2148 1260 w 10 I f (function\255id)2233 1260 w 10 CW f (\) \()1 145 1 2697 1260 t 10 I f (arglist)2867 1260 w 10 CW f (\) ;)1 145 1 3154 1260 t 10 I f (function\255id:)1330 1500 w (pointer)1580 1620 w 8 I f (opt)1869 1670 w 10 I f (identifier array\255spec)1 824 1 1996 1620 t 8 I f (opt)2820 1670 w 10 I f (adt\255function)1580 1740 w (adt\255function:)1330 1980 w (typename)1580 2100 w 10 CW f (.)1987 2100 w 10 I f (decl\255tag)2072 2100 w (arglist:)1330 2340 w (arg)1580 2460 w (pointer type)1 480 1 1580 2580 t (arglist , arg)2 476 1 1580 2700 t (arg:)1330 2940 w (type)1580 3060 w (type pointer)1 480 1 1580 3180 t (type)1580 3300 w 10 CW f (\()1771 3300 w 10 I f (pointer)1856 3300 w 10 CW f (\) \()1 145 1 2170 3300 t 10 I f (arglist)2340 3300 w 10 CW f (\))2627 3300 w 10 I f (type simple\255declaration)1 946 1 1580 3420 t 10 CW f (...)1580 3540 w 10 R f ( for the corresponding variable is pro\255)6 1543(If a formal parameter is declared without an identifier no declaration)10 2777 2 720 3720 t (duced in the function body.)4 1096 1 720 3840 t 10 B f (5. Expressions)1 637 1 720 4080 t 10 R f (The order of expression evaluation is not defined except where noted. That is, unless the definition of)16 4070 1 970 4236 t (the operator guarantees evaluation order, an operator may evaluate any of its operands first.)13 3654 1 720 4356 t ( arithmetic overflow and floating)4 1384(The behaviour of exceptional conditions such as divide by zero,)9 2686 2 970 4512 t (point exceptions is not defined.)4 1252 1 720 4632 t 10 B f ( Generation)1 508(5.1. Pointer)1 516 2 720 4872 t 10 R f ( returning T' and `array of T' are rewritten to produce)10 2278(References to expressions of type `function)5 1792 2 970 5028 t (pointers to either the function or the first element of the array. That is `function returning T' becomes)17 4320 1 720 5148 t (`pointer to function returning T' and `array of T' becomes `pointer to the first element of array T'.)17 3918 1 720 5268 t 10 B f ( Expressions)1 537(5.2. Primary)1 560 2 720 5508 t 10 R f (Primary expressions are identifiers, constants or parenthesised expressions:)7 3006 1 970 5664 t 10 I f (primary\255expression:)1330 5844 w (identifier)1580 5964 w (constant)1580 6084 w 10 CW f (...)1580 6204 w (nil)1580 6324 w (\()1580 6444 w 10 I f (expression)1665 6444 w 10 CW f (\))2117 6444 w 10 I f (tuple)1580 6564 w 10 R f ( are referenced using)3 910(The parameters received by a function taking variable arguments)8 2793 2 720 6744 t 10 CW f ('...'.)4474 6744 w 10 R f (The)4885 6744 w (primary\255expression)720 6864 w 10 CW f ('...')1530 6864 w 10 R f ( first location)2 549( value points at the)4 791( The)1 214(yields a value of type `pointer to void'.)7 1622 4 1864 6864 t ( primary\255expression)1 816( The)1 220(after the formal parameters.)3 1152 3 720 6984 t 10 CW f (nil)2948 6984 w 10 R f ( type `pointer to void' of)5 1065(returns a pointer of)3 807 2 3168 6984 t (value 0 which is guaranteed not to point at an object.)10 2111 1 720 7104 t cleartomark showpage saveobj restore %%EndPage: 11 11 %%Page: 12 12 /saveobj save def mark 12 pagesetup 10 R f (\255 12 \255)2 216 1 2772 480 t 10 B f (6. Tuples)1 415 1 720 840 t 10 R f (A)970 996 w 10 CW f (tuple)1084 996 w 10 R f ( used in the place of an)6 1028(is a collection of types forming a single object which can be)11 2586 2 1426 996 t (unnamed complex type. The individual members of a tuple can only be accessed by assignment.)14 3844 1 720 1116 t 10 I f (tuple:)1330 1296 w 10 CW f (\()1580 1416 w 10 I f (tlist)1665 1416 w 10 CW f (\))1841 1416 w 10 I f (tlist:)1330 1656 w (tlist)1580 1776 w 10 CW f (,)1756 1776 w 10 I f (expression)1841 1776 w 10 R f ( in automatics\))2 598(When the declaration of a tuple would be ambiguous because of the parenthesis \(for instance)14 3722 2 720 1956 t (use the keyword tuple:)3 907 1 720 2076 t 9 CW f (void)1008 2246 w (f\(\))1008 2356 w ({)1008 2466 w (int a;)1 324 1 1440 2576 t (tuple \(int, byte, Rectangle\) b;)4 1674 1 1440 2686 t (int c;)1 324 1 1440 2796 t (})1008 2906 w 10 R f ( of tuple expressions is performed by matching the)8 2049(Type checking)1 592 2 720 3086 t 10 I f (shape)3389 3086 w 10 R f (of each of the component types. A)6 1390 1 3650 3086 t 10 CW f (tuple)720 3206 w 10 R f (will match another)2 753 1 1047 3206 t 10 CW f (tuple)1827 3206 w 10 R f ( of the tuple could legally be)6 1149(or complex type if each individual member)6 1737 2 2154 3206 t (assigned to its corresponding member under the rules of assignment.)9 2741 1 720 3326 t 10 B f ( Expressions)1 537(6.1. Postfix)1 494 2 720 3566 t 10 I f (postfix\255expression:)1330 3746 w (primary\255expression)1580 3866 w (postfix\255expression)1580 3986 w 10 CW f ([)2332 3986 w 10 I f (expression)2417 3986 w 10 CW f (])2869 3986 w 10 I f (postfix\255expression)1580 4106 w 10 CW f (\()2332 4106 w 10 I f (argument\255list)2417 4106 w 10 CW f (\))2981 4106 w 10 I f (postfix\255expression)1580 4226 w 10 CW f (.)2332 4226 w 10 I f (tag)2417 4226 w (postfix\255expression)1580 4346 w 10 CW f (\255>)2332 4346 w 10 I f (tag)2477 4346 w (postfix\255expression)1580 4466 w 10 CW f (++)2332 4466 w 10 I f (postfix\255expression)1580 4586 w 10 CW f (\255\255)2332 4586 w 10 I f (postfix\255expression)1580 4706 w 10 CW f (?)2332 4706 w 10 I f (tag:)1330 4946 w (typename)1580 5066 w (identifier)1580 5186 w (argument\255list:)1330 5426 w (expression)1580 5546 w (argument\255list , expression)2 1041 1 1580 5666 t 10 B f ( Reference)1 450(6.1.1. Array)1 535 2 720 5966 t 10 R f ( expression followed by an expression enclosed in square brackets is an array indexing)13 3644(A primary)1 426 2 970 6122 t (operation. The expression is rewritten to be)6 1793 1 720 6242 t 10 I f (*\(\(postfix\255expression\)+\(expression\)\))2547 6242 w 10 R f ( of the expressions)3 773(. One)1 250 2 4017 6242 t (must be of type pointer; the other of integral type.)9 1992 1 720 6362 t 10 B f ( Calls)1 242(6.1.2. Function)1 659 2 720 6602 t 10 R f (The)970 6758 w 10 I f (postfix\255expression)1162 6758 w 10 R f (must yield a value of type `pointer to function'. A type declaration for the)13 3114 1 1926 6758 t ( declared prior to a function call. The declaration can be either the definition of the func\255)16 3634(function must be)2 686 2 720 6878 t ( specification must match the corresponding)5 1777( types of each argument in the)6 1209( The)1 206(tion or a function prototype.)4 1128 4 720 6998 t ( addition unnamed complex)3 1113( In)1 133( assignment.)1 500(expression type under the rules of promotion and conversion for)9 2574 4 720 7118 t ( example:)1 391( For)1 189(type members will be promoted automatically.)5 1865 3 720 7238 t cleartomark showpage saveobj restore %%EndPage: 12 12 %%Page: 13 13 /saveobj save def mark 13 pagesetup 10 R f (\255 13 \255)2 216 1 2772 480 t 9 CW f (aggr Test)1 486 1 1440 830 t ({)1440 940 w (int t;)1 540 1 1872 1050 t ( Unnamed substructure */)3 1296(Lock; /*)1 972 2 1872 1160 t (};)1440 1270 w ( Definition of complex Test */)5 1620( /*)1 918(Test yuk;)1 486 3 1440 1490 t ( Prototype for function lock */)5 1674( /*)1 486(void lock\(Lock*\);)1 918 3 1440 1600 t (void)1440 1820 w (main\(\))1440 1930 w ({)1440 2040 w ( address of Lock in Test is passed */)8 1998(lock\(&yuk\); /*)1 972 2 1872 2150 t (})1440 2260 w 10 B f ( Type References)2 731(6.1.3. Complex)1 658 2 720 2560 t 10 R f ( The first part of the expression must be a)9 1778(The operator . references a member of a complex type.)9 2292 2 970 2716 t 10 CW f (union)720 2836 w 10 R f (,)1020 2836 w 10 CW f (aggr)1073 2836 w 10 R f (or)1341 2836 w 10 CW f (adt)1452 2836 w 10 R f ( unnamed member)2 747( member may be specified by either name or type. Only one)11 2428(. The)1 233 3 1632 2836 t (of type)1 283 1 720 2956 t 10 I f (typename)1031 2956 w 10 R f ( referencing members by type, otherwise the refer\255)7 2049(is permitted in the complex type when)6 1550 2 1441 2956 t ( the reference is by)4 810( If)1 129(ence is ambiguous.)2 789 3 720 3076 t 10 I f (typename)2486 3076 w 10 R f (and no members of)3 807 1 2906 3076 t 10 I f (typename)3751 3076 w 10 R f (exist in the complex,)3 869 1 4171 3076 t (unnamed substructures will be searched breadth first. The operation)8 2756 1 720 3196 t 10 CW f (\255>)3507 3196 w 10 R f ( com\255)1 237(uses a pointer to reference a)5 1145 2 3658 3196 t (plex type member. The)3 989 1 720 3316 t 10 CW f (\255>)1754 3316 w 10 R f (operator follows the same search and type rules as . and is equivalent to)13 3121 1 1919 3316 t 10 I f (\(*postfix\255expression\).tag)720 3436 w 10 R f (.)1716 3436 w 10 B f ( Increment and Decrement)3 1144(6.1.4. Postfix)1 569 2 720 3676 t 10 R f (The postfix increment \()3 949 1 970 3832 t 10 CW f (++)1947 3832 w 10 R f (\) and decrement \()3 709 1 2095 3832 t 10 CW f (\255\255)2832 3832 w 10 R f ( value of expression, then add)5 1212(\) operators return the)3 848 2 2980 3832 t (or subtract 1 to the expression. The expression must be an l\255value of integral type.)14 3278 1 720 3952 t 10 B f ( Operators)1 463(6.2. Unary)1 472 2 720 4192 t 10 R f (The unary operators are:)3 977 1 970 4348 t 10 I f (unary\255expression:)1330 4528 w (postfix\255expression)1580 4648 w 10 CW f (++)1580 4768 w 10 I f (unary\255expression)1725 4768 w 10 CW f (\255\255)1580 4888 w 10 I f (unary\255expression)1725 4888 w (unary\255operator cast\255expression)1 1262 1 1580 5008 t 10 CW f (sizeof)1580 5128 w 10 I f (cast\255expression)1965 5128 w (unary\255operator: one of)2 921 1 1330 5368 t 10 CW f (<\255 ? *)2 440 1 1580 5488 t ( !)1 135( ~)1 85(+ \255)1 170 3 1580 5608 t 10 B f ( Increment and Decrement)3 1144(6.3. Prefix)1 460 2 720 5908 t 10 R f ( \()1 68(The prefix increment)2 860 2 970 6064 t 10 CW f (++)1933 6064 w 10 R f (\) and prefix decrement \()4 1003 1 2088 6064 t 10 CW f (\255\255)3126 6064 w 10 R f (\) operators add or subtract one to a)7 1458 1 3281 6064 t 10 I f (unary\255)4774 6064 w (expression)720 6184 w 10 R f (and return the new value. The)5 1191 1 1172 6184 t 10 I f (unary\255expression)2388 6184 w 10 R f (must be an l\255value of integral or pointer type.)8 1811 1 3106 6184 t 10 B f ( and Can Receive)3 741(6.4. Receive)1 526 2 720 6424 t 10 R f (The operator)1 515 1 970 6580 t 10 CW f (<\255)1513 6580 w 10 R f ( The)1 209(receives a value from a channel.)5 1304 2 1661 6580 t 10 I f (unary\255expression)3203 6580 w 10 R f (must be of type `channel of)5 1115 1 3925 6580 t ( channel.)1 360( type of the result will be T. A process or task will block until a value is available from the)20 3635(T'. The)1 325 3 720 6700 t (The prefix operator)2 775 1 720 6820 t 10 CW f (?)1520 6820 w 10 R f ( available for receive, 0 otherwise.)5 1381(returns 1 if a channel has a value)7 1310 2 1605 6820 t 10 I f (unary\255expression)4347 6820 w 10 R f (must be of type `channel of T'.)6 1239 1 720 6940 t cleartomark showpage saveobj restore %%EndPage: 13 13 %%Page: 14 14 /saveobj save def mark 14 pagesetup 10 R f (\255 14 \255)2 216 1 2772 480 t 10 B f ( send)1 220(6.5. Can)1 378 2 720 840 t 10 R f ( operator)1 370(The postfix)1 470 2 970 996 t 10 CW f (?)1848 996 w 10 R f (returns 1 if a thread can send on a channel without blocking, 0 otherwise.)13 3094 1 1946 996 t 10 I f (unary\255expression)720 1116 w 10 R f (must be of type `channel of T'.)6 1239 1 1438 1116 t (The prefix or postfix blocking test operator)6 1731 1 970 1272 t 10 CW f (?)2727 1272 w 10 R f ( a channel shared between)4 1054(is only reliable when used on)5 1173 2 2813 1272 t ( process may block after a successful)6 1551( A)1 134(tasks in a single process.)4 1033 3 720 1392 t 10 CW f (?)3475 1392 w 10 R f ( the pro\255)2 360(because the interleaving of)3 1108 2 3572 1392 t (cesses using the channel is undefined.)5 1514 1 720 1512 t 10 B f (6.6. Indirection)1 678 1 720 1752 t 10 R f (The unary operator)2 772 1 970 1908 t 10 CW f (*)1771 1908 w 10 R f ( operand must be of type)5 1015( The)1 210( operand.)1 376(retrieves the the value pointed to by its)7 1579 4 1860 1908 t ( result of the indirection is a value of type T.)10 1778( The)1 205(`pointer to T'.)2 563 3 720 2028 t 10 B f ( Plus and Minus)3 694(6.7. Unary)1 472 2 720 2268 t 10 R f (Unary plus is equivalent to)4 1205 1 970 2424 t 10 I f (\(0+\(unary\255expression\)\))2232 2424 w 10 R f ( equivalent to)2 610( minus is)2 426(. Unary)1 356 3 3175 2424 t 10 I f (\(0\255\(unary\255)4625 2424 w (expression\)\))720 2544 w 10 R f ( integral operand undergoes integral promotion. The result is the type of the promoted)13 3616(. An)1 211 2 1213 2544 t (operand.)720 2664 w 10 B f ( Negate)1 318(6.8. Bitwise)1 511 2 720 2904 t 10 R f (The operator)1 512 1 970 3060 t 10 CW f (~)1507 3060 w 10 R f (performs a bitwise negation of its operand, which must be of integral type.)12 2979 1 1592 3060 t 10 B f ( Negate)1 318(6.9. Logical)1 517 2 720 3300 t 10 R f (The operator)1 514 1 970 3456 t 10 CW f (!)1511 3456 w 10 R f ( If)1 119( its operand, which must of arithmetic or pointer type.)9 2183(performs logical negation of)3 1140 3 1598 3456 t ( operand is arithmetic)3 883(the operand is a pointer and its value is nil the result is integer 0, otherwise 1. If the)18 3437 2 720 3576 t (and the value is 0 the result is 0, otherwise the result is 1.)13 2284 1 720 3696 t 10 B f ( Operator)1 424(6.10. Sizeof)1 505 2 720 3936 t 10 R f (The)970 4092 w 10 CW f (sizeof)1163 4092 w 10 R f ( in bytes of its operand, which may be an expression or the)12 2517(operator yields the size)3 962 2 1561 4092 t ( The size is determined from the type of the operand, which is not itself evalu\255)15 3128(parenthesized name of a type.)4 1192 2 720 4212 t ( If)1 118(ated. The result is an integer constant.)6 1526 2 720 4332 t 10 CW f (sizeof)2391 4332 w 10 R f (is applied to a string constant the result is the number of)11 2262 1 2778 4332 t (bytes required to store the string including its terminating NUL byte or zero rune.)13 3257 1 720 4452 t 10 B f (6.11. Casts)1 483 1 720 4692 t 10 R f (A cast converts the result of an expression into a new type:)11 2354 1 970 4848 t 10 I f (cast\255expression:)1330 5028 w (unary\255expression)1580 5148 w 10 CW f (\()1580 5268 w 10 I f (type\255cast)1665 5268 w 10 CW f (\))2050 5268 w 10 I f (cast\255expression)2135 5268 w (cast\255type:)1330 5508 w (type pointer)1 480 1 1580 5628 t 10 B f ( Divide and Modulus)3 894(6.12. Multiply,)1 648 2 720 5928 t 10 R f (The multiplicative operators are:)3 1306 1 970 6084 t 10 I f (multiplicative\255expression:)1330 6264 w (cast\255expression)1580 6384 w (multiplicative\255expression)1580 6504 w 10 CW f (*)2615 6504 w 10 I f (multiplicative\255expression)2700 6504 w (multiplicative\255expression)1580 6624 w 10 CW f (/)2615 6624 w 10 I f (multiplicative\255expression)2700 6624 w (multiplicative\255expression)1580 6744 w 10 CW f (%)2615 6744 w 10 I f (multiplicative\255expression)2700 6744 w 10 R f (The operands of)2 650 1 720 6924 t 10 CW f (*)1396 6924 w 10 R f (and)1482 6924 w 10 CW f (/)1652 6924 w 10 R f ( type. The operands of)4 903(must have arithmetic)2 840 2 1738 6924 t 10 CW f (%)3508 6924 w 10 R f (must be of integral type. The opera\255)6 1445 1 3595 6924 t (tor)720 7044 w 10 CW f (/)867 7044 w 10 R f (yields the quotient,)2 786 1 963 7044 t 10 CW f (%)1785 7044 w 10 R f (the remainder and)2 742 1 1881 7044 t 10 CW f (*)2659 7044 w 10 R f (the product of the operands. If)5 1263 1 2755 7044 t 10 CW f (b)4054 7044 w 10 R f (is non\255zero then)2 665 1 4150 7044 t 10 CW f (a =)1 190 1 4850 7044 t (\(a/b\) + a%b)2 660 1 720 7164 t 10 R f (should always be true.)3 893 1 1405 7164 t cleartomark showpage saveobj restore %%EndPage: 14 14 %%Page: 15 15 /saveobj save def mark 15 pagesetup 10 R f (\255 15 \255)2 216 1 2772 480 t 10 B f ( and Subtract)2 584(6.13. Add)1 434 2 720 840 t 10 R f (The additive operators are:)3 1072 1 970 996 t 10 I f (additive\255expression:)1330 1176 w (multiplicative\255expression)1580 1296 w (additive\255expression)1580 1416 w 10 CW f (+)2387 1416 w 10 I f (multiplicative\255expression)2472 1416 w (additive\255expression)1580 1536 w 10 CW f (\255)2387 1536 w 10 I f (multiplicative\255expression)2472 1536 w 10 R f (The)720 1716 w 10 CW f (+)907 1716 w 10 R f ( be a pointer. If)4 644(operator computes the sum of its operands. Either one of the operands may)12 3076 2 999 1716 t 10 I f (P)4752 1716 w 10 R f (is an)1 194 1 4846 1716 t (expression yielding a pointer to type)5 1477 1 720 1836 t 10 I f (T)2226 1836 w 10 R f (then)2311 1836 w 10 I f (P+n)2512 1836 w 10 R f (is the same as)3 564 1 2720 1836 t 10 I f (p+\(sizeof\(T\)*n\).)3313 1836 w 10 R f (The)4026 1836 w 10 CW f (\255)4209 1836 w 10 R f (operator computes)1 743 1 4297 1836 t ( its operands. The first operand may be of pointer or arithmetic type. The second operand)15 3652(the difference of)2 668 2 720 1956 t ( If)1 126(must be of arithmetic type.)4 1114 2 720 2076 t 10 I f (P)1995 2076 w 10 R f (is an expression yielding a pointer of type)7 1743 1 2091 2076 t 10 I f (T)3869 2076 w 10 R f (then)3960 2076 w 10 I f (P\255n)4166 2076 w 10 R f (is the same as)3 579 1 4344 2076 t 10 I f (p\255)4957 2076 w (\(sizeof\(T\)*n\))720 2196 w 10 R f ( if)1 88(. Thus)1 277 2 1236 2196 t 10 I f (P)1628 2196 w 10 R f ( element of an array)4 809(is a pointer to an)4 674 2 1716 2196 t 10 I f (P+1)3227 2196 w 10 R f (will point to the next object in the array)8 1606 1 3434 2196 t (and)720 2316 w 10 I f (P\2551)889 2316 w 10 R f (will point to the previous object in the array.)8 1779 1 1058 2316 t 10 B f ( Operators)1 463(6.14. Shift)1 456 2 720 2556 t 10 R f (The shift Operators perform bitwise shifts:)5 1706 1 970 2712 t 10 I f (shift\255expression:)1330 2892 w (additive\255expression)1580 3012 w (shift\255expression)1580 3132 w 10 S f (<<)2238 3132 w 10 I f (additive\255expression)2373 3132 w (shift\255expression)1580 3252 w 10 S f (>>)2238 3252 w 10 I f (additive\255expression)2373 3252 w 10 R f (If the first operand is unsigned,)5 1323 1 720 3432 t 10 CW f (<<)2083 3432 w 10 R f ( logical left shift by)4 847(performs a)1 444 2 2243 3432 t 10 I f (additive\255expression)3575 3432 w 10 R f (bits. If the first)3 642 1 4398 3432 t (operand is signed,)2 750 1 720 3552 t 10 CW f (<<)1508 3552 w 10 R f (performs an arithmetic shift left by)5 1460 1 1666 3552 t 10 I f (additive\255expression)3164 3552 w 10 R f (bits. The)1 387 1 3983 3552 t 10 I f (shift\255expression)4407 3552 w 10 R f ( The)1 205(must be of integral type.)4 974 2 720 3672 t 10 CW f (>>)1924 3672 w 10 R f (operator is a right shift and follows the same rules as left shift.)12 2494 1 2069 3672 t 10 B f ( Operators)1 463(6.15. Relational)1 689 2 720 3912 t 10 R f (The values of expressions can be compared as follows:)8 2195 1 970 4068 t 10 I f (relational\255expression:)1330 4248 w (relational\255expression)1580 4368 w 10 CW f (<)2460 4368 w 10 I f (shift\255expression)2545 4368 w (relational\255expression)1580 4488 w 10 CW f (>)2460 4488 w 10 I f (shift\255expression)2545 4488 w (relational\255expression)1580 4608 w 10 S f (<)2460 4608 w 10 I f (= shift\255expression)1 726 1 2515 4608 t (relational\255expression)1580 4728 w 10 S f (>)2460 4728 w 10 I f (= shift\255expression)1 726 1 2515 4728 t 10 R f (The operators are)2 697 1 720 4908 t 10 CW f (<)1442 4908 w 10 R f (\(less than\),)1 438 1 1527 4908 t 10 CW f (>)1990 4908 w 10 R f (\(greater than\),)1 564 1 2075 4908 t 10 CW f (<=)2664 4908 w 10 R f (\(less than or equal to\) and)5 1039 1 2809 4908 t 10 CW f (>=)3874 4908 w 10 R f (\(greater than or equal to\).)4 1020 1 4020 4908 t ( value of the expression is 1 if the relation is true,)11 2019( The)1 209( or pointer type.)3 650(The operands must be of arithmetic)5 1442 4 720 5028 t ( pointer of type)3 631( A)1 128( arithmetic conversions are performed.)4 1567( usual)1 241( The)1 210(otherwise 0.)1 493 6 720 5148 t 10 CW f (void *)1 366 1 4021 5148 t 10 R f (or)4418 5148 w 10 CW f (nil)4532 5148 w 10 R f (may be)1 297 1 4743 5148 t ( compared to pointers of the same)6 1395( of any other type may only be)7 1279( Pointers)1 386(compared to any other pointer.)4 1260 4 720 5268 t (type.)720 5388 w 10 B f ( operators)1 435(6.16. Equality)1 618 2 720 5628 t 10 R f (The equality operators are:)3 1072 1 970 5784 t 10 I f (equality\255expression:)1330 5964 w (relational\255expression)1580 6084 w (relational\255expression)1580 6204 w 10 CW f (==)2460 6204 w 10 I f (equality\255expression)2605 6204 w (relational\255expression)1580 6324 w 10 CW f (!=)2460 6324 w 10 I f (equality\255expression)2605 6324 w 10 R f (The operators)1 551 1 720 6504 t 10 CW f (==)1296 6504 w 10 R f (\(equal to\) and)2 554 1 1441 6504 t 10 CW f (!=)2020 6504 w 10 R f (\(not equal\) follow the same rules as relational operators.)8 2248 1 2165 6504 t 10 B f ( Logic Operators)2 727(6.17. Bitwise)1 561 2 720 6744 t cleartomark showpage saveobj restore %%EndPage: 15 15 %%Page: 16 16 /saveobj save def mark 16 pagesetup 10 R f (\255 16 \255)2 216 1 2772 480 t 10 I f (AND\255expression:)1330 900 w (equality\255expression)1580 1020 w (AND\255expression)1580 1140 w 10 CW f (&)2265 1140 w 10 I f (equality\255expression)2350 1140 w (XOR\255expression:)1330 1380 w (AND\255expression)1580 1500 w (XOR\255expression)1580 1620 w 10 CW f (^)2259 1620 w 10 I f (AND\255expression)2344 1620 w (OR\255expression:)1330 1860 w (XOR\255expression)1580 1980 w (OR\255expression)1580 2100 w 10 CW f (|)2198 2100 w 10 I f (XOR\255expression)2283 2100 w 10 R f ( types. The operators are)4 999(The operators perform bitwise logical operations and apply only to integral)10 3031 2 720 2280 t 10 CW f (&)4779 2280 w 10 R f (\(bit\255)4868 2280 w (wise and\),)1 410 1 720 2400 t 10 CW f (^)1155 2400 w 10 R f (\(bitwise exclusive or\) and)3 1034 1 1240 2400 t 10 CW f (|)2299 2400 w 10 R f (\(bitwise inclusive or\).)2 874 1 2384 2400 t 10 B f ( Operators)1 463(6.18. Logical)1 567 2 720 2640 t 10 I f (logical\255AND\255expression:)1330 2856 w (OR\255expression)1580 2976 w (logical\255AND\255expression && OR\255expression)2 1770 1 1580 3096 t (logical\255OR\255expression:)1330 3336 w (logical\255AND\255expression)1580 3456 w (logical\255OR\255expression)1580 3576 w 10 S f (\357\357)2509 3576 w 10 I f (logical\255AND\255expression)2632 3576 w 10 R f (The)720 3756 w 10 CW f (&&)917 3756 w 10 R f ( The)1 223( of its operands evaluate to non\255zero, otherwise 0.)8 2134(operator returns 1 if both)4 1066 3 1079 3756 t 10 CW f (||)4545 3756 w 10 R f (operator)4708 3756 w ( guaranteed to evalu\255)3 839( operators are)2 544( Both)1 246(returns 1 if either of its operand evaluates to non\255zero, otherwise 0.)11 2691 4 720 3876 t ( component of the expression)4 1188(ate strictly left to right. Evaluation of the expression will cease as soon as any)14 3132 2 720 3996 t ( operands can be any mix of arithmetic and pointer types.)10 2293( The)1 205(evaluate to a 1.)3 604 3 720 4116 t 10 B f ( expressions)1 514(6.19. Constant)1 639 2 720 4356 t 10 R f ( which can be fully evaluated by the compiler during)9 2380(A constant expression is an expression)5 1690 2 970 4512 t 10 I f (translation)720 4632 w 10 R f (rather than at)2 526 1 1185 4632 t 10 I f (runtime)1736 4632 w 10 R f (.)2047 4632 w 10 I f (constant\255expression:)1330 4812 w (logical\255OR\255expression)1580 4932 w (constant\255expression)720 5112 w 10 R f (appears as part of initialisation, channel buffer specifications and array dimensions.)10 3482 1 1558 5112 t (The following operators may not be part of a constant expression: function calls, assignment, send, receive,)15 4320 1 720 5232 t ( computations using the)3 965( Address)1 381(increment and decrement.)2 1041 3 720 5352 t 10 CW f (&)3136 5352 w 10 R f ( is)1 97(\(address of\) operator on static declarations)5 1718 2 3225 5352 t (permitted.)720 5472 w 10 B f (6.20. Assignment)1 750 1 720 5712 t 10 R f (The assignment operators are:)3 1200 1 970 5868 t 10 I f (assignment\255expression:)1330 6048 w (logical\255OR\255expression)1580 6168 w (unary\255expression)1580 6288 w 10 CW f (<\255=)2298 6288 w 10 I f (assignment\255expression)2503 6288 w (unary\255expression assignment\255operator assignment\255expression)2 2486 1 1580 6408 t (unary\255expression)1580 6528 w 10 CW f (= \()1 145 1 2298 6528 t 10 I f (type\255cast)2468 6528 w 10 CW f (\))2853 6528 w 10 I f (tuple)2938 6528 w (assignment\255operator: one of)2 1138 1 1330 6768 t 10 CW f (= += *= /= %= &= |= ^= >>= <<=)9 1710 1 1580 6888 t 10 R f ( assignment allows the members of a com\255)7 1762( Compound)1 503( l\255value.)1 335(The left side of the expression must be an)8 1720 4 720 7068 t ( single statement. A compound assignment is formed by)8 2310(plex type to be assigned from a member list in a)10 2010 2 720 7188 t ( element of the tuple is evaluated in turn and assigned to its)12 2502( Each)1 260( complex type.)2 613(casting a tuple into the)4 945 4 720 7308 t cleartomark showpage saveobj restore %%EndPage: 16 16 %%Page: 17 17 /saveobj save def mark 17 pagesetup 10 R f (\255 17 \255)2 216 1 2772 480 t (corresponding element in the complex types. The usual conversions are performed for each assignment.)13 4144 1 720 840 t 9 CW f ( Read message to file system */)6 1674( /*)1 1134(aggr Readmesg)1 702 3 1440 1010 t ({)1440 1120 w (int fd;)1 594 1 1872 1230 t (void *data;)1 756 1 1872 1340 t (int len;)1 648 1 1872 1450 t (};)1440 1560 w (chan \(Readmsg\) filesys;)2 1242 1 1440 1780 t (int)1440 2000 w (read\(int fd, void *data, int len\))5 1782 1 1440 2110 t ({)1440 2220 w (/* Pack message parameters and send to file system */)9 2862 1 1872 2330 t (filesys <\255= \(Readmesg\)\(fd, data, len\);)4 2052 1 1872 2440 t (})1440 2550 w 10 R f ( may be discarded by placing)5 1177(If the left side of an assignment is a tuple, selected members)11 2418 2 720 2730 t 10 CW f (nil)4342 2730 w 10 R f (in the corre\255)2 491 1 4549 2730 t ( following example only the first and third integers returned)9 2475(sponding position in the the tuple list. In the)8 1845 2 720 2850 t (from)720 2970 w 10 CW f (func)939 2970 w 10 R f (are assigned.)1 515 1 1204 2970 t 9 CW f (\(int, int, int\) func\(\);)3 1242 1 1440 3140 t (void)1440 3360 w (main\(\))1440 3470 w ({)1440 3580 w (int a, c;)2 486 1 1872 3690 t (\(a, nil, c\) = func\(\);)4 1134 1 1872 3910 t (})1440 4020 w 10 R f (The)970 4236 w 10 CW f (<\255=)1175 4236 w 10 R f ( The)1 231( the right side into a channel.)6 1313(\(assign send\) operator sends the value of)6 1774 3 1405 4236 t 10 I f (unary\255)4774 4236 w (expression)720 4356 w 10 R f ( the left side of the expression is of type `channel of T', the)13 2453( If)1 123( `channel of T'.)3 641(must be of type)3 643 4 1180 4356 t (value transmitted down the channel is the same as if the expression were `object of type T = expression'.)18 4184 1 720 4476 t 10 B f (6.20.1. Promotion)1 780 1 720 4716 t 10 R f ( then assignment promotion is performed.)5 1676(If both sides of an assignment yield different complex types)9 2394 2 970 4872 t ( hand side is searched for an unnamed complex type under the same rules as the)15 3355(The type of the right)4 869 2 720 4992 t 10 CW f (.)4980 4992 w 10 R f ( matching type is found it is assigned to the left side. This promotion is also performed for)17 3762( a)1 77(operator. If)1 481 3 720 5112 t (function arguments.)1 799 1 720 5232 t 10 B f ( and Precedence)2 693(6.21. Binding)1 591 2 720 5472 t 10 R f (The binding and precedence of the operators is as follows:)9 2331 1 970 5628 t cleartomark showpage saveobj restore %%EndPage: 17 17 %%Page: 18 18 /saveobj save def mark 18 pagesetup 10 R f (\255 18 \255)2 216 1 2772 480 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 740 t 10 R f (binding operator)1 838 1 1199 860 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 880 t 10 R f (l to r)2 189 1 1257 1000 t 10 CW f (\(\) [] \255> .)3 780 1 1740 1000 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 1020 t 10 R f (r to l)2 189 1 1257 1140 t 10 CW f ( \255 * & \()4 720( +)1 120(! ~ ++ \255\255 <\255 ?)5 1140 3 1740 1140 t 10 I f (cast)3720 1140 w 10 CW f (\) sizeof)1 480 1 3881 1140 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 1160 t 10 R f (l to r)2 189 1 1257 1280 t 10 CW f (* / %)2 420 1 1740 1280 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 1300 t 10 R f (l to r)2 189 1 1257 1420 t 10 CW f (+ \255)1 240 1 1740 1420 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 1440 t 10 R f (l to r)2 189 1 1257 1560 t 10 CW f (<< >>)1 360 1 1740 1560 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 1580 t 10 R f (l to r)2 189 1 1257 1700 t 10 CW f (< <= > >=)3 720 1 1740 1700 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 1720 t 10 R f (l to r)2 189 1 1257 1840 t 10 CW f (== !=)1 360 1 1740 1840 t 10 S f (_ _____________________________________________________________________)1 3461 1 1149 1860 t 10 R f (l to r)2 189 1 1257 1980 t 10 CW f (&)1740 1980 w 10 S f (_ _____________________________________________________________________)1 3461 1 1149 2000 t 10 R f (l to r)2 189 1 1257 2120 t 10 CW f (^)1740 2120 w 10 S f (_ _____________________________________________________________________)1 3461 1 1149 2140 t 10 R f (l to r)2 189 1 1257 2260 t 10 CW f (|)1740 2260 w 10 S f (_ _____________________________________________________________________)1 3461 1 1149 2280 t 10 R f (l to r)2 189 1 1257 2400 t 10 CW f (&&)1740 2400 w 10 S f (_ _____________________________________________________________________)1 3461 1 1149 2420 t 10 R f (l to r)2 189 1 1257 2540 t 10 CW f (||)1740 2540 w 10 S f (_ _____________________________________________________________________)1 3461 1 1149 2560 t 10 R f (l to r)2 189 1 1257 2680 t 10 CW f (<\255= = += \255= *= /= %= = ^= |= <<= >>=)11 2820 1 1740 2680 t 10 S f ( \347)1 -3461(_ _____________________________________________________________________)1 3461 2 1149 2700 t (\347)1149 2640 w (\347)1149 2540 w (\347)1149 2440 w (\347)1149 2340 w (\347)1149 2240 w (\347)1149 2140 w (\347)1149 2040 w (\347)1149 1940 w (\347)1149 1840 w (\347)1149 1740 w (\347)1149 1640 w (\347)1149 1540 w (\347)1149 1440 w (\347)1149 1340 w (\347)1149 1240 w (\347)1149 1140 w (\347)1149 1040 w (\347)1149 940 w (\347)1149 840 w (\347)1605 2700 w (\347)1605 2640 w (\347)1605 2540 w (\347)1605 2440 w (\347)1605 2340 w (\347)1605 2240 w (\347)1605 2140 w (\347)1605 2040 w (\347)1605 1940 w (\347)1605 1840 w (\347)1605 1740 w (\347)1605 1640 w (\347)1605 1540 w (\347)1605 1440 w (\347)1605 1340 w (\347)1605 1240 w (\347)1605 1140 w (\347)1605 1040 w (\347)1605 940 w (\347)1605 840 w (\347)4610 2700 w (\347)4610 2640 w (\347)4610 2540 w (\347)4610 2440 w (\347)4610 2340 w (\347)4610 2240 w (\347)4610 2140 w (\347)4610 2040 w (\347)4610 1940 w (\347)4610 1840 w (\347)4610 1740 w (\347)4610 1640 w (\347)4610 1540 w (\347)4610 1440 w (\347)4610 1340 w (\347)4610 1240 w (\347)4610 1140 w (\347)4610 1040 w (\347)4610 940 w (\347)4610 840 w 10 B f (7. Statements)1 596 1 720 3000 t 10 R f (Statements are executed for effect, and do not yield values. Statements fall into one of several groups:)16 4070 1 970 3156 t 10 I f (statement:)1330 3336 w (label\255statement)1580 3456 w 10 CW f (:)2221 3456 w 10 I f (expression\255statement)1580 3576 w 10 CW f (;)2448 3576 w 10 I f (block\255statement)1580 3696 w (selection\255statement)1580 3816 w 10 CW f (;)2376 3816 w 10 I f (loop\255statement)1580 3936 w (jump\255statement)1580 4056 w (exception\255statement)1580 4176 w (process\255statement)1580 4296 w 10 CW f (;)2326 4296 w 10 I f (allocation\255statement)1580 4416 w 10 CW f (;)2427 4416 w 10 B f ( Statements)1 496(7.1. Label)1 445 2 720 4716 t 10 R f ( identifier labels the statement and may be used as)9 2032( The)1 208( by an identifier.)3 669(A statement may be prefixed)4 1161 4 970 4872 t (the destination of a)3 787 1 720 4992 t 10 CW f (goto)1540 4992 w 10 R f ( their own namespace and do not conflict)7 1693( and exception identifiers have)4 1257(. Label)1 310 3 1780 4992 t (with other names. Labels have function scope.)6 1852 1 720 5112 t 10 B f ( Statements)1 496(7.2. Expression)1 673 2 720 5352 t 10 R f ( null. Null expres\255)3 733(Most expressions statements are function calls or assignments. Expressions may be)10 3337 2 970 5508 t (sions are often useful as empty bodies to labels or iteration statements.)11 2819 1 720 5628 t 10 B f ( Statements)1 496(7.3. Block)1 445 2 720 5868 t 10 R f (Several statements may be grouped together to form a block. The body of a function is a block.)17 3802 1 970 6024 t cleartomark showpage saveobj restore %%EndPage: 18 18 %%Page: 19 19 /saveobj save def mark 19 pagesetup 10 R f (\255 19 \255)2 216 1 2772 480 t 10 I f (block:)1330 900 w 10 CW f ({)1580 1020 w 10 I f (autolist slist)1 488 1 1665 1020 t 10 CW f (})2178 1020 w (!{)1580 1140 w 10 I f (autolist slist)1 488 1 1725 1140 t 10 CW f (})2238 1140 w 10 I f (autolist:)1330 1380 w (declaration)1580 1500 w (autolist declaration)1 787 1 1580 1620 t (slist:)1330 1860 w (statement)1580 1980 w (slist statement)1 570 1 1580 2100 t 10 R f (An identifier declared in)3 1011 1 720 2280 t 10 I f (autolist)1767 2280 w 10 R f ( identifier)1 403( An)1 184( of the same identifier.)4 949(suspends any previous declaration)3 1400 4 2104 2280 t ( end of the block, after)5 968(may be declared only once per block. The declaration remains in force until the)13 3352 2 720 2400 t (which any suspended declaration comes back into effect.)7 2272 1 720 2520 t ( identifiers declared in)3 919(The value of)2 518 2 970 2676 t 10 I f (autolist)2440 2676 w 10 R f (is undefined at block entry and should be assigned to a)10 2266 1 2774 2676 t (known value after declaration but before use.)6 1803 1 720 2796 t (The symbol)1 483 1 970 2952 t 10 CW f (!{)1486 2952 w 10 R f ( Only one thread may be executing the statements con\255)9 2274(introduces a guarded block.)3 1127 2 1639 2952 t (tained in the guarded block at any instant.)7 1670 1 720 3072 t 10 B f ( Statements)1 496(7.4. Selection)1 583 2 720 3312 t 10 R f (Selection statements alter the flow of control based on the value of an expression.)13 3261 1 970 3468 t 10 I f (selection\255statement:)1330 3648 w 10 CW f (if \()1 205 1 1580 3768 t 10 I f (expression)1810 3768 w 10 CW f (\))2262 3768 w 10 I f (statement)2347 3768 w 10 CW f (else)2755 3768 w 10 I f (statement)3020 3768 w 10 CW f (if \()1 205 1 1580 3888 t 10 I f (expression)1810 3888 w 10 CW f (\))2262 3888 w 10 I f (statement)2347 3888 w 10 CW f (switch \()1 445 1 1580 4008 t 10 I f (expression)2050 4008 w 10 CW f (\))2502 4008 w 10 I f (cbody)2587 4008 w 10 CW f (alt)1580 4128 w 10 I f (cbody)1785 4128 w (cbody:)1330 4368 w 10 CW f ({)1580 4488 w 10 I f (caselist)1665 4488 w 10 CW f (})1990 4488 w (!{)1580 4608 w 10 I f (caselist)1725 4608 w 10 CW f (})2050 4608 w 10 I f (caselist:)1330 4848 w (case\255item)1580 4968 w (alt\255item)1580 5088 w (caselist case\255item)1 707 1 1580 5208 t (case\255item:)1330 5448 w 10 CW f (case)1580 5568 w 10 I f (constant\255expression : statement)2 1265 1 1845 5568 t 10 CW f (default)1580 5688 w 10 I f (: statement)1 441 1 2025 5688 t (alt\255item:)1330 5928 w 10 CW f (case)1580 6048 w 10 I f (expression : statement)2 893 1 1845 6048 t 10 R f (An)720 6228 w 10 CW f (if)878 6228 w 10 R f (statement first evaluates)2 987 1 1034 6228 t 10 I f (expression,)2057 6228 w 10 R f ( The)1 217( arithmetic or pointer type.)4 1116(which must yield a value of)5 1162 3 2545 6228 t (value of)1 328 1 720 6348 t 10 I f (expression)1077 6348 w 10 R f (is compared with 0. If it compares unequal)7 1736 1 1533 6348 t 10 I f (statement)3298 6348 w 10 R f (is executed. If an)3 690 1 3710 6348 t 10 CW f (else)4428 6348 w 10 R f (clause is)1 344 1 4696 6348 t ( the)1 156(supplied and the value compares equal)5 1584 2 720 6468 t 10 CW f (else)2494 6468 w 10 R f (statement will be executed. The)4 1303 1 2768 6468 t 10 CW f (else)4105 6468 w 10 R f (clause shows an)2 661 1 4379 6468 t (ambiguity in the grammar. The ambiguity is resolved by matching an)10 2793 1 720 6588 t 10 CW f (else)3540 6588 w 10 R f ( nearest)1 308(with the)1 327 2 3807 6588 t 10 CW f (if)4468 6588 w 10 R f (without an)1 426 1 4614 6588 t 10 CW f (else)720 6708 w 10 R f (at the same block level.)4 940 1 985 6708 t (The)970 6864 w 10 CW f (switch)1154 6864 w 10 R f (statement selects one of several statements. The)6 1934 1 1543 6864 t 10 I f (expression)3507 6864 w 10 R f (is evaluated and converted)3 1076 1 3964 6864 t (into an integer. The integer is compared with the value specified in each)12 2904 1 720 6984 t 10 CW f (case)3651 6984 w 10 R f ( the integers compare the)4 1007(. If)1 142 2 3891 6984 t (statement part of the)3 830 1 720 7104 t 10 CW f (case)1579 7104 w 10 R f (is executed. The)2 659 1 1848 7104 t 10 CW f (case)2536 7104 w 10 R f ( a single)2 343( For)1 194( integer constant.)2 695(expression must yield an)3 1003 4 2805 7104 t 10 CW f (switch)720 7224 w 10 R f ( no)1 127( If)1 119(statement each case expression must yield a unique value.)8 2339 3 1108 7224 t 10 CW f (case)3720 7224 w 10 R f (is matched, the)2 606 1 3987 7224 t 10 CW f (default)4620 7224 w cleartomark showpage saveobj restore %%EndPage: 19 19 %%Page: 20 20 /saveobj save def mark 20 pagesetup 10 R f (\255 20 \255)2 216 1 2772 480 t (clause is executed. If the)4 983 1 720 840 t 10 CW f (default)1728 840 w 10 R f (is omitted then none of the)5 1069 1 2173 840 t 10 CW f (case)3267 840 w 10 R f (statements are executed.)2 972 1 3532 840 t (The)970 996 w 10 CW f (alt)1165 996 w 10 R f ( communication on several channels simultaneously)5 2164(statement allows threads to perform)4 1491 2 1385 996 t (without polling. The expression in each)5 1622 1 720 1116 t 10 CW f (case)2375 1116 w 10 R f (of an)1 209 1 2648 1116 t 10 CW f (alt)2889 1116 w 10 R f (must contain either a send or receive operation.)7 1939 1 3101 1116 t (The)720 1236 w 10 CW f (alt)910 1236 w 10 R f ( thread will remain blocked in)5 1256( A)1 133( ready channels.)2 667(statement provides a fair select between)5 1643 4 1125 1236 t 10 CW f (alt)4860 1236 w 10 R f ( of the)2 261(until one)1 357 2 720 1356 t 10 CW f (case)1366 1356 w 10 R f (expressions can be evaluated without blocking. The)6 2084 1 1634 1356 t 10 CW f (case)3746 1356 w 10 R f (expression may be evalu\255)3 1026 1 4014 1356 t ( expressions which have side effects. If sev\255)7 1770(ated more than once, therefore care should be taken when using)10 2550 2 720 1476 t (eral of the)2 414 1 720 1596 t 10 CW f (case)1164 1596 w 10 R f (expressions are ready for evaluation one is chosen at random. A)10 2592 1 1434 1596 t 10 CW f (break)4055 1596 w 10 R f (statement termi\255)1 656 1 4384 1596 t (nates each case of the)4 875 1 720 1716 t 10 CW f (alt)1623 1716 w 10 R f ( the)1 150(. If)1 144 2 1803 1716 t 10 CW f (break)2126 1716 w 10 R f (statement is omitted execution will proceed to execute the com\255)9 2585 1 2455 1716 t ( example:)1 391( For)1 189(munication of the next case regardless of its readiness to communicate.)10 2842 3 720 1836 t 9 CW f (chan\(Mesg\) keyboard, mouse;)2 1458 1 1440 2006 t (Mesg m;)1 378 1 1440 2116 t (alt {)1 270 1 1440 2336 t (case m = <\255keyboard:)3 1080 1 1440 2446 t (/* Process keyboard event */)4 1512 1 1872 2556 t (break;)1872 2666 w (case m = <\255mouse:)3 918 1 1440 2776 t (/* Process mouse event */)4 1350 1 1872 2886 t (break;)1872 2996 w (})1440 3106 w 10 R f (The)970 3322 w 10 CW f (alt)1151 3322 w 10 R f ( descriminate between the type of values received from channels of)10 2707(statement is also used to)4 976 2 1357 3322 t (variant protocols. In this form each)5 1413 1 720 3442 t 10 I f (case\255item)2160 3442 w 10 R f (of the)1 232 1 2569 3442 t 10 CW f (alt)2827 3442 w 10 R f ( right hand side)3 622( The)1 206(must be a simple assignment.)4 1179 3 3033 3442 t ( operation on a channel which supplies a variant protocol. The type of the l\255)14 3081(must contain a communication)3 1239 2 720 3562 t ( An)1 175(value is used to match a type in the variant protocol.)10 2119 2 720 3682 t 10 CW f (alt)3042 3682 w 10 R f ( vari\255)1 215(may be performed on an abitrary set of)7 1575 2 3250 3682 t ( There must be a)4 721(ant protocol channels so long as no type is supplied by more than one channel.)14 3320 2 720 3802 t 10 CW f (case)4800 3802 w 10 R f ( type supplied by the union of all channel types; ALEF requires the match against types to be)17 3721(clause for each)2 599 2 720 3922 t ( example:)1 391(exhaustive. For)1 641 2 720 4042 t 10 I f (Aggr1 a;)1 358 1 1330 4222 t (Aggr2 b;)1 358 1 1330 4342 t (Aggr3 c;)1 352 1 1330 4462 t (chan \(Aggr1, Aggr2, Aggr3\) c;)4 1237 1 1330 4702 t (alt {)1 171 1 1330 4942 t (case a =)2 345 1 1330 5062 t 10 S f (<)1700 5062 w 10 I f (\255c:)1755 5062 w (print\("received Aggr1"\);)1 990 1 1580 5182 t (break;)1580 5302 w (case b =)2 345 1 1330 5422 t 10 S f (<)1700 5422 w 10 I f (\255c:)1755 5422 w (print\("received Aggr2"\);)1 990 1 1580 5542 t (break;)1580 5662 w (case c =)2 339 1 1330 5782 t 10 S f (<)1694 5782 w 10 I f (\255c:)1749 5782 w (print\("received Aggr3"\);)1 990 1 1580 5902 t (break;)1580 6022 w (})1330 6142 w 10 R f (If an)1 189 1 970 6358 t 10 CW f (alt)1188 6358 w 10 R f ( must ensure that other threads do not perform an)9 2011(is pending on a channel the programmer)6 1632 2 1397 6358 t (operation of the same type on the channel until the)9 2094 1 720 6478 t 10 CW f (alt)2847 6478 w 10 R f ( the)1 154( Otherwise)1 467(is complete.)1 491 3 3060 6478 t 10 CW f (alt)4204 6478 w 10 R f (on that channel)2 624 1 4416 6478 t ( channel may not be used in two)7 1346( A)1 130( values are removed by the other thread.)7 1657(may block if)2 519 4 720 6598 t 10 CW f (alt)4405 6598 w 10 R f (statements)4618 6598 w (simultaneously.)720 6718 w (The symbol)1 476 1 970 6874 t 10 CW f (!{)1472 6874 w 10 R f ( guarded)1 348(introduces a)1 486 2 1618 6874 t 10 I f (caselist)2479 6874 w 10 R f ( one thread may be executing the statements con\255)8 1984(. Only)1 277 2 2779 6874 t (tained in the guarded caselist at any instant.)7 1742 1 720 6994 t cleartomark showpage saveobj restore %%EndPage: 20 20 %%Page: 21 21 /saveobj save def mark 21 pagesetup 10 R f (\255 21 \255)2 216 1 2772 480 t 10 B f ( Statements)1 496(7.5. Loop)1 423 2 720 840 t 10 R f (Several loop constructs are provided:)4 1486 1 970 996 t 10 I f (loop\255statement:)1330 1176 w 10 CW f (while \()1 385 1 1580 1296 t 10 I f (expression)1990 1296 w 10 CW f (\))2442 1296 w 10 I f (statement)2527 1296 w 10 CW f (do)1580 1416 w 10 I f (statement)1725 1416 w 10 CW f (while \()1 385 1 2133 1416 t 10 I f (expression)2543 1416 w 10 CW f (\) ;)1 145 1 2995 1416 t (for \()1 265 1 1580 1536 t 10 I f (expression)1870 1536 w 10 CW f (;)2322 1536 w 10 I f (expression)2407 1536 w 10 CW f (;)2859 1536 w 10 I f (expression)2944 1536 w 10 CW f (\))3396 1536 w 10 I f (statement)3481 1536 w 10 R f (In)720 1716 w 10 CW f (while)831 1716 w 10 R f (and)1159 1716 w 10 CW f (do)1331 1716 w 10 R f ( expression must)2 680( The)1 209( statement is repeated until the expression evaluates to 0.)9 2305(loops the)1 367 4 1479 1716 t (yield either an arithmetic or pointer type. In the)8 1942 1 720 1836 t 10 CW f (while)2693 1836 w 10 R f (loop the expression is evaluated and tested before)7 2017 1 3023 1836 t (the statement. In the)3 810 1 720 1956 t 10 CW f (do)1555 1956 w 10 R f (loop the statement is executed before the expression is evaluated and tested.)11 3033 1 1700 1956 t (In the)1 238 1 970 2112 t 10 CW f (for)1241 2112 w 10 R f ( expression is usually)3 885( The)1 214( before loop entry.)3 764(loop the first expression is evaluated once)6 1723 4 1454 2112 t ( beginning of each loop itera\255)5 1193( second expression is evaluated at the)6 1521( The)1 209(used to initialise the loop variable.)5 1397 4 720 2232 t ( is exe\255)2 294(tion, including the first. The expression must yield either a pointer or arithmetic type. The statement)15 4026 2 720 2352 t ( expression is evalu\255)3 836(cuted while the evaluation of the second expression does not compare to 0. The third)14 3484 2 720 2472 t ( All)1 157(ated after the statement on each loop iteration. The first and third expressions have no type restrictions.)16 4163 2 720 2592 t ( omitted an expression returning a non\255zero value)7 1982(of the expressions are optional. If the second expression is)9 2338 2 720 2712 t (is implied.)1 423 1 720 2832 t 10 B f ( Statements)1 496(7.6. Jump)1 445 2 720 3072 t 10 R f (Jump statements transfer control unconditionally.)4 1979 1 970 3228 t 10 I f (jump\255statement:)1330 3408 w 10 CW f (goto)1580 3528 w 10 I f (identifier)1845 3528 w 10 CW f (;)2237 3528 w (continue)1580 3648 w 10 I f (count)2085 3648 w 8 I f (opt)2307 3698 w 10 I f (;)2409 3648 w 10 CW f (break)1580 3768 w 10 I f (count)1905 3768 w 8 I f (opt)2127 3818 w 10 I f (;)2229 3768 w 10 CW f (raise)1580 3888 w 10 I f (identifier)1905 3888 w 8 I f (opt)2272 3938 w 10 CW f (;)2399 3888 w (return)1580 4008 w 10 I f (expression)1965 4008 w 8 I f (opt)2392 4058 w 10 CW f (;)2519 4008 w (become)1580 4128 w 10 I f (expression)1965 4128 w 10 CW f (;)2417 4128 w 10 I f (count:)1330 4368 w (integer\255constant)1580 4488 w 10 CW f (goto)720 4668 w 10 R f (transfers control to the label)4 1120 1 985 4668 t 10 I f (identifier)2130 4668 w 10 R f (, which must be in the current function.)7 1573 1 2497 4668 t 10 B f ( Statements)1 496(7.6.1. Continue)1 670 2 720 4908 t 10 R f (The)970 5064 w 10 CW f (continue)1154 5064 w 10 R f ( If)1 121( of an iteration statement.)4 1038(statement may only appear as part)5 1381 3 1663 5064 t 10 I f (count)4233 5064 w 10 R f (is omitted the)2 555 1 4485 5064 t 10 CW f (continue)720 5184 w 10 R f ( enclosing iteration)2 778(statement transfers control to the loop\255continuation portion of the smallest)9 3030 2 1232 5184 t ( If)1 118( is the end of the loop.)6 903(statement, that)1 584 3 720 5304 t 10 I f (count)2352 5304 w 10 R f (is supplied)1 433 1 2601 5304 t 10 CW f (continue)3061 5304 w 10 R f (transfers control to the loop continu\255)5 1472 1 3568 5304 t (ation of some outer nested loop.)5 1332 1 720 5424 t 10 I f (count)2112 5424 w 10 R f ( number of loops to skip. The statement)7 1651(specifies the)1 506 2 2369 5424 t 10 CW f (continue)4560 5424 w 10 R f (with no)1 303 1 720 5544 t 10 I f (count)1048 5544 w 10 R f (is the same as)3 552 1 1295 5544 t 10 CW f (continue)1872 5544 w 10 R f ( example:)1 391( For)1 189(1 .)1 100 3 2377 5544 t 9 CW f (while\(1\) {)1 540 1 1440 5714 t (while\(1\) {)1 540 1 1872 5824 t ( Same as goto contin; */)5 1296( /*)1 378(continue 2;)1 594 3 2304 5934 t (})1872 6044 w ( Continue comes here */)4 1242(contin: /*)1 1836 2 1440 6154 t (})1440 6264 w 10 B f ( Statements)1 496(7.6.2. Break)1 536 2 720 6564 t 10 R f (The)970 6720 w 10 CW f (break)1161 6720 w 10 R f ( If)1 128( part of an iteration statement or selection statement.)8 2190(statement may only appear as)4 1225 3 1497 6720 t 10 I f (count)720 6840 w 10 R f (is omitted in an interaction statement then the break terminates the statement portion of the iteration)15 4068 1 972 6840 t ( If)1 125(loop and transfers control to the statement after the iteration statement.)10 2916 2 720 6960 t 10 I f (count)3795 6960 w 10 R f (is supplied break causes)3 989 1 4051 6960 t ( statement of some nested loop.)5 1275(termination of the iteration)3 1086 2 720 7080 t 10 I f (count)3134 7080 w 10 R f (is the number of nested iteration loops to)7 1656 1 3384 7080 t (terminate.)720 7200 w 10 CW f (break)1180 7200 w 10 R f (with no)1 312 1 1513 7200 t 10 I f (count)1859 7200 w 10 R f (is the same as)3 579 1 2115 7200 t 10 CW f (break)2728 7200 w 10 R f ( used in a selection statement,)5 1238( When)1 297(1 .)1 109 3 3062 7200 t 10 CW f (break)4740 7200 w cleartomark showpage saveobj restore %%EndPage: 21 21 %%Page: 22 22 /saveobj save def mark 22 pagesetup 10 R f (\255 22 \255)2 216 1 2772 480 t (causes the termination of the case in the selection statement.)9 2407 1 720 840 t 10 B f ( Statement)1 457(7.6.3. Raise)1 508 2 720 1080 t 10 R f (By default)1 419 1 970 1236 t 10 CW f (raise)1414 1236 w 10 R f (transfers control to the last)4 1065 1 1739 1236 t 10 CW f (rescue)2829 1236 w 10 R f ( in the code. Execution has)5 1081(statement declared)1 745 2 3214 1236 t ( connection between)2 822(no effect on the)3 629 2 720 1356 t 10 CW f (raise)2197 1356 w 10 R f (and)2523 1356 w 10 CW f (rescue)2693 1356 w 10 R f ( an identifier is supplied, control is)6 1397(statements. If)1 564 2 3079 1356 t ( the named)2 458(transferred to)1 543 2 720 1476 t 10 CW f (rescue)1756 1476 w 10 R f (statement.)2151 1476 w 10 CW f (raise)2619 1476 w 10 R f (is intended for use in error recovery. For example,)8 2086 1 2954 1476 t (these two fragments are equivalent:)4 1419 1 720 1596 t 9 CW f ( p;)1 162( alloc)1 1566(alloc p;)1 432 3 1440 1766 t ( notrescue;)1 594( goto)1 1512(rescue {)1 432 3 1440 1876 t ( dorescue:)1 1674(unalloc p;)1 540 2 1872 1986 t ( p;)1 162(raise; unalloc)1 2538 2 1872 2096 t ( nextrescue;)1 648(} goto)1 2808 2 1440 2206 t (notrescue:)3168 2316 w (if\(error\) if\(error\))1 2214 1 1440 2426 t ( dorescue;)1 540(raise; goto)1 1944 2 1872 2536 t 10 B f ( Statement)1 457(7.6.4. Return)1 580 2 720 2836 t 10 R f (A function returns to its caller using a)7 1526 1 970 2992 t 10 CW f (return)2523 2992 w 10 R f ( unless the func\255)3 666(statement. An expression is required)4 1464 2 2910 2992 t (tion is declared as returning the type)6 1471 1 720 3112 t 10 CW f (void)2218 3112 w 10 R f ( result of expression is evaluated using the rules of assign\255)10 2350(. The)1 232 2 2458 3112 t (ment to the return type of the function.)7 1548 1 720 3232 t 10 B f ( Statement)1 457(7.6.5. Become)1 607 2 720 3472 t 10 R f (The)970 3628 w 10 CW f (become)1157 3628 w 10 R f (statement transforms the current function into the value of the)9 2534 1 1549 3628 t 10 I f (expression)4115 3628 w 10 R f (given as its)2 466 1 4574 3628 t (argument. If)1 527 1 720 3748 t 10 CW f (expression)1281 3748 w 10 R f ( of)1 116(is not a function call the effect)6 1268 2 1915 3748 t 10 CW f (become)3332 3748 w 10 R f (is exactly the same as)4 897 1 3725 3748 t 10 CW f (return)4655 3748 w 10 R f (.)5015 3748 w ( function call causes the current function to be replaced by the called function.)13 3178(However a)1 437 2 720 3868 t 10 I f (expression)4389 3868 w 10 R f (must)4845 3868 w ( performing recursion in this manner are guaranteed to)8 2226( Functions)1 451(have exactly the same type as the caller.)7 1643 3 720 3988 t (run in constant space.)3 865 1 720 4108 t 10 B f ( Statements)1 496(7.7. Exception)1 628 2 720 4348 t 10 CW f (rescue)970 4504 w 10 R f (and)1355 4504 w 10 CW f (check)1524 4504 w 10 R f (statements are provided for use in error recovery:)7 1969 1 1849 4504 t 10 I f (exception\255statement:)1330 4684 w 10 CW f (rescue)1580 4804 w 10 I f (identifier)1965 4804 w 8 I f (opt)2332 4854 w 10 I f (block)2459 4804 w 10 CW f (check)1580 4924 w 10 I f (expression)1905 4924 w 10 CW f (;)2357 4924 w 10 B f ( Statement)1 457(7.7.1. Rescue)1 574 2 720 5224 t 10 R f ( A)1 134(Under normal execution the block is not executed.)7 2097 2 970 5380 t 10 CW f (raise)3238 5380 w 10 R f (after a)1 264 1 3576 5380 t 10 CW f (rescue)3878 5380 w 10 R f (statement transfers)1 764 1 4276 5380 t (control to the closest previously defined)5 1621 1 720 5500 t 10 CW f (rescue)2370 5500 w 10 R f ( the same function. Execution flows through)6 1791(statement in)1 490 2 2759 5500 t (the end of the)3 564 1 720 5620 t 10 CW f (rescue)1315 5620 w 10 R f (block by default.)2 686 1 1706 5620 t 10 CW f (rescue)2448 5620 w 10 R f ( error)1 225(statements may be cascaded to perform complex)6 1976 2 2839 5620 t (recovery actions:)1 684 1 720 5740 t cleartomark showpage saveobj restore %%EndPage: 22 22 %%Page: 23 23 /saveobj save def mark 23 pagesetup 10 R f (\255 23 \255)2 216 1 2772 480 t 9 CW f (alloc a, b;)2 594 1 1440 830 t (rescue {)1 432 1 1440 940 t (unalloc a, b;)2 702 1 1872 1050 t (return 0;)1 486 1 1872 1160 t (})1440 1270 w (alloc c;)1 432 1 1440 1490 t (rescue {)1 432 1 1440 1600 t (unalloc c;)1 540 1 1872 1710 t (raise;)1872 1820 w (})1440 1930 w (dostuff\(\);)1440 2150 w (if\(error\))1440 2370 w (raise;)1872 2480 w 10 B f ( Statement)1 457(7.7.2. Check)1 547 2 720 2780 t 10 R f (The)970 2936 w 10 CW f (check)1150 2936 w 10 R f ( fails a runtime error aborts the program. The)8 1812( the assertion)2 527( If)1 116(statement tests an assertion.)3 1110 4 1475 2936 t (file and line number of the)5 1067 1 720 3056 t 10 CW f (check)1813 3056 w 10 R f ( The)1 205( to standard error, the program is then aborted.)8 1857(statement are printed)2 839 3 2139 3056 t ( example:)1 391( For)1 189( the compare succeeds the assertion has failed.)7 1856( If)1 116(expression is evaluated and compared to 0.)6 1716 5 720 3176 t 9 CW f (alloc ptr;)1 540 1 1440 3346 t ( Program aborts if allocation fails */)6 2052( /*)1 486(check ptr != nil;)3 918 3 1440 3456 t 10 R f (A compiler option is provided to omit)6 1601 1 720 3636 t 10 CW f (check)2360 3636 w 10 R f ( default)1 317( By)1 182( code.)1 253(statements from trusted object)3 1249 4 2699 3636 t 10 CW f (check)4740 3636 w 10 R f (statements are included.)2 962 1 720 3756 t 10 B f ( Control Statements)2 854(7.8. Process)1 521 2 720 3996 t 10 R f (These statements create processes and coroutines:)5 1992 1 970 4152 t 10 I f (process\255statement:)1330 4332 w 10 CW f (proc)1580 4452 w 10 I f (function\255call)1845 4452 w 10 CW f (;)2381 4452 w (task)1580 4572 w 10 I f (function\255call)1845 4572 w 10 CW f (;)2381 4572 w (par)1580 4692 w 10 I f (block)1785 4692 w 10 R f (The)720 4872 w 10 CW f (proc)904 4872 w 10 R f (statement creates a new process. The new process starts running the named function. The argu\255)14 3866 1 1174 4872 t (ments to)1 346 1 720 4992 t 10 I f (function\255call)1095 4992 w 10 R f ( are scheduled preemptively and the)5 1458( Processes)1 442(are evaluated by the original process.)5 1505 3 1635 4992 t ( and child process share memory and file descriptors. The)9 2324( Parent)1 307( the processes is undefined.)4 1103(interleaving of)1 586 4 720 5112 t ( processes are addressable, so it is possible to pass the address of an automatic between pro\255)16 3753(stacks of both)2 567 2 720 5232 t (cesses. The)1 480 1 720 5352 t 10 CW f (task)1226 5352 w 10 R f (statement creates a coroutine within a process. The arguments to)9 2587 1 1492 5352 t 10 I f (function\255call)4105 5352 w 10 R f (are evalu\255)1 397 1 4643 5352 t ( are non\255preemptive and are scheduled during message passing and syn\255)10 2902( Tasks)1 285( original process.)2 689(ated by the)2 444 4 720 5472 t ( that can cause task switching are)6 1408( scheduling primitives)2 913( The)1 217(chronisation primitives.)1 962 4 720 5592 t 10 CW f (QLock.lock)4258 5592 w 10 R f (and)4896 5592 w 10 CW f (Rendez.sleep)720 5712 w 10 R f ( cause task switching are)4 1040( communication operations which can)4 1572(. The)1 243 3 1440 5712 t 10 CW f (alt)4332 5712 w 10 R f (,)4512 5712 w 10 CW f (<\255=)4574 5712 w 10 R f (\(send\))4791 5712 w (and)720 5832 w 10 CW f (<\255)891 5832 w 10 R f ( process that contains several tasks will exist until all the tasks within the process have)15 3500(\(receive\). A)1 502 2 1038 5832 t ( process or task)3 621( A)1 123( will exist until all of the processes in the program have exited.)12 2523( turn, a program)3 649(exited. In)1 404 5 720 5952 t ( the function)2 527(may exit explicitly by calling)4 1212 2 720 6072 t 10 CW f (exits)2495 6072 w 10 R f (or by returning from the function in which they were)9 2209 1 2831 6072 t (invoked.)720 6192 w (The)970 6348 w 10 CW f (par)1154 6348 w 10 R f ( for each statement in the)5 1031(statement implements fork/process/join. A new process is created)7 2646 2 1363 6348 t (block. The)1 435 1 720 6468 t 10 CW f (par)1188 6468 w 10 R f ( A)1 129(statement completes when all processes have completed execution of their statements.)10 3511 2 1400 6468 t 10 CW f (par)720 6588 w 10 R f ( that entered the)3 661( process)1 330( The)1 211(with a single statement is the same as a block.)9 1891 4 931 6588 t 10 CW f (par)4056 6588 w 10 R f (is guaranteed to be)3 772 1 4268 6588 t (the same process that exits.)4 1090 1 720 6708 t (All tasks within a process will block until a system call completes.)11 2660 1 970 6864 t cleartomark showpage saveobj restore %%EndPage: 23 23 %%Page: 24 24 /saveobj save def mark 24 pagesetup 10 R f (\255 24 \255)2 216 1 2772 480 t 10 B f ( Statements)1 496(7.9. Allocation)1 639 2 720 840 t 10 R f (Memory management statements allocate and free memory for objects from the heap:)11 3423 1 970 996 t 10 I f (allocation\255statement:)1330 1176 w 10 CW f (alloc)1580 1296 w 10 I f (alloclist)1905 1296 w 10 CW f (;)2253 1296 w (unalloc)1580 1416 w 10 I f (alloclist)2025 1416 w 10 CW f (;)2373 1416 w 10 I f (alloclist:)1330 1656 w (expr)1580 1776 w (alloclist , expr)2 575 1 1580 1896 t 10 B f ( Statement)1 457(7.9.1. Alloc)1 497 2 720 2196 t 10 R f (The)970 2352 w 10 CW f (alloc)1150 2352 w 10 R f ( each pointer, memory)3 901( For)1 190( must also be l\255values.)4 895(statement takes a list of pointers, which)6 1579 4 1475 2352 t ( memory is guar\255)3 688( The)1 206( to the pointer.)3 586(is reserved for an object of appropriate type and its address is assigned)12 2840 4 720 2472 t ( because there is insufficient memory the expression)7 2170( the allocation fails)3 793( If)1 126(anteed to be filled with zeros.)5 1231 4 720 2592 t (will be assigned the value)4 1032 1 720 2712 t 10 CW f (nil)1777 2712 w 10 R f (.)1957 2712 w (If the pointer has)3 694 1 970 2868 t 10 CW f (chan)1694 2868 w 10 R f ( the channel)2 492( If)1 121(type, the runtime system will also initialise the new channel.)9 2463 3 1964 2868 t (is asynchronous then the specified number of buffers will be allocated.)10 2825 1 720 2988 t 10 B f ( Statement)1 457(7.9.2. Unalloc)1 603 2 720 3228 t 10 R f (The)970 3384 w 10 CW f (unalloc)1164 3384 w 10 R f ( memory to the heap. The argument to)7 1636(statement returns)1 699 2 1623 3384 t 10 CW f (unalloc)3998 3384 w 10 R f ( have)1 253(must be)1 329 2 4458 3384 t (been returned by a successful)4 1186 1 720 3504 t 10 CW f (alloc)1934 3504 w 10 R f (or be)1 205 1 2262 3504 t 10 CW f (nil)2494 3504 w 10 R f ( of)1 110(. Unalloc)1 393 2 2674 3504 t 10 CW f (nil)3204 3504 w 10 R f ( an object is unallocated)4 973( If)1 118(has no effect.)2 538 3 3411 3504 t (twice, or an invalid object is unallocated the runtime system will abort the program.)13 3349 1 720 3624 t 10 B f ( Support)1 376(8. Runtime)1 497 2 720 3864 t 10 R f (The synchronisation primitives used by the runtime system are made available to ALEF programs.)13 4070 1 970 4020 t ( provided by the include file)5 1149(Prototypes for these and other library functions are)7 2067 2 720 4140 t 10 CW f (alef.h)3965 4140 w 10 R f ( file should)2 458(. This)1 257 2 4325 4140 t (be included as the first item as:)6 1243 1 720 4260 t 9 CW f (#include )1 918 1 1440 4430 t 10 R f (The standard include path for ALEF on Plan 9 is)9 1945 1 720 4610 t 10 CW f (/sys/include/alef)2690 4610 w 10 R f (.)3710 4610 w 10 B f (8.1. Lock)1 417 1 720 4850 t 10 R f (The)970 5006 w 10 CW f (Lock)1157 5006 w 10 R f ( operations are provided.)3 1013( Two)1 240(ADT provides spinlocks.)2 1016 3 1429 5006 t 10 CW f (Lock.lock)3755 5006 w 10 R f ( if)1 94(claims the lock)2 619 2 4327 5006 t ( lock becomes free.)3 787(free, otherwise is busy loops until the)6 1526 2 720 5126 t 10 CW f (Lock.unlock)3087 5126 w 10 R f (releases a lock after it has been)6 1264 1 3776 5126 t (claimed.)720 5246 w ( thread which claimed the)4 1051( The)1 209(Lock ADTs have no runtime state and may be dynamically allocated.)10 2810 3 970 5402 t (lock need not be the thread which unlocks it.)8 1789 1 720 5522 t 10 B f (8.2. Qlock)1 456 1 720 5762 t 10 R f (The)970 5918 w 10 CW f (Qlock)1156 5918 w 10 R f ( the lock is free)4 643( If)1 122(ADT provides blocking mutual exclusion.)4 1709 3 1487 5918 t 10 CW f (Qlock.lock)3993 5918 w 10 R f (claims the)1 415 1 4625 5918 t ( gain the lock will cause the thread to be suspended until the lock becomes free.)15 3288( attempts to)2 483(lock. Further)1 549 3 720 6038 t (The lock is released by calling)5 1217 1 720 6158 t 10 CW f (Qlock.unlock)1962 6158 w 10 R f (.)2682 6158 w (The thread which claimed the lock need not be the thread which unlocks it.)13 3000 1 970 6314 t ( unallocated)1 499(QLock ADTs have runtime state and may be dynamically allocated provided they are)12 3571 2 970 6470 t ( thread which claimed the lock need not be the thread which unlocks it.)13 2845( The)1 205(when unlocked.)1 632 3 720 6590 t 10 B f ( Style Grammar)2 693(9. Yacc)1 335 2 720 6830 t 10 R f ( Uppercase words and punctuation)4 1388(The following grammar is suitable for implementing a yacc parser.)9 2682 2 970 6986 t (surrounded by single quotes are the terminal symbols.)7 2159 1 720 7106 t cleartomark showpage saveobj restore %%EndPage: 24 24 %%Page: 25 25 /saveobj save def mark 25 pagesetup 10 R f (\255 25 \255)2 216 1 2772 480 t 9 CW f (prog: decllist)1 1296 1 1008 830 t (decllist :)1 918 1 1008 1050 t (| decllist decl)2 810 1 1872 1160 t ( tname vardecllist ';')3 1188(decl :)1 918 2 1008 1380 t (| tname vardecl '\(' arglist '\)' block)6 1998 1 1872 1490 t (| tname adtfunc '\(' arglist '\)' block)6 1998 1 1872 1600 t (| tname vardecl '\(' arglist '\)' ';')6 1890 1 1872 1710 t (| typespec ';')2 756 1 1872 1820 t (| TYPEDEF ztname vardecl zargs ';')5 1836 1 1872 1930 t (zargs :)1 918 1 1008 2150 t (| '\(' arglist '\)')3 918 1 1872 2260 t ( tname)1 324(ztname :)1 918 2 1008 2480 t (| AGGR)1 324 1 1872 2590 t (| ADT)1 270 1 1872 2700 t (| UNION)1 378 1 1872 2810 t ( TYPENAME '.' name)3 972(adtfunc :)1 918 2 1008 3030 t (| indsp TYPENAME '.' name)4 1350 1 1872 3140 t ( AGGR ztag '{' memberlist '}' ztag)6 1836(typespec :)1 918 2 1008 3360 t ( ztag)1 270( '}')1 270(| UNION ztag '{' memberlist)4 1458 3 1872 3470 t (| ADT ztag '{' memberlist '}' ztag)6 1836 1 1872 3580 t (| ENUM ztag '{' setlist '}')5 1458 1 1872 3690 t (ztag :)1 918 1 1008 3910 t (| name)1 324 1 1872 4020 t (| TYPENAME)1 540 1 1872 4130 t ( sname)1 324(setlist :)1 918 2 1008 4350 t (| setlist ',' setlist)3 1134 1 1872 4460 t (sname :)1 918 1 1008 4680 t (| name)1 324 1 1872 4790 t (| name '=' expr)3 810 1 1872 4900 t ( ID)1 162(name :)1 918 2 1008 5120 t ( decl)1 270(memberlist :)1 918 2 1008 5340 t (| memberlist decl)2 918 1 1872 5450 t (vardecllist :)1 918 1 1008 5670 t (| ivardecl)1 540 1 1872 5780 t (| vardecllist ',' ivardecl)3 1404 1 1872 5890 t ( vardecl zinit)2 756(ivardecl :)1 918 2 1008 6110 t (zinit :)1 918 1 1008 6330 t (| '=' zelist)2 648 1 1872 6440 t ( zexpr)1 324(zelist :)1 918 2 1008 6660 t (| '[' expr ']' expr)4 1026 1 1872 6770 t (| '{' zelist '}')3 864 1 1872 6880 t (| '[' expr ']' '{' zelist '}')6 1566 1 1872 6990 t (| zelist ',' zelist)3 1026 1 1872 7100 t cleartomark showpage saveobj restore %%EndPage: 25 25 %%Page: 26 26 /saveobj save def mark 26 pagesetup 10 R f (\255 26 \255)2 216 1 2772 480 t 9 CW f ( ID arrayspec)2 702(vardecl :)1 918 2 1008 830 t (| indsp ID arrayspec)3 1080 1 1872 940 t (| '\(' indsp ID arrayspec '\)' '\(' arglist '\)')8 2376 1 1872 1050 t (| indsp '\(' indsp ID arrayspec '\)' '\(' arglist '\)')9 2700 1 1872 1160 t (arrayspec :)1 918 1 1008 1380 t (| arrayspec '[' zexpr ']')4 1350 1 1872 1490 t ( '*')1 216(indsp :)1 918 2 1008 1710 t (| indsp '*')2 594 1 1872 1820 t (arglist :)1 918 1 1008 2150 t (| arg)1 270 1 1872 2260 t (| '*' xtname)2 648 1 1872 2370 t (| arglist ',' arg)3 918 1 1872 2480 t ( xtname)1 378(arg :)1 918 2 1008 2700 t (| xtname indsp arrayspec)3 1296 1 1872 2810 t (| xtname '\(' indsp '\)' '\(' arglist '\)')7 2052 1 1872 2920 t (| TUPLE tname '\(' indsp '\)' '\(' arglist '\)')8 2322 1 1872 3030 t (| TUPLE tname vardecl)3 1134 1 1872 3140 t (| xtname vardecl)2 864 1 1872 3250 t (| '.' '.' '.')3 702 1 1872 3360 t (autolist :)1 918 1 1008 3580 t (| autolist autodecl)2 1026 1 1872 3690 t ( xtname vardecllist ';')3 1242(autodecl :)1 918 2 1008 3910 t (| TUPLE tname vardecllist ';')4 1566 1 1872 4020 t ( '{' autolist slist '}')4 1242(block :)1 918 2 1008 4240 t ( '}')1 216( slist)1 378(| '!{' autolist)2 810 3 1872 4350 t (slist :)1 918 1 1008 4570 t (| slist stmnt)2 702 1 1872 4680 t ( '{' clist '}')3 756(cbody :)1 918 2 1008 4900 t (| '!{' clist '}')3 864 1 1872 5010 t (clist :)1 918 1 1008 5230 t (| clist case)2 648 1 1872 5340 t ( CASE expr ':' slist)4 1080(case :)1 918 2 1008 5560 t (| DEFAULT ':' slist)3 1026 1 1872 5670 t ( stmnt)1 324(rbody :)1 918 2 1008 5890 t (| ID block)2 540 1 1872 6000 t (zlab :)1 918 1 1008 6220 t (| ID)1 216 1 1872 6330 t ( nlstmnt)1 432(stmnt :)1 918 2 1008 6550 t (| ID ':' stmnt)3 756 1 1872 6660 t ( error ';')2 540(nlstmnt :)1 918 2 1008 6880 t (| zexpr ';')2 594 1 1872 6990 t (| block)1 378 1 1872 7100 t (| CHECK expr ';')3 864 1 1872 7210 t cleartomark showpage saveobj restore %%EndPage: 26 26 %%Page: 27 27 /saveobj save def mark 27 pagesetup 10 R f (\255 27 \255)2 216 1 2772 480 t 9 CW f (| ALLOC elist ';')3 918 1 1872 830 t (| UNALLOC elist ';')3 1026 1 1872 940 t (| RESCUE rbody)2 756 1 1872 1050 t (| RAISE zlab ';')3 864 1 1872 1160 t (| GOTO ID ';')3 702 1 1872 1270 t (| PROC expr ';')3 810 1 1872 1380 t (| TASK expr ';')3 810 1 1872 1490 t (| BECOME expr ';')3 918 1 1872 1600 t (| ALT cbody)2 594 1 1872 1710 t (| RETURN zexpr ';')3 972 1 1872 1820 t (| FOR '\(' zexpr ';' zexpr ';' zexpr '\)' stmnt)9 2430 1 1872 1930 t (| WHILE '\(' expr '\)' stmnt)5 1404 1 1872 2040 t (| DO stmnt WHILE '\(' expr '\)')6 1566 1 1872 2150 t (| IF '\(' expr '\)' stmnt)5 1242 1 1872 2260 t (| IF '\(' expr '\)' stmnt ELSE stmnt)7 1836 1 1872 2370 t (| PAR block)2 594 1 1872 2480 t (| SWITCH '\(' expr '\)' cbody)5 1458 1 1872 2590 t (| CONTINUE zconst ';')3 1134 1 1872 2700 t (| BREAK zconst ';')3 972 1 1872 2810 t (zconst :)1 918 1 1008 3030 t (| CONST)1 378 1 1872 3140 t (zexpr :)1 918 1 1008 3360 t (| expr)1 324 1 1872 3470 t ( castexpr)1 486(expr :)1 918 2 1008 3690 t (| expr '*' expr)3 810 1 1872 3800 t (| expr '/' expr)3 810 1 1872 3910 t (| expr '%' expr)3 810 1 1872 4020 t (| expr '+' expr)3 810 1 1872 4130 t (| expr '\255' expr)3 810 1 1872 4240 t (| expr '>>' expr)3 864 1 1872 4350 t (| expr '<<' expr)3 864 1 1872 4460 t (| expr '<' expr)3 810 1 1872 4570 t (| expr '>' expr)3 810 1 1872 4680 t (| expr '<=' expr)3 864 1 1872 4790 t (| expr '>=' expr)3 864 1 1872 4900 t (| expr '!=' expr)3 864 1 1872 5010 t (| expr '==' expr)3 864 1 1872 5120 t (| expr '&' expr)3 810 1 1872 5230 t (| expr '^' expr)3 810 1 1872 5340 t (| expr '|' expr)3 810 1 1872 5450 t (| expr '&&' expr)3 864 1 1872 5560 t (| expr '||' expr)3 864 1 1872 5670 t (| expr '=' expr)3 810 1 1872 5780 t (| expr '<\255' '=' expr)4 1080 1 1872 5890 t (| expr '+=' expr)3 864 1 1872 6000 t (| expr '\255=' expr)3 864 1 1872 6110 t (| expr '*=' expr)3 864 1 1872 6220 t (| expr '/=' expr)3 864 1 1872 6330 t (| expr '%=' expr)3 864 1 1872 6440 t (| expr '>>=' expr)3 918 1 1872 6550 t (| expr '<<=' expr)3 918 1 1872 6660 t (| expr '&=' expr)3 864 1 1872 6770 t ( expr)1 324(| expr '|=')2 594 2 1872 6880 t (| expr '^=' expr)3 864 1 1872 6990 t ( monexpr)1 432(castexpr :)1 918 2 1008 7210 t cleartomark showpage saveobj restore %%EndPage: 27 27 %%Page: 28 28 /saveobj save def mark 28 pagesetup 10 R f (\255 28 \255)2 216 1 2772 480 t 9 CW f (| '[' typecast ']' castexpr)4 1458 1 1872 830 t (| '\(' typecast '\)' castexpr)4 1458 1 1872 940 t ( xtname)1 378(typecast :)1 918 2 1008 1160 t (| xtname indsp)2 756 1 1872 1270 t (| xtname '\(' indsp '\)' '\(' arglist '\)')7 2052 1 1872 1380 t (| TUPLE tname)2 702 1 1872 1490 t ( term)1 270(monexpr :)1 918 2 1008 1710 t (| '*' castexpr)2 756 1 1872 1820 t (| '&' castexpr)2 756 1 1872 1930 t (| '+' castexpr)2 756 1 1872 2040 t (| '\255' castexpr)2 756 1 1872 2150 t (| Tdec castexpr)2 810 1 1872 2260 t (| Tinc castexpr)2 810 1 1872 2370 t (| '!' castexpr)2 756 1 1872 2480 t (| '~' castexpr)2 756 1 1872 2590 t (| SIZEOF monexpr)2 864 1 1872 2700 t (| '<\255' castexpr)2 810 1 1872 2810 t (| '?' castexpr)2 756 1 1872 2920 t ( '\(' elist '\)')3 756(term :)1 918 2 1008 3140 t (| SIZEOF '\(' typecast '\)')4 1350 1 1872 3250 t (| term '\(' zarlist '\)')4 1188 1 1872 3360 t (| term '[' expr ']')4 1026 1 1872 3470 t (| term '.' stag)3 810 1 1872 3580 t (| '.' TYPENAME '.' stag)4 1242 1 1872 3690 t (| term '\255>' stag)3 864 1 1872 3800 t (| term '\255\255')2 594 1 1872 3910 t (| term '++')2 594 1 1872 4020 t (| term '?')2 540 1 1872 4130 t (| name)1 324 1 1872 4240 t (| '.' '.' '.')3 702 1 1872 4350 t (| CONST)1 378 1 1872 4460 t (| NIL)1 270 1 1872 4570 t (| ENUM_MEMBER)1 702 1 1872 4680 t (| FCONST)1 432 1 1872 4790 t (| STRING)1 432 1 1872 4900 t (| '$' STRING)2 648 1 1872 5010 t ( ID)1 162(stag :)1 918 2 1008 5230 t (| TYPENAME)1 540 1 1872 5340 t (zarlist :)1 918 1 1008 5560 t (| elist)1 378 1 1872 5670 t ( expr)1 270(elist :)1 918 2 1008 5890 t (| elist ',' expr)3 864 1 1872 6000 t ( typecast)1 486(tlist :)1 918 2 1008 6220 t (| typecast ',' tlist)3 1080 1 1872 6330 t ( sclass xtname)2 756(tname :)1 918 2 1008 6550 t (| sclass '\(' tlist '\)')4 1188 1 1872 6660 t ( TYPENAME)1 486(xtname :)1 918 2 1008 6880 t (| INT)1 270 1 1872 6990 t (| UINT)1 324 1 1872 7100 t (| SINT)1 324 1 1872 7210 t cleartomark showpage saveobj restore %%EndPage: 28 28 %%Page: 29 29 /saveobj save def mark 29 pagesetup 10 R f (\255 29 \255)2 216 1 2772 480 t 9 CW f (| SUINT)1 378 1 1872 830 t (| BYTE)1 324 1 1872 940 t (| FLOAT)1 378 1 1872 1050 t (| VOID)1 324 1 1872 1160 t (| CHAN '\(' typecast '\)' bufdim)5 1620 1 1872 1270 t (bufdim :)1 918 1 1008 1490 t (| '[' expr ']')3 756 1 1872 1600 t (sclass :)1 918 1 1008 1820 t (| EXTERN)1 432 1 1872 1930 t (| INTERN)1 432 1 1872 2040 t (| PRIVATE)1 486 1 1872 2150 t cleartomark showpage saveobj restore %%EndPage: 29 29 %%Trailer done %%Pages: 29 %%DocumentFonts: Times-Bold Times-Italic Times-Roman Symbol Courier