in reply to Re: (jeffa) 3Re: Are strings lists of characters?
in thread Are strings lists of characters?

No. With an iterator, you can generate one element in the list at a time. What happens if your nifty little list happens to contain 50,000 elements that are computationally difficult to produce? Creating them all at once may very well take up too much memory on your system. Yet, if you still need to process them, an iterator allows you to generate the items one at a time without eating all of your ram and swap space.

It's possible, though, that I am simply considering a different problem than what you are intending. If you post cost snippets of what you wish was in Perl, perhaps that might clear up some confusion.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

  • Comment on Re: Re: (jeffa) 3Re: Are strings lists of characters?

Replies are listed 'Best First'.
Re: Re: Re: (jeffa) 3Re: Are strings lists of characters?
by John M. Dlugosz (Monsignor) on Oct 18, 2002 at 20:51 UTC
    re: With an iterator, you can generate one element in the list at a time.

    I agree. But jeffa's function is calling it in a tight loop to build an actual list, then feeding the list to map.