Ralf Hemmecke wrote:
>
> Ah, you've forgotten to say that I it is currently only in the compiler,
> i.e., I have to run something like
>
> myfun(mygen)
>
> in order to use the generator mygen.
>
Yes, to have it in interpreter needs separate implementation.
> Anyway, thank you for making that already happen.
>
> I guess the bigger problem will be to introduce the "generate" and
> "yield" keywords. It's unfortunate that stream.spad, ituple.spad and
> fnla.spad define a "generate" function.
"generate" from fnla.spad is not a problem -- this is very specialised
package so we can rename it. We can probably also rename "generate"
from stream.spad and ituple.spad (AFAICS there is 20-30 uses in the
algebra). Bigger problem is actual implementation -- to
implement Aldor-compatible generate we need to transform code in
ways which are currently not supported (for example "generate" need
to jump into loops). Limited version, say with "yield" allowed only
at top level of a block would be easier...
> BTW, can you say, what exactly Reference(Integer) is? Can I imagine that
> as something similar to Record(x:Integer) but using ref/deref instead of
> the equivalent functions for the Record domain?
>
Yes. Current implementation generate exactly the same code as
Record with one field would do. Using Reference just makes
clear that we depend on indirection (which is present in other
Spad data structures, but in many situations removing indirection
would make no change to semantics, while for Reference indirection
is critical).
--
Waldek Hebisch
[email protected]
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.