Re: a question about foreach construct

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...

Can we modify the outer sequence from within the block?

foreach item in s do 
    if item = something then 
        s = append( s, new_item ) -- is this legal? 
    end if 
end foreach 

-Greg

s being defined outside of the block, I don't see any reason to protect it against modification.

A loop is not a routine.

Jean-Marc

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

Search



Quick Links

User menu

Not signed in.

Misc Menu