grol-io / grol

Go REPL Open Language
https://grol.io
Apache License 2.0
22 stars 2 forks source link

macro bug, seems to work once and then get stuck #223

Closed ldemailly closed 2 months ago

ldemailly commented 2 months ago

unless(5 > 11, println("macro test 1: lower ok"), println("BUG: not lower"))

unless(10 > 5, println("BUG: not greater"), println("macro test 2: greater")) // should output "macro test: greater" and not again "lower ok"

actually currently prints

macro test: lower ok
macro test: lower ok

also unable to get

NoErr = macro(expr,a,b) {
    quote(
        r = catch(unquote(expr))
        if r.err {
            error("unexpected error:", r.value)
            unquote(a)
        } else {
            unquote(b)
        }
    )
}

to work... complains about expr being unknown...

ldemailly commented 2 months ago

it's basically #20

ldemailly commented 2 months ago

fixed in #225