hello Stefan,
i have had two Scheme teacher before graduating and being teaching scheme
too.
One tell us that basically CPS is the same as recursivity.
The other one said students to always give an example of the use of a
Scheme function of our own unless it did not read and give a note to our
wor
I did not know, that lambdas are allocated on the heap. I have a few questions
now:
How does this affect using fibers? (And how do fibers work better in that case?)
The unrolling you mentioned. Would same not be possible for the
naive-but-not-tail-recursive version? Is the idea, that the continu
Hello Stefan!
This translates a recursive tree function into a tail recursive function.
However, in this case, I am not sure it is really worth doing, in comparison to
the naive (+ first-branch other-branch) solution. The reason is, that instead of
a call stack for multiple branches, you are only
I see your point.
Yes, continuation (CPS) is pretty cool to replace the hidden stack magic
for recursive algorithms. :-)
Best regards.
On Wed, Dec 15, 2021, 07:45 Stefan Israelsson Tampe
wrote:
> Maybe you think the below program is trivial, but I adore named let's so
> much that I just canno
Maybe you think the below program is trivial, but I adore named let's so
much that I just cannot fathom that when people go functional they totally
miss this beauty
(define (count tree)
;; s = total sum up to now
;; t = tree of the type (car = child . cdr = siblings)
;; cont is the continuatio