----- Original Message ----- From: "Kari Pahula" <[EMAIL PROTECTED]> To: "Anthony Borla" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, November 27, 2005 10:19 PM Subject: Re: Oz Newbie: Access to Outer Scope Variable
Kari, > On Sun, Nov 27, 2005 at 04:36:48PM +1100, Anthony > > Borla wrote: > > According to Section 5.5 of the Oz Docuemntation it is > > possible to have identically-named variables at different > > scopes. Access to the outer-scoped variable is possible > > [in certain contexts] via the '!' operator which 'suppresses' > > the inner-scoped variable. > > That isn't quite right. This is what reads in there: > > > If we want Y to denote the variable in the outer scope, > > we have to suppress the introduction of the inner Y in the > > L.H.S. of the initializing equality by using an exclamation > > mark ! as follows. An exclamation mark ! is only meaningful > > in the L.H.S. of an initializing equality > Fair enough. I'd interpreted this to have the meaning I earlier mentioned. This was, obviously, a misreading. > > That is, the effect of using ! is to suppress introducing a new > variable, not to access any variable from an outer scope. > > !A will just pick the nearest A it sees, which happens to be > the one in the same inner scope in your code. > Do you happen to know whether it is possible to access an 'outer-scoped' variable that is hidden by an inner-scoped one having the same name ? It's certainly easy enough to change the inner variable name, but I was hoping to avoid this. Cheers, Anthony Borla _________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
