Skip to content

Recursive macro support #3

Description

@thomasvrgn

Adding recursive macro support could transform Orion in a powerful language because :

Recursive macros woudln't be dependent on callstack because they would be translated directly in parsing step. I already see a way of implementing that : Tail call optimisation system.

Recursive macros would just transform some recursive code into simple iterative code.

(macro factorial (x) {
  (if (= x 0) (return 1))
  (return (* x (factorial (- x 1))))
})

Regards,
Thomas.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions