Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial application doesn't belong in the loom.graph protocols #43

Closed
hiredman opened this issue Sep 4, 2014 · 1 comment
Closed

partial application doesn't belong in the loom.graph protocols #43

hiredman opened this issue Sep 4, 2014 · 1 comment
Assignees

Comments

@hiredman
Copy link
Contributor

hiredman commented Sep 4, 2014

there are several functions in protocols in loom.graph defined like:

(successors [g] [g node]
    "Return direct successors of node, or (partial successors g)")

given that all implementations must include the partial support, it doesn't belong behind the dispatch of a protocol, it is a constant, so a better implementation would be:

;; ... some protocol def
(-successors [g node]
    "Return direct successors of node")
;;

(defn successors
  ([g]
    (partial successors g))
  ([g node]
    (-successors g node)))
@aysylu
Copy link
Owner

aysylu commented Sep 15, 2014

Thank you. Yes, I agree with you. I'm planning on introducing this to the next minor version upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants