On 30.10.2009, at 11:52, Christine Wolfe wrote:
drawOn: aCanvas super drawOn: aCanvas. (self perform: ('face', dieValue asString) asSymbol) do: [{:aPoint, anotherPoint} | self drawLineOn: aCanvas from: aPoint to: anotherPoint]
In my version of Squeak this won't even compile.
How did you accept that method?
The curly-bracket array notation can not be used to extract multiple arguments. Instead, you would have to do something like this:
[:aPointPair | self drawLineOn: aCanvas from: aPointPair first to: aPointPair second]
And secondly, this expression is valid syntactically but does not do what you might expect:
face1 ^{{2@2, 2@10}, {2@2, 10@2}, {10@10, 2@10}, {10@10, 10@2}}
In non-literal Array notation, expressions must be separated by periods, not commas:
{{2@2. 2@10}. {2@2. 10@2}. {10@10, 2@10}. {10@10. 10@2}}
The way you would verify a line like this or your's above is you simply select it and press cmd-p so it will print the result. You can do this in any browser or workspace.
- Bert -