generators, was: Re: iterators and cartesian product.
Martin Rubey <[email protected]> 24 Oct 2007 10:03:15 +0200
| Newsgroups | gmane.comp.mathematics.axiom.general |
|---|---|
| Message-ID | <[email protected]> |
"Bill Page" <[email protected]> writes: > > > Can you give an example of an "element of type Generator(Something)" > > > that is not a domain? > > > > g: Generator(Integer) := generate {yield 0} > > > > Take g. > > > > Ok, yes I see what you mean. Just curious: can something of type Generator(Something) ever be a domain? (Probably yes...) > But this requires some new basic functionality in the language, right? YES. But, it is one of the goals to improve SPAD anyway. OK, I can only hope that our compiler gurus have already enough expertise. The only thing I can do is to advertise the language design of Aldor... I was looking into how generators are implemented in lisp. One of the most promising links I found is http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/fbda37620268811/c558bf7e6feb5d55?hl=en&lnk=st&q=generator+monadic+continuations+defun# The code in the final message looks really short, but I did not yet understand it. Martin