Re: agents / TUPLE inheritance

Philippe Ribet <[email protected]>
Newsgroups gmane.comp.lang.eiffel.smalleiffel
Message-ID <[email protected]>
Peter Gummer wrote:

> 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.
>
Thanks for your support Peter!
Raphael, you should really read the paper to know more about this problem.

> Your problem is interesting, though. It seems to demonstrate that the 
> ISE/ECMA approach also has advantages.
>
>
 From my point of view, this example gives nothing in favour of ISE/ECMA 
approach. In few simple words:
a: ROUTINE[ANY, TUPLE[TT]]  ---> "a" is a routine able to handle 
arguments of type TT.

"g" is declared as "g(i: T1) is", so it is not able to handle arguments 
of type TT. That's why the compiler refuses to assign "agent g" into "a".

Is this clear enough?

Best regards

>
> 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
>>
>
>
>


-- 
Philippe Ribet



                         The README file said
              "Requires Windows 95, NT 4.0, or better."
                    So... I installed it on Linux!
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.