[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: flconvert for lua-fltk, v0.1
- From: "Jay Carlson" <nop@...>
- Date: Tue, 10 Jul 2001 18:12:22 -0400
Luiz Henrique de Figueiredo writes:
> >I believe constant strings in functions won't be collected
>
> When a function is collected, everything in it is collected as well,
> including string literals.
Yeah. I figured that out on the drive home. Apparently I've been spending
too much time away from languages with closures. So I'll restate:
Constant strings in functions stored in the global environment, like those
created by flconvert, won't be collected.
It's still a correctness problem. I'm probably going to solve it for now by
way of a layer of Lua code, since there doesn't appear to be any good way to
insert code into toLua-generated constructors. (By the way, code insertion
into constructors would let me stuff the widget class tag into the
Fl_Widget->user_data() and let me reconstitute arbitrary Fl_Widget * into
the appropriately tagged toLua subclasses.)
Jay