Tensegritics/ClojureDart

Port new 1.11 behavior for associative varargs

開放

#109 建立於 2022年6月13日

 (1 則留言) (0 個反應) (0 位負責人)Clojure (115 個分叉)batch import
help wanted

倉庫指標

星標
 (1,618 顆星)
PR 合併指標
 (平均合併 8天) (30 天內合併 2 個 PR)

描述

I think this is related to issue #96.

Calling a variadic function that contains argument destructuring fails with the following exception: Unhandled Exception: Invalid argument(s): Index out of bounds

Example:

(defn one [& {:keys [a b]
              :or {a "a" b "b"}}]
  (dart:core/print (str a b)))

  (one) ;=> ab
  (one nil) ;=> ...Index out of bounds...
  (one {}) ;=> ...Index out of bounds...
  (one {:a "x"}) ;=> ...Index out of bounds...
  (one {:a "x" :b "y"}) ;=> ...Index out of bounds...


(defn two [a & {:keys [b c]
                :or {b "b" c "c"}}]
  (dart:core/print (str a b c)))
  
  (two "x") ;=> xbc
  (two "x" nil) ;=> ...Index out of bounds...
  (two "x" {}) ;=> ...Index out of bounds...
  (two "x" {:b "y"}) ;=> ...Index out of bounds...
  (two "x" {:b "y" :c "z"}) ;=> ...Index out of bounds...

貢獻者指南