Torsten Schoenfeld <kaffeetisch gmx de> writes:
I don't know if it will work -- did you try it?
I did now!
Do we want to support assigning to $_[-1]?
It could be in the docs if it's meant to work. I can't see any disadvantage, it gets you a free bit of "state data" if you want to use it that way. I see GClosure for signals is this way -- refcnt inc and mortalize -- and assigning alters the stored data. I guess GPerlCallback can be the same. The net change then to it is just a refcount fix which was tickled by a callback disconnecting/destroying itself. (Some test cases under in GtkLinkButton because there's no destroyable GPerlCallbacks in plain Glib.)
Attachment:
GClosure.xs.callback-userdata-2.diff
Description: Text Data
Attachment:
GtkLinkButton.t.callback.diff
Description: Text Data
-- The sigfile one-line movie reviews series: "On the Beach" -- where better for the end of the world than Melbourne.