3 ms·
this is interesting (emphasis mine): > Bosque is designed to encourage limited uses of recursion [and using map/filter etc instead]. This is done by introducin
by uryga 8y ago
this is interesting (emphasis mine):
> Bosque is designed to encourage limited uses of recursion [and using map/filter etc instead]. This is done by introducing the rec keyword which is used at both declaration sites to indicate a function/method is recursive and again at the call site so as to affirm that the caller is aware of the recursive nature of the call
i don't think i've seen a way marking functions that might not terminate at the call site. (though termination doesn't seem to be a specific focus here)
- coldtea 8y agoIsn't this similar to e.g. recur in Clojure?
- uryga 8y agoyou might be right, though i understood it as "every call to a recursive function must be prefixed with `rec`", which would mean that, say, ,`last xs` [assuming that `last` is implemented recursively and xs is a linked list] would have to look like `rec last xs` instead, de facto making the recursiveness of `last` a part of its public API.