Skip to content

Commit 648ed45

Browse files
leifericfclaude
andcommitted
Bridge: Expose clojure.lang.MapEntry/create as 2-vector ctor
Cross-dialect tests in jank-lang/clojure-test-suite (key.cljc, val.cljc, ...) build a map-entry under the :default arm via (clojure.lang.MapEntry/create k v). mino's map entries are 2-element vectors so the data shape already matches; only the constructor namespace was missing. Define a clojure.lang.MapEntry namespace with create alongside the existing JVM bridges. Internal suite 1476 / 7071 / 0. External suite errors 10 -> 8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fa2b7be commit 648ed45

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## v0.100.21
4+
5+
### Bridge: Expose `clojure.lang.MapEntry/create` as a 2-vector ctor
6+
7+
Cross-dialect tests in `jank-lang/clojure-test-suite` (e.g. `key.cljc`,
8+
`val.cljc`) build a map-entry literal under their `:default` arm via
9+
`(clojure.lang.MapEntry/create k v)`. mino's map entries are 2-element
10+
vectors, so the data shape already matches — only the constructor
11+
namespace was missing. Define `clojure.lang.MapEntry/create` in
12+
`src/core.clj` next to the existing `clojure.lang.IPending` and
13+
`clojure.lang.BigInt` bridges:
14+
15+
```clj
16+
(ns clojure.lang.MapEntry)
17+
(defn create [k v] [k v])
18+
(in-ns 'clojure.core)
19+
```
20+
21+
This unblocks the affected `is` lines in `key.cljc` and `val.cljc`
22+
(previously errored on namespace lookup), surfacing the remaining
23+
`(p/thrown? (key [1 2]))` semantic gaps that need a distinct
24+
`MapEntry` value type to reject non-entry 2-vectors. That type
25+
addition is deliberately deferred — the bridge is the smaller fix
26+
that stands on its own. Internal suite 1476 / 7071 / 0; external
27+
suite aggregate 5252 → 5278 assertions, errors 10 → 8.
28+
329
## v0.100.20
430

531
### Build: Make `make` clean on gcc-11 (Ubuntu 22.04)

src/core.clj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,6 +3184,14 @@
31843184
(def clojure.lang.IPending :future)
31853185
(def clojure.lang.BigInt :bigint)
31863186

3187+
;; Bridge `clojure.lang.MapEntry/create` to a 2-vector constructor.
3188+
;; Cross-dialect tests use it under `:default` to build a map entry
3189+
;; literal; mino represents map entries as 2-vectors and `key`/`val`
3190+
;; already accept that shape, so the only missing piece is the ctor.
3191+
(ns clojure.lang.MapEntry)
3192+
(defn create [k v] [k v])
3193+
(in-ns 'clojure.core)
3194+
31873195
;; In Clojure JVM the primed arithmetic forms (`+'`, `-'`, `*'`, `inc'`,
31883196
;; `dec'`) auto-promote to BigInt rather than overflowing in long; the
31893197
;; unprimed forms throw on overflow. mino's unprimed forms already

src/mino.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
#define MINO_VERSION_MAJOR 0
2929
#define MINO_VERSION_MINOR 100
30-
#define MINO_VERSION_PATCH 20
30+
#define MINO_VERSION_PATCH 21
3131

3232
/*
3333
* Human-readable version string of the *linked* runtime, e.g. "0.48.0".

0 commit comments

Comments
 (0)