![]() |
.. (לתיקייה המכילה) | |
I'm having problems using LinkedList addFirst / addLast methods. What am I doing wrong? | |
Insertion to a LinkedList is done by a Link object. You can check the implementation of its methods, or choose a simpler collection that fits the assignment. |
I have no idea how to implement the method iterator. How can a block return different values each time it's evaluated? | |
In Squeak, blocks are closures, thus have special properties. Refer to the first and second tutorial for examples. |
Regarding the value: anInteger method - "if the digit value is not legal for the base it should be set to zero...", who is 'it'? (the base or the value ?) | |
The value. |
My Squeak program is stuck in an infinite loop. What can I do? | |
Press Alt + '.' It will cause a user Interrupt and you'll see where the bug is. |
Since both classes have the method 'base:' there's some code duplicated. Do we need to create an additional class to avoid the duplication? | |
No. Both classes should inherit from Object as mentioned in the assignment. Code duplication regarding 'base:' method is allowed. |
Is documentation needed in this assignment? | |
It is recommended to explain everything that isn't trivial. No further documentation is needed. |
I don't understand the line 'itr value value' in the example. Why is the iterator evaluated twice? | |
When an iterator is evaluated it returns a Digit, thus the second 'value' is to get the integer value of the digit. |
Should the digit allow negative values? | |
No. Negative values should be treated as illegal, thus be converted to 0. |
What should happen if one of the digits involved in the method 'compareTo: aDigit' is 0-based? | |
Raise an 'invalid input' error, similar to the non-Digit case. |