aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lux/base.clj3
-rw-r--r--src/lux/compiler/case.clj3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lux/base.clj b/src/lux/base.clj
index da5ef48f8..a4e2c3096 100644
--- a/src/lux/base.clj
+++ b/src/lux/base.clj
@@ -298,6 +298,9 @@
(defmacro |let [bindings body]
(reduce (fn [inner [left right]]
+ (if (symbol? left)
+ `(let [~left ~right]
+ ~inner))
`(|case ~right
~left
~inner))
diff --git a/src/lux/compiler/case.clj b/src/lux/compiler/case.clj
index 9d709bae2..9acf3854d 100644
--- a/src/lux/compiler/case.clj
+++ b/src/lux/compiler/case.clj
@@ -72,8 +72,7 @@
(doto writer
stack-peek
&&/unwrap-boolean
- (.visitLdcInsn _value)
- (.visitJumpInsn Opcodes/IF_ICMPNE $else))
+ (.visitJumpInsn (if _value Opcodes/IFEQ Opcodes/IFNE) $else))
(&o/$NatPM _value)
(doto writer