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

:prefix is ignored when trying to gen-class with custom methods

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Declined
    • Affects versions: Release 1.5
    • Fix versions: None
    • Labels:

      Description

      I'm trying to generate several classes defined in one namespace:

      (ns aot.core)

      (gen-class
      :name aot.core.ClassA
      :prefix "classA-")

      (gen-class
      :name aot.core.ClassB
      :prefix "classB-")

      (defn classA-toString
      [this]
      "I'm an A.")

      (defn classB-toString
      [this]
      "I'm a B.")

      After AOT I can see that

      (.toString (ClassA.))

      doesn't produce "I'm an A." string but rather uses method from the superclass >> "aot.core.ClassA@33ba4e15"

      If on other hand I do:

      (ns aot.core)

      (gen-class
      :name aot.core.ClassA
      :prefix "classA-")

      (gen-class
      :name aot.core.ClassB
      :prefix "classB-")

      (defn -toString
      [this]
      "I'm an A.")

      (defn -toString
      [this]
      "I'm a B.")

      then both

      (.toString (ClassA.))

      and

      (.toString (ClassB.))

      obviously give "I'm a B." as there is only one -toString really defined.

      Is it a bug? Am I doing something wrong? How can I make clojure respect :prefix option.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: