[racket] taking from a generator, and a possible bug

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Sun Aug 19 18:11:27 EDT 2012

On 2012-08-19 11:20:01 -0700, Ian Tegebo wrote:
> Thanks for the clarification; I needed both `stream-cons` and
> `in-producer` examples.  Also, your tone regarding the stream API
> suggests there might be ongoing work and/or other interesting details.
>  If so, could you elaborate?

Sure. Vincent and I have been working on improving various aspects of
generic operations in Racket. In 5.3, we introduced a general mechanism
for defining a generic interface and implementing its methods (see
`gen:stream` for streams, for example).

We have some ideas floating around for introducing an extended generic
interface for datatypes that are "buildable"[1]. That is, you'd provide a
construction operation so that operations like map, filter, and so on
could produce the same type of thing (whereas with streams and sequences
now, they produce an "opaque" thing).

This is still very much a work in progress, but hopefully we'll have
something more concrete soon.

Cheers,
Asumu

[1]: my understanding is that Scala provides this kind of functionality
     with its generic package for collections:
     http://www.scala-lang.org/api/current/index.html#scala.collection.generic.package

Posted on the users mailing list.