4

what do you think about the idea of... "pseudo-recursion"?

as in, language construct that looks basically like recursion except one detail that makes it translate into iterative execution where the "recursion" calls just add to the list of "execute in next layer" ...iterator-type variable(?)

also, if you understand what I mean and if it's not complete nonsense, any syntax suggestions that would seem most natural for you? (also for context tell me what language that syntax suggestion mostly draws from (and why))

just a bit of idle thought/idle talk, don't take it too seriously.

Comments
  • 13
    Isn't that pretty much what tail-recursion is all about?
  • 7
    Look up primitive recursion and tail recursion.
  • 1
    @metamourge @RememberMe probably. i'm lacking lots of education and have a bad habit of enjoying reinventing the wheel *on purpose* before finding out how it's done properly...

    i've heard the term before, and seen some syntax examples from some of ye olden allcaps languages, but either they didn't explain the concept itself or (more likely) it didn't register enough to remember.

    (another interview "bad trait" answer:
    things interest me, when *I* stumble over them,
    not
    when i stumble over *them*)

    will re-check tail recursion out, thanks.
  • 2
    For those cases where tail recursion doesn't work, you'll need some sort of manually maintained data stack anyway if you implement that in an iterative manner.
  • 0
    whats funny is, last I checked, python for example *still* does not implement tail call optimization.
Add Comment