Inter-Office MemorandumToCedar UsersDateDecember 18, 1981FromEd SatterthwaiteLocationPalo AltoSubjectCedar 7T10 Language and Compiler UpdateOrganizationCSLXEROX Filed on: [Indigo]Lang>Cedar7T10Update.BravoDRAFTThis memo summarizes the differences between the 7T7 and 7T10 versions of the Cedar languageand compiler. It consists of extracts from the document [Indigo]Lang>Cedar7T10.press.LANGUAGE CHANGESPredeclared TypesTo support the currently recommended Cedar standards, the types BOOL, INT and CHAR arepredeclared, with the following definitions: BOOL: TYPE = BOOLEAN; CHAR: TYPE = CHARACTER; INT: TYPE = LONG INTEGER;Also, the definition of the predeclared type CONDITION has been changed. The default value forthe timeout interval now is effectively infinite; i.e., a WAIT on a condition variable with defaultinitialization will never time out. (The previous default provided a timeout after 100 ticks.) Use aruntime procedure such as Process.SetTimeout to change the default setting.Rope LiteralsThe Cedar language now provides rope literals. Such a literal is denoted by a quoted string, e.g.,"This is a rope literal". Its value is a reference to a rope object in the standard (counted) zoneprovided by the Cedar system.The target type established by the context in which a quoted string literal appears determines theinterpretation of that literal. There are three cases:If the target type is Rope.ROPE, Rope.Ref or Rope.Text, the quoted string denotes a rope literaland has type Rope.Ref.If the target type is any other REF type, the literal has type REF TEXT.Otherwise, the literal has type STRING.In the first case, the test is actually for equivalence between the target type and either REF Rope.RopeRep or REFRope.TextRep. The matching is performed on the names of the interface (Rope) and referent type (RopeRep or TextRep),not on the structure of the referent type. Since this is a loophole in the type checking, use nonstandard versions of theRope interface very cautiously.]gpi c8q]rX -q7Br ]q]r-q7Br Yq]r'-q 7BrSsr MqF1rq?u Gr4( FH&; ARvX =/ :r*wrwrwr 8, 5UXwrqrwr 3wrqrwr 2Lwrqrqrwr /!wr) -:qr% ,M *wrw r &svX #$r$? !}6-  S 7 dwrwrwrwrwrwr*  wrwr BXqrqFr Xqr t[qtxtxtq ;xtxtxtxtxt Z yxt V=^8Cedar 7T10 Update2Escape Convention for LiteralsCedar provides an escape convention to allow denotations of nonprinting characters in character andstring literals (cf. the escape convention for the language C). The escape character is \, and thefollowing codes are recognized: Code Interpretation\n, \N, \r, \RAscii.CR\t, \TAscii.TAB\b, \BAscii.BS\f, \FAscii.FF\l, \LAscii.LF-- note that \n = LF in C\ddddddC-- where d is an octal digit, ddd < 377B\\\\''\""Anything else following a \ is an error.You can use the escape convention in character literals (e.g., '\n or '\032) or string literals (e.g.,"abc\ndef").APPLY and RETURNCedar is based upon a model of interprocedural control transfer in which the construction of anargument record is clearly separated from the actual transfer of control. In the usual forms forspecifying call or return, however, these operations are syntactically indivisible. There are nowalternative syntactic forms that allow you to invoke transfer operations using already constructedargument records.This extension is not fully general. The existing record must have a type compatible with the type required by thetransfer operation, and the only types compatible with argument record types are other argument record types. Suchtypes are defined implicitly by the definitions of transfer types, and they are always anonymous. Thus you cannotdeclare variables having such types, nor can you construct values with such types unless the target type is established bya transfer operation of some sort. The operator APPLY is used to apply a value with some transfer type to an argument record. Thesyntactic form isCall ::=...|APPLY [ Expression , Expression ]|APPLY [ Expression , Expression ! CatchSeries ]The type of the first Expression must be some transfer type (i.e., a type built using PROC, SIGNAL,ERROR, PROCESS, PORT or PROGRAM), and the second Expression must have a record type asgood as the argument type required for the transfer (see below). The effect is to invoke the transferoperation appropriate to the type of the first Expression, i.e., to call a procedure, raise a signal,join a process, etc. The scope of the optional catch phrase is just the transfer itself.Note that the first Expression implies a target type for the second, which can be (but normallywould not be) a constructor. For example,p[x, y]can be written asAPPLY[p, [x, y]]q[x]can be written asAPPLY[q, [x]] -- not APPLY[q, x] fvG bX ^rR ]nX [ YoXY#YoY5Yo V wrw UMr wrw Sr wrw Qr wrw PWr wrw.r Nw wr.wrwryr M r Ka r I r Gb( D7.8 B >zvXz ;erA 9O 8])9 6&< 5U 2LtE. 1F- /b .z -V# *Nr qr4 ( &O{rX $ qr{ r{ r# qr{ r{ r{ r { rqrqr Qqrqrqrqr{ r  [ I/{ r" Y { r0 * wrwrXwr qrwrwrwr wrwr qrwrwr.qrwrwr =W_Cedar 7T10 Update3The corresponding forms for returning an existing record areReturnStmt ::=...|RETURN Call|RETURN ( Expression )ResumeStmt ::=...|RESUME Call|RESUME ( Expression )In these forms, the required type is established by the context in which the statement appears. Thetype of the Call or Expression must be a record type as good as the result type of the procedurebody in which the ReturnStmt appears (or of the catch phrase in which the ResumeStmtappears).An argument record type T1 is as good as an argument record type T2 if both of the followingconditions are satisfied:T1 and T2 have the same number of fields, say n.For each i, 1 < i < n, the type of the i-th component of T1 is as good as the type of the i-thcomponent of T2; in addition, if both these components are named, the names are identical (i.e.,names of field selectors must match, but an anonymous component matches any namedcomponent). Note that this rule is more liberal than the rule for explicitly declared record types.In the terminology of the Mesa 5 manual, T1 is as good as T2 iff T1 conforms freely to T2; e.g., [0..10) is as good as[0..100). In the new view of types, we would say that T1 is as good as T2 iff the predicate for T1 implies the predicatefor T2.In Cedar 7T10, the constructs described above do not work for empty argument records; i.e., you cannot nest applicationsof procedures taking/returning nothing.Examples:P1: PROC [x, y: INT] RETURNS [m, n: INT] = {...};P2: PROC [m, n: INT] RETURNS [u, v: INT] = {...};P3: PROC [a, b: INT] RETURNS [u, v: INT] = { RETURN APPLY[P2, P1[a, b]]};i, j: INT;. . .[i, j] _ APPLY[P2, IF i < j THEN P1[i, j] ELSE [j, i]];[i, j] _ APPLY[P3, [0, 0] ! s => {GOTO L}]; -- [i, j] _ P3[0, 0 ! s => {GOTO L}]COMPILER CHANGESTioga Source FilesThe compiler and binder ignore text in Tioga trailers. Any occurrence of a pair of NUL characters(characters with value 0C) in a source file marks the logical end of that source file. fvG br< _{ rX ] qr{\Tr qr{ r Y{ r X2 qr{Vr qr{ r S_U Q {r{ rB PW{ r{ Nr K wKtKr'wKtKr I GbwFtGbrXwFtGbr%wr E wryrwryrwrwrwD}tE rwr C@ wBtC@r2 Au$- ? =vW ;At)x:t;A x:t;Ax:t;Ax:t;A 97x9 t9 x9 t9x9 t9 7x7ft7 5U# 4' 1w /!rXqrwrwrwrqrwrwrwr ,wrqrwrwrwrqrwrwrwr *+wrqrwrwrwrqrwrwrwr (qrqrwrwrwrwr & wrwrqr $a "wrwrqrqrwrwrqrwrwrwrqrwrwr !wrwrqrwr wrqrwr.wrwrwrwrqrwr Iv ' r,6 wV 0=UCedar 7T10 Update4File LockingThe Cedar 7T10 compiler is designed to be run under control of the system modeller. It alsoexports an interface allowing it to be run from Tajo or from the temporary Cedar executive. Whenit is run in this mode, the (rather minimal) facilities in PreCascade for obtaining exclusive access toa file are bypassed. Use caution. fvG bX ^r)3 ]nJ [b Zf"d Z= 6 TIMESROMAN  HELVETICA TIMESROMAN LOGO TIMESROMAN HELVETICA TIMESROMAN  TIMESROMAN  TIMESROMAN MATH   HELVETICA  HELVETICA n -j/J5ZCedar7T10Update.bravo SatterthwaiteDecember 18, 1981 10:15 AM