diff options
| author | Andrey Orst <andreyorst@gmail.com> | 2020-12-29 23:52:19 +0300 |
|---|---|---|
| committer | Andrey Orst <andreyorst@gmail.com> | 2020-12-29 23:54:42 +0300 |
| commit | b414ab62c4e3e299bb3ca1dc04944d428574c1f0 (patch) | |
| tree | e9bc0ade827cf46e2f4851f0264fb767a50cabee /cljlib-macros.fnl | |
| parent | c489ecf5644578a27274dc51f9229b54a24d9f98 (diff) | |
fix: unpack broke for some reason
Diffstat (limited to 'cljlib-macros.fnl')
| -rw-r--r-- | cljlib-macros.fnl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cljlib-macros.fnl b/cljlib-macros.fnl index 85e741d..26c80d7 100644 --- a/cljlib-macros.fnl +++ b/cljlib-macros.fnl @@ -1005,7 +1005,7 @@ one." (assert-compile (= (length finally) 0) "Only one finally clause can exist in try expression" []) - (table.insert finally (list 'do (unpack form 2)))) + (table.insert finally (list 'do ((or table.unpack _G.unpack) form 2)))) (fn add-catch [finally catches form] "Appends `catch` body to a sequence of catch bodies that will later @@ -1015,7 +1015,7 @@ Checks if there already was `finally` clause met." (assert-compile (= (length finally) 0) "finally clause must be last in try expression" []) - (table.insert catches (list 'do (unpack form 2)))) + (table.insert catches (list 'do ((or table.unpack _G.unpack) form 2)))) (fn make-catch-clauses [catches finally] "Generates AST of error branches for `match` macro." @@ -1025,7 +1025,7 @@ Checks if there already was `finally` clause met." (when (sym? binding-or-val) (set add-catchall? false)) (table.insert clauses `(false ,binding-or-val)) - (table.insert clauses `(let [res# (do ,(unpack body))] + (table.insert clauses `(let [res# (do ,((or table.unpack _G.unpack) body))] ,(. finally 1) res#))) (when add-catchall? @@ -1033,7 +1033,7 @@ Checks if there already was `finally` clause met." ;; if there were no catch clause that used symbol as catch value (table.insert clauses `(false _#)) (table.insert clauses `(do ,(. finally 1) (error _#)))) - (unpack clauses))) + ((or table.unpack _G.unpack) clauses))) (fn add-to-try [finally catches try form] "Append form to the try body. There must be no `catch` of `finally` @@ -1124,6 +1124,7 @@ nil ``` "}) + {: fn* : try : if-let |