Tensegritics / Tensegritics/ClojureDart

Port new 1.11 behavior for associative varargs

Open
#109 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Clojure
Stars
1.6k
Forks
119
PR merge metrics
No merged PRs in 30d

Description

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...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the one and two examples and compare the behavior with issue #96 and the referenced Clojure 1.11 behavior. Done means associative variadic destructuring works for nil, empty maps, and partial or complete maps, producing the expected strings without an Index out of bounds exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, dart
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.