Skip to content

Conversation

@super7ramp
Copy link
Contributor

This closes #563.

This closes jank-lang#563.
Comment on lines +28 to +29
(aset arr 0 -1)
(is (= [-1 2 3] v)))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick, even though it's not required, it might be clearer that this mutation and the assertion are related if they were in a do block or logically grouped in some other way like doto). Not a big thing just weird to see mutating code in Clojure without a ! suffix, but I won't block on this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this mutable code is surprising but I don't see how to test this case differently. I wonder why aset is aset and not aset! 😅

clj-kondo warns of "redundant do" when adding a do under let.

I don't see how to apply doto here 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah since you're testing v rather than arr in the assertion that wouldn't work, I'll drop the comment, thanks for checking

[\a \b \c] "abc"))

#?(:cljr "cljr does not alias array"
:default (testing "array aliasing"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very neat test case.

Copy link
Member

@jeaye jeaye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@jeaye jeaye merged commit fe5f5a3 into jank-lang:main Nov 17, 2025
2 checks passed
@super7ramp super7ramp deleted the vec branch November 17, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clojure.core/vec

3 participants