I don't understand why the following code returns
'false':
[:aPerson |
(aPerson description
collect: [:desc | (desc toString: (aPerson readUsing: desc))])
anySatisfy: [:value | value matches: 'France']] asCondition
Is it because my code is not understood by the parser ?
Yes, it uses blocks.
Try as condition:
[ :person | person isFrance ]
asCondition.
And as implementation:
Person>>isFrance
(self description
collect: [ :desc | (desc toString: (self readUsing: desc)) ])
anySatisfy: [ :value | value matches: 'France' ].
You can easily check if everything is ok with your conditions, if you
explore them:
[ :person | person isFrance ]
asConditon explore
If you don't want to store your descriptions externally
(ReferenceStreams, Magma, OmniBase, ...) you can also use plain
blocks, that is maybe easier most of the time.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch