clojure.core.Vec does not fully implement clojure.lang.IPersistentVector

Description

The implementation of `vector-of` in gvec.clj implements the interface clojure.lang.IPersistentVector, but skips the method `int length()`(see https://github.com/clojure/clojure/blob/bc186508ab98514780efbbddb002bf6fd2938aee/src/clj/clojure/gvec.clj#L240).

This was encountered while trying to use core.matrix -https://github.com/mikera/core.matrix/issues/266

Approach: Implement length in gvec

Patch: CLJ-1887.patch

Screened by: Alex Miller

Environment

Windows 7, Ubuntu Linux 14.04

Attachments

1

Activity

Show:

Alex MillerJanuary 26, 2016 at 2:50 PM

Good find and good fix.

Former userJanuary 26, 2016 at 9:47 AM

The attached patch adds a .length method for primitive type vectors. Now it fully satisfies the interface clojure.lang.IPersistentVector

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created January 26, 2016 at 9:41 AM
Updated September 6, 2017 at 5:42 PM
Resolved September 6, 2017 at 5:42 PM