Hi, sorry about the delayed response — just had a new baby and have been
in the hospital for a few days.
What I am trying to accomplish is be able to represent algorithms in a
recursive format (which is often what comes naturally to me and seems
cleaner and easier to understand) without the stack penalty. This is why
TCO is baked into Scheme and CL, as the lisp people usually have this
mindset. If you don't, that is fine and probably not worth an extended
discussion. In my Haskell days, I represented most algs in some
recursive format, though I found out there was usually some higher level
abstraction available encapsulating the recursion.
The "macro" I wrote seems to accomplish what I want, though I'm thinking
maybe there are a few things in the macro code itself that could be
improved. E.g., it seems a little weird throwing an exception, but I
wasn't sure how else to do a non-local jump. And there is potential also
for variable name collisions between the macro variables and the
function that is passed in.
On 03/04/2017 11:46 PM, Alexander Burger wrote:
> Hi Christopher,
> thanks for sharing these ideas!
> However I'm a bit clueless about what you want to achieve.
>> Hi, I while ago I asked how I might somehow represent a loop as a a tail
>> call recursion, so as to give me the pattern I like without the call
> Isn't it a lot easier to write a 'while', 'for' or 'do' loop then?
> ♪♫ Alex