10.07.2015 Views

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

92 van Wijngaarden, et al.ALGOL <strong>68</strong> Revised Report93The relevant production tree (with elision of "NEST',"with TAG', and with invisible subtrees omitted) is:Iwidening coerciondereferencing coercion6.1.1. SyntaxA)B)C)D)E)F)G)a)b)c)d)e)f)g)h)'strong real identifier coercee'I 6.1.1.a* 'widened to real identifier'I 6.5.1.a'dereferenced to integral identifier'I 6.2.1.a'applied' and[ 'unchanged from reference to integral identifier'[ 6.1.l.f'reference to integral identifier' (coercend)[ 4.S.l.b, 9.1.f I'letter i symbol' .}STRONG{a,66a} :: FIRM{B} ; widened to{65a,b,c,d} ; rowed to{66a} ;voided to{67a,b}.FIRM{A,b} :: MEEK{C} ; united to{64a}.MEEK{B,c,d,62a,63a,64a,65a,b,c,d} :: unchanged from{f} ;dereferenced to{62a} ; deprocedured to{63a}.SOFT{e,63b} :: unchanged from{f} ; softly deprocedured to{63b}.FORM :: MORF ; COMORF.MORF :: NEST selection ; NEST slice ; NEST routine text ;NEST ADIC formula ; NEST call ;NEST applied identifier with TAG.COMORF :: NEST assignation ; NEST identity relation ;NEST LEAP generator ; NEST cast ; NEST denoter ;NEST format text.strong MOlD FORM coercee{5A,B,C,D,A341i} :where (FORM) is (MORF), STRONG{A} MOlD MORF ;where (FORM) is (COMORF), STRONG{A} MOlD COMORF,unless (STRONG MOLD) is (deprocedured to void).firm MODE FORM coercee{5A,B,C,D,542c} : FIRM{B} MODE FORM.meek MOlD FORM coercee{5A,B,C,D} : MEEK[C} MOlD FORM.weak REFETY STOWED FORM coercee{5A,B,C,D} :MEEK{C} REFETY STOWED FORM,unless (MEEK) is (dereferenced to)and (REFETY) is (EMPTY).soft MODE FORM coercee{5A,B,C,D} : SOFT{D} MODE FORM.unchanged from MOlD FORM{C,D,67a,b} : MOlD FORM.* SORT MOID coercee : SORT MOID FORM coercee{a,b,c,d,e}.* MOID coercend : MOID FORM.{Examples:a) 3.14 (in x := 3.14)b) 3.14 (in x + 3.14)c) sin (in sin (x))d) xl (in xl [2] := 3.14)e) x (in x := 3.14) }{For 'MOLD FORM" (rule f), see the cross-references inserted insections 5.I.A,B,C,D before "coercee". Note, however, that a 'MOLD FORM'may be a blind alley. Blind alleys within this chapter are not indicated.}{There are five sorts of syntactic position. They are:• "strong" positions, i.e., actual-parameters, e.g., x in sin(x), sources;e.g., x in y:=x, the ENCLOSED-clause of a cast, e.g., (nil) inref book (nil), and statements, e.g., y := x in (y : = x; x : = 0);• "firm" positions, i.e., operands, e.g., x in x+y;• "meek" positions, i.e., enquiry-clauses, e.g., x>O in (x~Olx[O),boundscripts, e.g., i in xl [i], and the PRIMARY of a call, e.g., sin insin (x);• "weak" positions, i.e., the SECONDARY of a selection and thePRIMARY of a slice, e.g., xl in xl [i];• "soft" positions, i.e., destinations, e.g., x in x := y and one of theTERTIARYs of an identity-relation, e.g., x in xx :=: x.Strong positions also arise in balancing (3.2.1.e).In strong positions, all six coercions may occur; in firm positions,rowing, widening and voiding are forbidden; in meek and weak positions,uniting is forbidden also, and in soft positions only deproceduring isallowed. However, a dereferenccd-to-STOWED-FORM may not be directlydescended from a weak-STOWED-FORM-coercee (rule d) for, otherwise,x :=xl [i] would be syntactically ambiguous (although, in this case, notsemantically). Also, a deprocedured-to-void-COMORF may not be directlydescended from a strong-void-COMORF-coercee (rule a) for, otherwise,(proc void engelfriet; proc void rijpens = skip; engelfriet : = rijpens; skip)would be ambiguous.}6.2. Dereferencing{Dereferencing serves to obtain the value referred to by a name, as inx:=y, where y yields a name referring to a real number and it is thisnumber which is assigned to the name yielded by x. The a priori mode ofy, regarded as a coercend, is 'reference to real' and its a posteriori mode,when y is regarded as a coercee, is 'real'.}6.2.1. Syntaxa) dereferenced to{61C} MODEl FORM :MEEK{61C} REF to MODE2 FORM,where MODE2 deflexes to MODEl{47a,b,c,-}.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!