in reply to Re: Re: When would you choose foreach instead of map?
in thread When would you choose foreach instead of map?

I am gonna go out on a limb and wildly speculate that if one of them uses 96MB and the tests are accurate, it was *map*, based on the whole 'side-effect' thingy. If true, this re-emphasizes the original point that this is the one (non-preference-based) difference.

  • Comment on Re: Re: Re: When would you choose foreach instead of map?

Replies are listed 'Best First'.
Re: Re: Re: Re: When would you choose foreach instead of map?
by BrowserUk (Patriarch) on May 21, 2004 at 16:59 UTC

    As always, don't take my word for it, do your own test. All the (two lines) of the (two lines) of the code is there. The only instrumentation required is a <STDIN>; to prevent the processes from exiting and top/task manager.

    Is this the "'side effect' thingy"? I guess you could classify it that way:)


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail