Skip to content

Idea: play around with subsumes strategy instead of public-class #964

Closed

Description

@borkdude
(defn sort-by-subsumption [classes]
  (sort
   (fn [^Class a ^Class b]
     (cond
       (.isAssignableFrom a b) 1     ; a is more general than b → b comes first
       (.isAssignableFrom b a) -1    ; b is more general than a → a comes first
       :else 0))                     ; unrelated → keep original order
   classes))

(prn
 (sort-by-subsumption
  #{java.lang.Object java.text.BreakIterator java.lang.Cloneable}))

Activity

  1. locked and limited conversation to collaborators on May 8, 2025
  2. converted this issue into a discussion #965 on May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions