Array literals have changed?
Ned Konz
ned at bike-nomad.com
Sat Jan 12 23:44:03 UTC 2002
On Saturday 12 January 2002 03:06 pm, Ken Causey wrote:
> #( ('a' [Transcript show: 'An a was input'])
> ('b' [Transcript show: 'A b was input']) )
> switchOn 'a'.
> 1: 'a'
> 2: #[
> 3: #Transcript
> 4: #show:
> 5: 'An a was input'
> 6: #]
>
> Is this correct behaviour?
>
Yes (but it is different than VW). Try instead:
{ { 'a' . [Transcript show: 'An a was input'] } .
{ 'b' . [Transcript show: 'A b was input'] } }
switchOn 'a'.
or just use the existing method caseOf: (which takes an array of Block->Block
associations).
--
Ned Konz
currently: Stanwood, WA
email: ned at bike-nomad.com
homepage: http://bike-nomad.com
More information about the Squeak-dev
mailing list
|