Re: Yay for me, found an interpreter bug!
----- Original Message -----
From: "Urzumph" <Urzumph at HotPOP.com>
To: "Mailing List" <EUforum at topica.com>
Subject: Yay for me, found an interpreter bug!
>
>
> so, now all I have to do is write a quite large work-around for it.
>
> Running the 2.4 Interpreter :
>
> namespacebugtest.e :
>
> atom mynumber
> mynumber = 10
>
> global procedure changemynumber(atom number)
> mynumber = number
> end procedure
>
> global procedure devide(atom number)
> ?(number/mynumber)
> end procedure
>
> include get.e
> include namespacebugtest.e as TEST1
> include namespacebugtest.e as TEST2
> object foobar
>
> TEST1:changemynumber(5)
> TEST2:changemynumber(0)
> puts(1,"If it prints 1, then the interpreter works, if it crashes, then
> it's broken.\n")
> TEST1:devide(5)
>
> foobar = wait_key()
>
> I guess I'll have to do what I was really hoping not to do, to create a
> _2 copy of the include file. Problem with that is, the real file is like
> 500 lines of buggy code which needs fixing on a daily basis :(
>
This is not a bug. This behaviour is documented. What you end up with is that
TEST1 and TEST2 are aliases for the same global routines. Whenever you include a
file more than once, the second and subsequent includes are NOT actually
included, but the namespace qualifier just becomes an alias.
--
Derek
|
Not Categorized, Please Help
|
|