Compile error: Polymorphic External slot is not possible.

Mildred Ki'Lya ml.mildred593 at gmail.com
Wed Oct 28 20:34:00 UTC 2009


On 08/25/2009 07:42 PM, Jeremy Cowgar wrote:
> I am sorry for so many questions today, but I have been venturing into
> some new territory with Lisaac. I have one more... When I use this
> method more than once, I get a compilation error:
>
> Polymorphic External slot is not possible.
> Line 20 column 29 in BUTTON(C:/Development/Projects/Lisaac/libraries/iup-binding/button.li):
>   - perform_action h:POINTER :INTEGER <-
>
> I have committed my code into the Git repo, the file in question can be
> viewed online at:
>
> http://git.debian.org/?p=lisaac/libraries/iup-binding.git/.git;a=blob_plain;f=button.li;hb=6b17e7dfb7b053aade730acd8f5fd86a5ca41d05
>
> Now, to see how this is used, you can view the example program:
>
> http://git.debian.org/?p=lisaac/libraries/iup-binding.git/.git;a=blob_plain;f=example.li;hb=6b17e7dfb7b053aade730acd8f5fd86a5ca41d05
>
> If you comment out the line starting with "goodbye.set_action {" then
> the example program compiles and runs fine. However, uncomment that line
> and you get the above compile error.
>
> How do I solve this problem? I believe this is happening because Lisaac
> thinks that I call "perform_action" inside of the "BUTTON.set_action"
> slot. I actually do not. The only reason for the #if 0 ... block of code
> is so that Lisaac will actually output my External slot, "perform_action".
> Without calling "perform_action" somewhere in my code, the
> "perform_action" slot is optimized out of existence.
>
> Thanks for any help!
>
>   
Hi,

I just looked again at your code and I don't think this is going to work
the way you intended.

I think the real problem is that External slots MUST always be called
with Self=SELF. Otherwise it won't work.

The way External slots are compiled in C makes it impossible to pass the
implicit Self argument (the receiver). So, don't ever try. When you call
`perform_action NULL' Self might be different from SELF, this raises an
error in Lisaac.

So, you could write instead:

    `
    #if 0
    `;
    SELF.perform_action NULL;
    `
    #endif
    `;


Mildred

-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk: <mildred at jabber.fr>
│ Website: <http://ki.lya.online.fr>           GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/lisaac-devel/attachments/20091028/a82b9d5e/attachment.pgp>


More information about the Lisaac-devel mailing list