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

Can't use keyword as item-fn #1

Open
jcf opened this issue Jan 16, 2017 · 1 comment
Open

Can't use keyword as item-fn #1

jcf opened this issue Jan 16, 2017 · 1 comment

Comments

@jcf
Copy link

jcf commented Jan 16, 2017

There's a pre clause that requires item-fn to be a function, but in the case of maps a keyword may often be appropriate. As a workaround, I can create an anonymous function but it'd be great if a keyword could be passed.

(consistent-hash-fn :db/id identity) ; throws an exception
(consistent-hash-fn #(get % :db/id) identity) ; is okay

I can probably put together a PR this evening if you're open to accepting the change.

@xpe
Copy link
Owner

xpe commented Jan 16, 2017

@jcf Good idea. Changing the precondition to allow either a function or keyword would work.

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