1. Re[2]: Yay for me, found an interpreter bug!

DP> However, you can get it to work as you'd like to , namely
DP> including the file twice. All you have to do is place a copy of
DP> the include file in two different folders and include it thus ...

DP>   include one\namespacebugtest.e as TEST1
DP>   include two\namespacebugtest.e as TEST2

DP> and this will work just fine then. That is, you will have two
DP> instances of the local variables defined in the include file.

DP> A kludge, but it works.

Or if you don't want to copy, just use

   include namespacebugtest.e as TEST1
   include .\namespacebugtest.e as TEST2
   include .\.\namespacebugtest.e as TEST3
   include .\.\.\namespacebugtest.e as TEST4

Each of them will have different instance.

new topic     » topic index » view message » categorize

2. Re: Re[2]: Yay for me, found an interpreter bug!

----- Original Message ----- 
From: <akusaya at gmx.net>
To: "Derek Parnell" <ddparnell at bigpond.com>
Cc: <EUforum at topica.com>
Subject: Re[2]: Yay for me, found an interpreter bug!


> DP> However, you can get it to work as you'd like to , namely
> DP> including the file twice. All you have to do is place a copy of
> DP> the include file in two different folders and include it thus ...
> 
> DP>   include one\namespacebugtest.e as TEST1
> DP>   include two\namespacebugtest.e as TEST2
> 
> DP> and this will work just fine then. That is, you will have two
> DP> instances of the local variables defined in the include file.
> 
> DP> A kludge, but it works.
> 
> Or if you don't want to copy, just use
> 
>    include namespacebugtest.e as TEST1
>    include .\namespacebugtest.e as TEST2
>    include .\.\namespacebugtest.e as TEST3
>    include .\.\.\namespacebugtest.e as TEST4
> 
> Each of them will have different instance.
>    

Thanks Aku. I thought that RDS fixed that bug. I wouldn't rely on this method
though because they could fix it in a future release.

-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

3. Re: Re[2]: Yay for me, found an interpreter bug!

On Sun,  2 Nov 2003 13:44:55 +0000, Al Getz <Xaxo at aol.com> wrote:

>I havent found this to work right.

Something else you can try. Have a standard include file as follows:

copyinc.e:
--
-- multiple file include
--
include file.e
global procedure copyinc(sequence infile, sequence outfile)
sequence cmdline, dirinfo
integer tin,tout
	cmdline=command_line()
	-- do nothing if bound:
	if equal(cmdline[1],cmdline[2]) then return end if
	dirinfo=dir(infile)
	tin=open(infile,"r")
	tout=open(outfile,"w")
	if not sequence(dirinfo) or length(dirinfo)!=1
	or tin=-1 or tout=-1 then
		printf(1,"error opening %s\n",{infile})
		if getc(0) then end if
		abort(0)
	end if
	-- I believe this is the fastest way to do this:
	for i=1 to dirinfo[1][3] do
		puts(tout,getc(tin))
	end for
	close(tin)
	close(tout)
end procedure

Then you can just code:

include t.e as test1
include copyinc.e
copyinc("t.e","t2.e")
include t2.e as test2

test2:x=3
test1:x=2

?test2:x -- this now prints a "3"


Of course I expect you'll poo-poo this idea the same way you failed to
answer the question in my last post.

I am in no way suggesting this is a sensible programming technique,
quite the opposite...

Pete

new topic     » goto parent     » topic index » view message » categorize

4. Re: Re[2]: Yay for me, found an interpreter bug!

----- Original Message ----- 
From: "Al Getz" <Xaxo at aol.com>
To: <EUforum at topica.com>
Subject: RE: Re[2]: Yay for me, found an interpreter bug!


> 
> Hello Aku,
> 
> I havent found this to work right.
> 
> Here are the two files used to test:
> 
> --tn.ew-------------
> global atom x
> --------------------
> 
> --testincl.ew----------------
> include file.e
> 
> include tn.ew as Test1
> include .\tn.ew as Test2
> 
> Test2:x=3
> Test1:x=2
> 
> ?Test2:x --prints a "2"
> 
> sleep(4)
> ---------------------------
> 
> The test is simple: if the printout is a "3"
> the two files were treated as separate instances,
> but if not, a "2" is printed out.  Since a "2"
> was indeed printed out, they were not treated 
> as separate instances.
> 
> What Eu version/platform are you running?
> Mine is Eu2.4 on XP.
> 

Wierd! 
Using "include .\tn.ew as Test2" does not work, but using "include ./tn.ew as
Test2" does work.

-- 
Derek

new topic     » goto parent     » topic index » view message » categorize

5. Re[2]: Yay for me, found an interpreter bug!

IM> Unfortunately, this doesn't work on Linux. Neither does copying the file
into
IM> a separate directory. Nor does putting quotes around the include names help
IM> any. The only thing that works is changing the filename or extension.

How about using links in Linux? I haven't tried it (no linux installed
here), but maybe something like this can work:

$ ln -s test2.e test1.e

then

include test1.e as test1
include test2.e as test2

Can it work?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu