diff options
| author | Andrey Listopadov <andreyorst@gmail.com> | 2021-05-10 18:33:15 +0000 |
|---|---|---|
| committer | Andrey Listopadov <andreyorst@gmail.com> | 2021-05-10 18:33:15 +0000 |
| commit | 3fee82f050e055ba7770a2b0135f2ebe4ee7b985 (patch) | |
| tree | ca9d6e464aff19fdf6141c21f6b87e5054aa76d3 /macros.fnl | |
| parent | 9ff8b7069da390540168723ce110b92f6d17c6b0 (diff) | |
Try multi value return
Diffstat (limited to 'macros.fnl')
| -rw-r--r-- | macros.fnl | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1116,7 +1116,7 @@ clauses when we push body epression." (table.insert try form)) (fn try [...] - (let [try '(fn []) + (let [try '(do) catches [] finally []] (each [_ form (ipairs [...])] @@ -1125,8 +1125,8 @@ clauses when we push body epression." (finally? form) (add-finally finally form) (add-to-try finally catches try form)) (add-to-try finally catches try form))) - `(match (pcall ,try) - (true _#) (do ,(. finally 1) _#) + `(match (pcall (fn [] ((or table.pack #(doto [$...] (tset :n (select :# $...)))) ,try))) + (true _#) (do ,(. finally 1) ((or table.unpack _G.unpack) _# 1 _#.n)) ,(make-catch-clauses catches finally)))) (attach-meta try {:fnl/arglist [:body* :catch-clause* :finally-clause?] |