Re: Modified Interpreter
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 12, 2003
- 478 views
----- Original Message -----=20 From: "Igor Kachan" <kinz at peterlink.ru> To: "EUforum" <EUforum at topica.com> Subject: Re: Modified Interpreter >=20 >=20 > Hello Pete, >=20 > > From: Pete Lomax <petelomax at blueyonder.co.uk> > > To: EUforum <EUforum at topica.com> > > Subject: Re: Modified Interpreter > > Sent: 12 july 2003 y. 12:13 > >=20 > >=20 > > On Sat, 12 Jul 2003 10:14:07 +0400, Igor Kachan <kinz at peterlink.ru> > > wrote: > >=20 > > <snip> > > >Z.EX:4 > > >A namespace qualifier is needed to resolve z. > > >z is defined as a global symbol in: > > > C:\DOWNLO~1\EXM\a.e > > > C:\DOWNLO~1\EXM\b.e > > > C:\DOWNLO~1\EXM\c.e > > That is as expected, z.e needs to include a.e, b.e, and c.e with=20 > > namespaces. Given that z.e is your code, that should not be a=20 > > problem. >=20 > a.e, b.e, c.e are all my code, not only z.e.=20 > So, there is no problem with any transformations of this code. > I wanted b.e, c.e, z.ex can do some job with the global=20 > integer z of a.e. > But interpreter doesn't see this *GLOBAL* symbol > inside b.e and c.e, it sees global z only inside z.ex after=20 > the first reference to global z in z.ex, not in b.e and c.e. > This is a problem. Too late error message. >=20 > > If having just typed in (your own code) and run > > include b.e > > ? z > > and got a namespace qualifier required error, then immediately > > changing it to: > > include b.e as b > > ? b:z > > is easy peasy, No? >=20 > Peasy, not easy. I have tons of my own big libs of different versions=20 > which are dependant one on another and may have the globals with > the same names. Libs are *my* and proggy is *my*. >=20 > > <snip and shuffle:> >=20 > Ok, I'll just reshuffle :] >=20 > > >So, v2.4 doesn't run my simple program properly, > > >it doesn't see global integer z, defined in a.e, > > >inside b.e and c.e.=20 > > It sees all of them, and does not know which=20 > > you mean. >=20 > If it doesn't know which one, I prefer it asks me, doesn't > ignore *my* globals, doesn't print just any first one. >=20 > > Do *you* know which z you mean? >=20 > Yes I do know. The very first global z of a.e, > then the second global z of b.e and then the third global z of c.e. >=20 > > The problem being addressed here is if a.e, b.e,=20 > > and c.e are not your code but some third party code,=20 > > you do not want to have to edit them, > > and certainly not re-edit them each time the author=20 > > releases a new improved version.=20 > > That used to be the case,=20 >=20 > Pete, I know. >=20 > > it should not be any more. >=20 > Touch wood Pete. >=20 > > >If I run z.ex on v2.2, I get: > > > > > >C:\EUPHORIA>ex Z.EX > > >1 > > >C:\EUPHORIA\b.e:1 > > >attempt to redefine z - defined already in C:\EUPHORIA\a.e > >=20 > > Yes, standard 2.4 is already an improvement over 2.2(!) >=20 > Ok, viva 2.4, I love it, but it issues it's warning and=20 > aborting too late and prints too many different global zs.=20 > I like 2.2 for that my proggy. >=20 > > >Global integer z of a.e is invisible in b.e and c.e. > > Not quite. They would be, only eu 2.4 is automatically=20 > > (and correctly) figuring out which z is meant in each=20 > > case (the local one). >=20 > Why do you say "correctly" if 2.4 doesn't want to know > my first global z? Matt too doesn't want to know ... =20 > Is it "correct" and "automatic"? >=20 > > If you did not define z in say b.e, then it (b.e) would use the one <snip> I take it back. Now I'm *sure* you have no understanding of the rules. It seems that you are saying that Euphoria should issue an error message = when the b.e file tries to declare a global 'z', because a.e has already = defined 'z'. Is this the problem that you see? --=20 Derek