Lukas Renggli renggli at iam.unibe.ch
Fri Feb 17 17:14:46 CET 2006

> 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 ]

And as implementation:

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


Lukas Renggli

More information about the smallwiki mailing list