I'm not
completely following what its purpose is?
It is a left-fold:
http://en.wikipedia.org/wiki/Fold_(higher-order_function)
In my case, it is causing problems on VW when it
calls aBlock (near
the end) and passes in a pair of Characters which are processed by
MAComponentRenderer>>classFor: which then tries to do a string append
(#,) which gives a DNU since VW's characters (and I think Squeak from
what I can tell) do not have concat methods (#,).. Am I missing
something?
The idea is that when you do
#( 'foo' 'bar' 'zork' ) reduce: [ :a :b | a , ' ' , b
]
you get
'foo bar zork'
I don't know how your collection 'classes' ends up with characters?
These should be strings. Maybe there is a bug in #cssClassesForItem:?
I don't have such a method in Squeak though and the original
implementation of #classFor: looks quite different:
MAComponentRenderer>>classFor: aDescription
| classes |
classes := OrderedCollection withAll: aDescription cssClasses.
aDescription isReadonly
ifTrue: [ classes add: 'readonly' ].
aDescription isRequired
ifTrue: [ classes add: 'required' ].
(self hasError: aDescription)
ifTrue: [ classes add: 'error' ].
^ classes reduce: [ :a :b | a , ' ' , b ]
Cheers,
Lukas
If looks like you have put a string into the cssClasses property, where
an Array/Collection of strings is expected.
Keith