Closed
Description
I'm building a set of libraries, trying to mimic some OOP concepts, and predictably crashing to desktop when accessing delegates in certain ways e.g. printing the object that contains the self-bound delegate.
@LAZYGLOBAL OFF.
// instantiate the object
local the_object is lex("state", "some state").
// define the member function
local function show_state {parameter self.print "self state: "+self:state.}.
// add the member function to the object instance.
the_object:add("show_state",show_state@:bind(the_object)).
// use the member function.
the_object:show_state().
wait until false. // comment this line to crash your program.
print the_object. // CTD for accessing a self-bound member.
// maybe due to infinite recursion following the member looping back to the parent.
Metadata
Assignees
Labels
No labels
Activity