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

Activity

Show:
Alex Miller
January 26, 2016, 2:50 PM

Good find and good fix.

Former user
January 26, 2016, 9:47 AM

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

Completed

Assignee

Unassigned

Reporter

Former user

Labels

Approval

Ok

Patch

Code and Test

Priority

Major

Affects versions

Fix versions