[stack] Generators revisited
"Don Groves" <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
In rethinking the design of generators, it occurred to me that a generator is in fact a closure. I'm not familiar enough with the literature yet to know if closures already have an accepted methodology in this group, so please enlighten me if this is so. A generator might look like [[f] a b ..] where f is the generation function and a, b, etc, are its static data. A new combinator, generate (as suggested by Billy), would be needed which would disassemble the generator; apply f to the the list [a b ..]; reassemble the generator; and push the new value on the stack. Further discussion on this topic will be greatly appreciated, -- Don Groves