In JSL I can define a class and use it as a template to instantiate objects.
How do I delete the object?
I've been using the message deleteClass, assuming its a slight misnomer and really it's deleting the object.
But in version 15 it really does seem to delete the class. Once I use the message I'm unable to create any further instances of the class.
I can use a delete message but I think its just an alias for deleteClass and I have the same problem.
Is delete class really intended to wipe out the entire class definition? If so, what is the correct way of deleting the object?
Here is a simple test script:
names default to here(1);
defineClass("MyClass",{
_value = .,
_init_ = method({value},
_value = value;
),
getValue = method({},
return(_value)
)
});
// this works
obj = newObject( MyClass( 10 ) );
show(obj:getvalue);
// this works
obj = newObject( MyClass( 20 ) );
show(obj:getvalue);
// there should be no harm deleting
// an object once I am finished with it
obj<<delete;
// but this now fails ...
obj = newObject( MyClass( 30 ) );
show(obj:getvalue);