Lazy function evaluation #1

Open
opened 2020-04-16 17:09:54 +00:00 by zyxw59 · 2 comments
zyxw59 commented 2020-04-16 17:09:54 +00:00 (Migrated from github.com)

this allows if to be a regular function (altho it'd still have to be implemented in rust) and also allow recursion.

this allows `if` to be a regular function (altho it'd still have to be implemented in rust) and also allow recursion.
zyxw59 commented 2025-10-02 22:26:36 +00:00 (Migrated from github.com)

Unfortunately, this is not possible with the expr-parser-based expression parser (#22), since with the expression format that uses, all arguments to an operator are evaluated before the operator itself is known. So I think this is going to need to involve re-writing the expression parser (again).

Unfortunately, this is not possible with the `expr-parser`-based expression parser (#22), since with the expression format that uses, all arguments to an operator are evaluated before the operator itself is known. So I think this is going to need to involve re-writing the expression parser (again).
zyxw59 commented 2025-10-05 01:35:55 +00:00 (Migrated from github.com)

Actually with https://github.com/zyxw59/expr-parser/pull/25, it should be possible to avoid rewriting the parser entirely. We'll parse to an AST and then evaluate that tree, and implement lazy evaluation there. I think this will also make it easier to parse (anonymous) function definitions (#2).

Actually with https://github.com/zyxw59/expr-parser/pull/25, it should be possible to avoid rewriting the parser entirely. We'll parse to an AST and then evaluate that tree, and implement lazy evaluation there. I think this will also make it easier to parse (anonymous) function definitions (#2).
Sign in to join this conversation.
No description provided.