Re: case and foreach

new topic     » goto parent     » topic index » view thread      » older message » newer message

I've thought about foreach and I don't really think that it needs to be added to
the language because it can be done with a function or procedure.

foreach(list_of_stuff, routine_id(some_action))

or

list_of_stuff = foreach(list_of_stuff, routine_id(some_action)) --Prefer pass by
reference or optimization of this case

But it is something that could be helped by having pass by reference and an
eval() function.

One problem with a built-in foreach -- does it only iterate the top level of a
sequence or does it dig down through sub sequences?  I think that is one reason
to leave it as a procedure or function.


=====================================
Too many freaks, not enough circuses.

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu