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).