Litteral arrays parsing

nicolas cellier ncellier at ifrance.com
Tue May 23 17:51:06 UTC 2006


Le Mardi 23 Mai 2006 16:42, Noury Bouraqadi a écrit :
> Hi,
>
> A stupid question, why evaluating
> #("comment") leads to an empty array instead of an array with a single
> element #'"comment"'?
>

Isn't it a good thing, this ability to insert comment inside long literal 
arrays ?

stupidExample := #(
    "keys are stored in first sub array"
        #( 'one' 'two' 'three')
    "values are stored in second sub array"
        #(1 2 3)
).

> I guess that this is somehow bound to the fact that
> #"comment"
> evaluates to a symbol with a single hidden character (Ascii 30)
>
> BTW, I test this on a 3.9-7032 image
>

This one is a bad behaviour indeed, a side effect of Scanner/Parser internal 
implementation... (Ascii 30 being used with meaning "end of input").

Behind #, i would expect a letter [a-z][A-Z], a string quote ', or an opening 
parenthesis (. Maybe a second # in Dolphin Smalltalk extension...

What else does make sense according to Smalltalk formal definition?

Nicolas

> Noury
> --------------------------------------------------------------
> Dr. Noury Bouraqadi - Enseignant/Chercheur
> Ecole des Mines de Douai - Dept. G.I.P
> http://csl.ensm-douai.fr/noury
>
> European Smalltalk Users Group Board
> http://www.esug.org
>
> Squeak: an Open Source Smalltalk
> http://www.squeak.org
> --------------------------------------------------------------




More information about the Squeak-dev mailing list