Uploaded image for project: 'Clojure'
  1. CLJ-1887

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: Release 1.7, Release 1.8
    • Fix versions: Release 1.9
    • Labels:
    • Environment:

      Windows 7, Ubuntu Linux 14.04

    • Approval:
      Ok
    • Patch:
      Code and Test

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

      user=> (.length [1 2 3])
      3
      user=> (.length (vector-of :long 1 2 3))
      AbstractMethodError Method clojure/core/Vec.length()I is abstract  clojure.core.Vec (gvec.clj:-1)
      

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

      Screened by: Alex Miller

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              smee Steffen Dienst
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: