Skip to content

try...catch can't recur a loop #522

@brycecovert

Description

@brycecovert

I ran into a situation like this whilst playing around with pixie magic:

(loop [x 1]
  (try
    (recur (inc x))
    (catch ex (println ex))))


RuntimeException: :pixie.stdlib/AssertionException Recur must have same number of forms as matching loop

This lead me to discover that the cause was that try wraps the body in a function, telling the vm to invoke it. Perhaps this is just an implicit limitation, in which case, maybe there's a way to give a better error message, or perhaps there is a way to, instead of wrapping it in a function, evaluate the forms themselves.

I'm happy to work on this, but would need some direction. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions