Dear Raphael, thanks for you explanation. But I am still looking for the place in the language definition where the value of a pair of sentences is defined to be the value of the last sentence, and similarly where the value of a "local ... in <s2> end"-sentence is the value of the <s2>?
Pedagogical tricks wrt. Oz syntax anyone? Regards, --- Øystein N. Den 4. nov. 2011 kl. 19.05 skrev Raphael Collet: > Dear Øystein Nytrø, > > The statement "local Y in local X=[1 2] in X.1 = Y end end" is used as an > expression. Consider a fresh variable Z assigned to it, and rewrite the > browse statement as: > > local Z in > Z = local Y in local X=[1 2] in X.1 = Y end end % (1) > {Browse Z} > end > > You can push the assignment to Z inside (1) as: > > local Y in > local X=[1 2] in > Z = (X.1 = Y) > end > end > > The statement (X.1 = Y) is a valid expression, and its value is equal to both > X.1 and Y. Therefore the value of Z is 1. QED :-) > > Cheers, > Raphael > > On Fri, Nov 4, 2011 at 3:11 PM, Øystein Nytrø <nyt...@idi.ntnu.no> wrote: > > Running: > {Browse local Y in local X=[1 2] in X.1 = Y end end} > %% (for example) > > yields > "1" > > Would anyone care to point to where the semantics of {Browse <sentence>} is > explained properly? > > Regards, > --- Øystein Nytrø > > ------------------------------------------------------------------------------------------------------- > Inst. for datateknikk og info.vitenskap | Dept. of computer and info. science > IDI, NTNU, NO-7491 TRONDHEIM, Norway > tel +47 73594459, mob +47 91897606 > > > > > > > > > _________________________________________________________________________________ > mozart-users mailing list > mozart-users@mozart-oz.org > http://www.mozart-oz.org/mailman/listinfo/mozart-users > > _________________________________________________________________________________ > mozart-users mailing list > mozart-users@mozart-oz.org > http://www.mozart-oz.org/mailman/listinfo/mozart-users ------------------------------------------------------------------------------------------------------- Inst. for datateknikk og info.vitenskap | Dept. of computer and info. science IDI, NTNU, NO-7491 TRONDHEIM, Norway tel +47 73594459, mob +47 91897606
_________________________________________________________________________________ mozart-users mailing list mozart-users@mozart-oz.org http://www.mozart-oz.org/mailman/listinfo/mozart-users