added just a few lines of code

This commit is contained in:
hyunghwan.chung
2018-05-09 16:43:58 +00:00
parent bc93856b35
commit ff5e5aa23f
2 changed files with 33 additions and 3 deletions

View File

@ -37,6 +37,29 @@ class Collection(Object)
self do: [ :el | if (block value: el) { ^el } ].
^exception_block value.
}
(* ------------------- TODO -------------------------------
method add: object
{
self subclassResponsibility: #add:.
}
method select: condition_block
{
| coll |
coll := self class new: self basicSize.
self do: [ :el | if (condition_block value: el) { coll add: el } ].
^coll
}
method reject: condition_block
{
| coll |
coll := self class new: self basicSize.
self do: [ :el | if (condition_block value: el) { } else { coll add: el } ].
^coll
}
*)
}
## -------------------------------------------------------------------------------