Hi Roelof,

Two problems:

1. + is a symbol so compare it to #+

2. A false case is needed to return the untouched sum, otherwise it
truns to nil

#(+1 -8) inject: 0 into: [:sum :each | each ~= #+ ifTrue: [sum +  each]
ifFalse: [sum]] .

Hilaire

-- 
Dr. Geo
http://drgeo.eu



Reply via email to