pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 356 forks source link

An array literal can be written with an arbitrary number of hash signs #17417

Open koendehondt opened 1 day ago

koendehondt commented 1 day ago

Bug description

An array literal is written like this:

#( 1 2 3)

But apparently Pharo allows an arbitrary number of hash signs:

##( 1 2 3)
###( 1 2 3)
####( 1 2 3)
#####( 1 2 3)
######( 1 2 3)
#######( 1 2 3)
etc

All these literals evaluate to an array with integers 1, 2, and 3.

Is that expected/desired behaviour?

liangbing64 commented 17 hours ago

also ###ABC = #ABC the answer is true

MarcusDenker commented 14 hours ago

it ignores all the # but one.

I do not like that, it accepts bad code and makes ##() un-availabe for experiments (or even usage for something)