I don't understand how to use it either. I think you don't need it:
Define Class(
"aa",
{_init_ = Method( {a}, this:b = a ), //
x=1, //
m1 = Method( {a, b}, a * b )}
);
//
lcaa42 = New Object( aa(42) );
lcaa42:x= Run Program(//
Executable( "PING.EXE" ), //
Options( {"-n 50", "localhost"} ), //
ReadFunction(
Function( {this},
write(this << read);
)
)
);
wait(5); // report about 5 of the 50 pings to the log
// this will destroy the old object and replace it with a
// new one. The log will report the RunProgram object was
// destroyed; there may be a more clever way to witness the
// destruction...best I could come up with...
lcaa42 = New Object( aa(42.1) ); // the old one is gone
lcaa43 = New Object( aa(43) ); // the class still works
show(lcaa42:b,lcaa43:b); // 42.1,43
Show Classes();
Pinging v1-PC [::1] with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
The external program was producing output when the RunProgram object was destroyed.
Use a JSL variable to hold the RunProgram object.
Optionally, send messages to the variable to manage the object's lifetime.
lcaa42:b = 42.1;
lcaa43:b = 43;
// Class aa
_init_ = Method( {a}, this:b = a );
m1 = Method( {a, b}, a * b );
x = 1;
This shows the first object was deleted by assigning a new value to the variable holding it.
If other variables are copied (not cloned)
lcaa42b=lcaa42;
then all the copies must be cleared to destroy the object.
lcaa42b=0;
lcaa42=0;
@EvanMcCorkle
Craige