.. (לתיקייה המכילה) | ||
Could you please define what is the default behavior for Statistic | |
Assume that all methods always receive arguments that are instances of appropriate classes. Also, assume that the method #result: always receives a List of positive size as an argument. |
How to create a file, write into a file and close a file? | |
The following code demonstrates creation of a file named TABLE.TXT for writing, writing three lines into it and finally closing it: f <- File new; name: 'TABLE.TXT'; open: 'w' f print: 'First line' f print: 'Second line' f print: 'Third line' f close |
What are the minimal demands on the format of the table? | |
Each row should be in a separate line and the columns should be aligned. Other than that, you are free to choose the details. |
How should we define the methods #result: of Statistic and #compute: | |
Since there is no explicit way in LST to define a method to be abstract (unlike in C++ or Java), you can implement those methods by: a) giving some default behavior; or b) printing an error message by invoking "smalltalk error: 'Method is not implemented!'"; or any other reasonable solution. |