Re: agents / TUPLE inheritance

Peter Gummer <[email protected]>
Newsgroups gmane.comp.lang.eiffel.smalleiffel
Message-ID <[email protected]>
Hi Raphael,

I think you may have encountered a consequence of a difference of 
opinion described in this paper by Philippe Ribet:

http://www.jot.fm/issues/issue_2004_04/article7

I use the ISE compiler, and on several occasions I have encountered the 
problem that the article seeks to fix. For this reason, I have tended 
to agree with the SmartEiffel approach to agent conformance.

Your problem is interesting, though. It seems to demonstrate that the 
ISE/ECMA approach also has advantages.

- Peter Gummer


On 08/04/2005, at 3:58 AM, Raphael Mack wrote:

> Hi,
>
> I tired to compile the following code:
>
> class A
>
> creation
>     make
>
> feature
>     make is
>         local
>             t: T1
>         do
>             create {T1}t
>             a := agent g(?)
>             a.call([t])
>         end
>
>     g(i: T1) is
>         do
>             io.put_string(i.out)
>         end
>
>     a: ROUTINE[ANY, TUPLE[TT]]
>
> end
>
>
> with T1 and TT:
> class TT
> end
>
>
> class T1
> inherit TT
>         redefine
>                 out
>         end
> creation
>         default_create
> feature
>         out: STRING is
>                 do
>                         Result := "T1..."
>                 end
> end
>
> And I get
> ****** Fatal Error:  Bad assignment (VJAR). Cannot assign `agent
> g(?)' which is of type PROCEDURE[ANY,TUPLE[T1]] into `a' which
> is of type ROUTINE[ANY,TUPLE[TT]].
> Line 12 columns 4, 9 in A (/home/r/eiffel/se_test/a.e):
>          a := agent g(?)
>          ^    ^
> ------
>
> For me, this seems to be perfectly fine Eiffel (and it works with ise) 
> - what's wrong with it?
>
> Thanks,
> Raphael
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.