[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Liberty-eiffel] Problem with agents
From: |
Raphael Mack |
Subject: |
Re: [Liberty-eiffel] Problem with agents |
Date: |
Tue, 22 Dec 2015 23:37:55 +0100 |
Hi,
Am Dienstag, den 22.12.2015, 12:01 -0600 schrieb Germán Arias:
> Hi
>
> If I use something like
>
> ROUTINE[ANY, TUPLE]
>
> as explained here:
>
> http://www.jot.fm/issues/issue_2004_04/article7/
>
> I get this compiler warning:
>
> ****** Warning: The base type is no longer used. Class ROUTINE
> now has only one formal argument. Just remove this unused type
> mark.
>
> Line 9 column 21 in IUP_WIDGET
> (/home/german/Instalados/tests/liberty/iup_test/auxiliary/iup_widget.e):
> cb_action: ROUTINE[ANY, TUPLE]
> ^
>
> As far as I understand, this first argument represent the object which
> to routine belongs. But according with the warning, this argument is not
> used anymore. So, how know Eiffel where should be executed that routine?
> This seems to be the problem. Because I'm doing this using as reference
> the article I cited above.
The target is included in the agent object, so when an agent is called
from Eiffel by x.call([]), it is defined. And where is it taken from? -
Yes, the agent creation is the key:
when you write "agent x.command" the object referenced by variable x is
used as target and command is the feature. When you skip the explicit
target, the implicit target "Current" is used - as for all non-qualified
calls. The only case to get an agent instance without defined target ist
by "agent {SOMECLASS}.feature". In this case the target is "the first
open argument"...
(agent {STRING}.to_lower).call(s)
is equivalent (but slower) to
s.to_lower
I hope this helps...
Rapha
Re: [Liberty-eiffel] Problem with agents, Raphael Mack, 2015/12/22
Re: [Liberty-eiffel] Problem with agents, Raphael Mack, 2015/12/22