On 01.06.22 21:09, Waldek Hebisch wrote:
Did you ever think why 'delay' with pile works? 'delay' expects
function as an argument, pile as argument produces a value. Why this
works when produced value is _not_ a function?
Oh, good that you come to it. Exactly, I would always have expected
something like
foo(...) == delay
() + ->
PILE
There must be some magic in the compiler to silently insert that missing
piece. Is there?
Coming back to representation of Stream, arguably correct
representation is
Rep := Record(firstElt : None, restOfStream : None)
Namely code stores various things in both fields, with None this is
OK.
Although I do not quite like the name None, but switching to such a
representation would at least make it clear that some magic is going on.
I would even use
Record(firstElt : MagicOrValue, restOfStream : LazyStream)
with macros MagicOrValue and LazyStream that expand to None, but with
documentation about what they are placeholders for.
OTOH that would require bunch of 'pretends' in stream code (probably
could be hidden in a few macros).
No problem if there would be a number of more "primitive" macros of
functions that hide the 'pretend'.
But this is for future code improvement.
Ralf
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/649c69d6-c08d-b1c5-8ed2-c47114b8276b%40hemmecke.org.