On 21 avr. 2010, at 16:25, Lukas Renggli wrote:
>>> dSMMatrix := DSMMatrix withNodes: #(#1 #2 #3) edges: #(#(#1 #2) #(#2 #1)
>>> #(#3 #1)).
>
> Just as a side remark, but I already stumbled several times over code
> like the above in Mondrian and Glamour:
>
> #1 " is not valid Smalltalk "
Good remark. I always wonder why people (feel obliged to?) put only symbols inside of literal arrays, when the following works and is more readable:
dSMMatrix := DSMMatrix withNodes: #(1 2 3) edges: #((1 2) (2 1) (3 1)).
>
> It does not parse with any parser other then the default one in
> Pharo/Squeak. Up until a few minutes ago it broke the refactoring
> engine badly. Pharo strangely compiles the above expression to the
> number 1. So why not just put the number, which also saves you one
> character?
>
> 1 " is a valid number "
>
> To get a symbol with 1 you need to put the number in quotes:
>
> #'1' " is a valid symbol "
>
> Lukas
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
> _______________________________________________
> Moose-dev mailing list
>
[hidden email]
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev--
Simon
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev