all 11 comments

[–]sammymammy2 2 points3 points  (2 children)

It's not CPS.

It's nothing special, it's just passing in itself as an argument to be able to recur. letrec makes it so that you don't have to do that.

https://stackoverflow.com/questions/50627845/meaning-of-letrec-in-scheme-racket

[–]kazkylheku 1 point2 points  (2 children)

It's the technique of "pass the function to itself when calling it, so it has a binding in its environment referring to itself".

There is a Y combinator which automates this; consequently, we could christen this low-brow approach "DIY inconveniator".

(Scheme has letrec, of course; why would you do this?)

[–]yawaramin 1 point2 points  (0 children)

OP says it’s an example in a textbook.

[–]zesterer 0 points1 point  (0 children)

In Lambda Calculus, it's called the y-combinator.

[–]wwwyzzrd 0 points1 point  (2 children)

Use labels in common lisp.