I am trying to iterate an array in Eiffel. And select some elements, using do_if
.
What I have tried.
my_method (list:ARRAY[INTEGER])
local
low : ARRAYED_LIST[INTEGER]
piv : INTEGER
do
create low.make(0)
--works for all, but not what I need
list.do_all ( agent low.extend )
--I can't get these to work
list.do_if ( agent low.extend, agent piv > ? )
list.do_if ( agent low.extend, agent piv.is_greater_equal (?) )
list.do_if ( agent low.extend, agent piv.is_greater_equal )
list.do_if ( agent low.extend, agent (v:INTEGER):BOOLEAN do Result := v<piv end )
I know why the last one does not work (piv is in outer scope), but not how to fix. I don't know why the others don't work.
Version = EiffelStudio 19.5 (19.05.10.3187 GPL Edition - linux-x86-64)