![]() |
.. (לתיקייה המכילה) | |
What do you mean by "a global data structure"? | |
A global variable in LST is any variable which is not a method variable and not a class variable. You don't have to declare it before using it. You can refer to it using isNil even before initializing it. |
Which classes do we have to submit? should we submit every class for which we added a clean method? | |
You should only submit classes that take part in the implementation of the reference counting. That is, not classes whose objects are being reference counted. Your implementation should include a destruct method which invokes clean. You don't have to submit classes which implement clean. |
What do you mean by "You don't have to handle Arrays and Numbers"? Do we have to include special checks for these cases? | |
No. It only means that we will not test your implementation for counting references of Arrays and Numbers. You don't have to perform any explicit checks in your code. |
How should we handle collections? | |
You don't have to handle collections (just like Arrays and Numbers). |
what should be the ref count of the object pointed by pp after the following statement? | |
There is no way to distinguish between pp assign: 'p2' value: (Point new; x:1; y:1) and pp assign: 'p2' value: p when p is a reference to an existing object. We are aware of this limitation and therefore in the first case we expect the new object to have a reference count of 2 although it has only one reference. |
When destructing an object, should we call destruct on all of its members? | |
No, you should call destruct only on members whose ref count is being decreased to zero. |