To all,
Using Steve's example, I have passed this through the unicon compiler
using the -E option (see attached output). I notice that in the
Test_initially procedure that the reference to the method m2 appears to
be wrong.
In the code it appears as
f(self.m2)
whereas, I would be expecting it to appear as
f(self._m.m2)
Assuming, I have followed the code correctly. I have just run a test and
if I manually insert the .__m as shown above, and compiled with icont, I
then get the result
inside f
as expected from the code as written.
Hopefully, this will enable the solution to be found with relative ease.
regards
Bruce Rennie
On 09/04/2013 12:44 AM, Steve Wampler wrote:
>
> I would be amazed if this were anything *but* an error. Here's a reduced
> case that shows the same problem:
> ---------------------------------
> procedure main()
> t := Test()
> end
>
> procedure f(g)
> write("inside f")
> end
>
> class Test()
>
> method m2()
> write("this is method 2")
> end
>
> initially()
> f(m2)
> end
> -------------------------------
> which outputs:
> -------------------------------
> ->foo
> this is method 2
> ->
> --------------------------
>
/home/bruce/unicon/bin/icont -c -E -O trial2.icn /tmp/uni19105049
#line 0 "/tmp/uni19105049"
#line 0 "trial2.icn"
procedure main();
t := Test();
end
procedure f(g );
write("inside f");
end
#line 10 "trial2.icn"
procedure Test_m2(self)
write("this is method 2");
end
procedure Test_initially(self)
f(self.m2);
return
end
record Test__state(__s,__m)
record Test__methods(m2,initially)
global Test__oprec
procedure Test()
local self,clone
initial {
if /Test__oprec then Testinitialize()
}
self := Test__state(&null,Test__oprec)
self.__s := self
self.__m.initially(self,) | fail
return self
end
procedure Testinitialize()
initial Test__oprec := Test__methods(Test_m2,Test_initially)
end
procedure main();
local t
t := Test();
end
procedure f(g );
write("inside f");
end
procedure Test_m2(self)
write("this is method 2");
end
procedure Test_initially(self)
f(self.__m.m2);
return
end
record Test__state(__s,__m)
record Test__methods(m2,initially)
global Test__oprec
procedure Test()
local self,clone
initial {
if /Test__oprec then Testinitialize()
}
self := Test__state(&null,Test__oprec)
self.__s := self
self.__m.initially(self,) | fail
return self
end
procedure Testinitialize()
initial Test__oprec := Test__methods(Test_m2,Test_initially)
end
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group