Yes, there is a limitation on the equal operator. The second parameter
should be able to be anything. It is a bug.

You can workaround it, by switching the order, print(srv == txt) should
work in this case, but it will not compare two Iup Handles.

Best,
Scuri


Em qua., 30 de jul. de 2025 às 08:16, Francisco Sant'anna <
francisco.santa...@gmail.com> escreveu:

> Hi,
>
> This (minimal) code fails when comparing an IUP object with a socket
> handle:
>
> require "iuplua"
> s = require "socket"
> txt = iup.text{}
> srv = s.bind("*", 0)
> print(txt == srv)
>
> lua5.4: tst.lua:5: bad argument #2 to 'eq' (iupHandle expected, got
> tcp{server})
>
> I believe it should print "false".
>
> In the actual code, I have a list of listeners waiting for events. This
> list is indexed by these handles.
>
> Thanks,
> Francisco
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to