efficiency suggestions/quibbles Stephen McCracken (18 Mar 2003 04:12 UTC)
Re: efficiency suggestions/quibbles Phil Bewig (19 Mar 2003 07:53 UTC)

efficiency suggestions/quibbles Stephen McCracken 18 Mar 2003 04:11 UTC

Although I recognize that the reference implementation
needn't be optimized, I couldn't help but make a few
suggestions:

As stream->list is used in many places, it could be
imperative, or at least use built-in R5RS reverse.

Functions that expand their entire argument (e.g.
stream-reverse, stream-scan-right) could probably save
space by using real lists as intermediate data
structures, rather than building nested stream-conses.
 They would return their results via list->stream.

The functions vector->stream, stream->vector,
string->stream, and stream->string should not use
lists as intermediate values, because a list may take
up much more memory than its corresponding vector or
string.  Converting vectors and strings directly to
streams is trivial, while stream->string and
stream->vector could use a simple buffer/concatenate
strategy with just R5RS primitives.

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com