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

Duplicate by-method function #251

Open
danielbraun opened this issue Feb 25, 2016 · 1 comment
Open

Duplicate by-method function #251

danielbraun opened this issue Feb 25, 2016 · 1 comment

Comments

@danielbraun
Copy link

The by-method function is defined twice:

  1. (defn by-method [& kvs]
  2. (defn by-method

They behave differently:

  • util/by-method: Accepts keyword arguments, returns nil if method wasn't defined
  • core/by-method: Accept a map, return context if method wasn't defined. Due to deep merging of return values, all sequential values in the context are mutated. (Bad behavior, caused me a bug)

I assume the "better" one is util/by-method. Can we then at least deprecate the one in core?

@ordnungswidrig
Copy link
Member

Good catch and sorry for not looking at this bug earlier. Can you describe the problem with core/by-method more detailed? I don't see where deep merging would kick in here. The functions seem similar to me except keyword args and handling of :any.

Maybe you could past an example or -- even better -- write a little test?

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