Skip to content

recursive function resolution edge case #51

Open

Description

@mkhan45

let inner_state = (bind thunk_fn.lambda_args thunk_args ss loc) thunk_fn.enclosed_state in

The inner state recursive function needs to be thought about a bit more for continuation passing style to work

Activity

  1. added a commit that references this issue on Dec 10, 2021
    de62f45
  2. mkhan45 commented on Dec 10, 2021

    @mkhan45
    OwnerAuthor

    causes other bugs

  3. mkhan45 commented on Dec 11, 2021

    @mkhan45
    OwnerAuthor

    worth noting that elixir solves this by not letting closures be trivially recursive, the function has to accept a recursion function argument, e.g.

    fib = fn(x, fib) -> if x < 2, do: n, else: fib.(n - 1, fib) + fib.(n - 2, fib) end
    fib.(10, fib) |> IO.inspect # 55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions