| I've made several posts like this for Jarc. Rainbow was going to have a turn at some point... and that point is now. If you, conanite, have a better idea of what I should do with this kind of report, such as a) put it in the bug tracker at GitHub, b) email it to you, or c) put it anywhere but the Arc Forum front page :-p then I apologize. (pr "Test 1 ")
(let the-bound-symbol-name "the binding for the symbol"
(def make-bound-symbol (ignore (o result the-bound-symbol-name))
nil ; dummy expression
result))
(= test1 (make-bound-symbol "a dummy value"))
(prn:if
(is test1 "the binding for the symbol")
"succeeded."
(and (isa test1 'bound-symbol)
(is (tostring:pr test1) "the-bound-symbol-name"))
"failed with the expected result."
"failed with an unexpected result."
)
(pr "Test 2 ")
(= test2 (list:errsafe:eval '(list:errsafe list.nil)))
(prn:if (iso test2 '(((()))))
"succeeded."
(iso test2 '(()))
"failed with the expected result."
"failed with an unexpected result.")
(pr "Test 3 ")
(= test3 (errsafe:list:let nil 3 nil))
(prn:if (iso test3 '(()))
"succeeded."
(iso test3 '())
"failed with the expected result."
"failed with an unexpected result.")
(pr "Test 4 ")
(= test4 (errsafe:string '(4)))
(prn:if (is test4 "4")
"succeeded."
(is test4 nil)
"failed with the expected result."
"failed with an unexpected result.")
Also, a file with the following contents doesn't parse: #| This file
has nothing in it. |#
#;(To be more exact,
it doesn't have any expressions.)
; It doesn't even have a newline at the end.
I didn't feel the need to bring this stuff up--I just avoided the comment issues, used [apply + "" _] instead of 'string, and refrained from using nil in ssyntax or destructuring--but then I discovered Test 1, and I figured that was odd enough to be worth breaking the silence.In my code I use a certain pattern for default-less optional arguments, and it happened to fit the bug exactly: (w/uniq missing
(def do-something (a b c (o d missing))
(unless (args-are-okay a b c d) (err "argument error"))
(if (is d missing)
(do-one-thing a b c)
(do-another-thing a b c d))))
The essential prerequisites seem to be the non-global lexical scope of 'missing, the multiple-expression body, and the multiple-parameter argument list. Those are the qualities I couldn't strip out of the above test. However, I couldn't fix my code by wrapping the function body in (do ...)--I ended up using a global variable instead--so at least one of those prerequisites seems to be a bit slippery. |