Hi all, I have a big probleme with agent library. I tried to transform it more generic, using genericity.<br><br>So, I defined a prototype PENCIL which inherit from AGENT(PENCIL).<br><br>(All the code is in the git repo application, branch master, in directory application/examples/standard/agent)<br>
<br>I have a Section Header<br><br> + name := PENCIL;<br><br> - copyright := "2003-2010 Sonntag Benoit; P-A";<br><br> - author := "Pierre-Alexandre Voye";<br> - comment := "Pencil agent";<br>
<br>Section Inherit<br><br> + parent_agent:Expanded AGENT(PENCIL);<br><br>Section Public<br> <br> + step:INTEGER;<br> <br> + x:INTEGER;<br> <br> + y:INTEGER;<br><br> + dx:INTEGER;<br> + dy:INTEGER;<br><br clear="all">
...<br><br><br>Agent is defined like this :<br><br>Section Header<br> <br> + name := AGENT(V);<br><br><br>Maybe because PENCIL inherit from AGENT(PENCIL), I have an error from the compiler :<br><br>$ lisaac <a href="http://example.li">example.li</a><br>
Load lip file: ./../make.lip<br>Warning: Slot `output_extension' not found.<br>Warning: Slot `is_library' not found.<br>Warning: Slot `output_extension' not found.<br>Depending pass: ....--SEMANTIC---------<br>
Invariance type argument invalid.<br>Line 62 column 10 in PENCIL(.../application/examples/standard/agent/<a href="http://pencil.li">pencil.li</a>):<br> - make s:STATE(PENCIL) <-<br> ^<br><br>Line 44 column 10 in AGENT(.../application/examples/standard/agent/<a href="http://agent.li">agent.li</a>):<br>
- make s:STATE(V) <-<br> ^<br><br><br>I'm unable to understand what's the problem...<br><br>Surprasingly when I change<br><br> + parent_agent:Expanded AGENT(PENCIL)<br><br>to<br><br> + parent_agent:Expanded AGENT(SELF);<br>
<br>I have :<br><br>$ lisaac <a href="http://example.li">example.li</a><br>Load lip file: ./../make.lip<br>Warning: Slot `output_extension' not found.<br>Warning: Slot `is_library' not found.<br>Warning: Slot `output_extension' not found.<br>
Depending pass: ..--SEMANTIC---------<br>Cannot resolve type for type parameter SELF<br>Line 23 column 8 in PENCIL(.../application/examples/standard/agent/<a href="http://pencil.li">pencil.li</a>):<br> + name := PENCIL;<br>
^<br><br><br>Thanks for your help,<br><br>regards, <br>P-A<br><br>-- <br>---------------------<br>Isaac Project - <a href="http://www.lisaac.org/">http://www.lisaac.org/</a><br>