I think I saw a coding pattern a while ago that allows you to do the
following:

cond1 , cond2 , cond3 , cond4

And providing a kind of folding selector condition #and: you would get:

[ cond1 and: [ cond2 and: [ cond3 and: [ cond4 ] ] ] ].

for example:

conditions := [ : each | each firstName = 'Boca' ] ,
[ : each | each lastName = 'Baret' ] ,
[ : each | each fullName = 'Virgasia' ].

such that the following assert is met:

self assert: conditions equals: [ : each | each firstName = 'Boca' and: [
each lastName = 'Baret' and: [ each fullName = 'Virgasia' ] ] ].

Any ideas or pointers?

Cheers,

Hernán

Reply via email to