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

Strings no longer implement IFn #56

Closed
grayrest opened this issue Feb 25, 2014 · 1 comment
Closed

Strings no longer implement IFn #56

grayrest opened this issue Feb 25, 2014 · 1 comment

Comments

@grayrest
Copy link

The docs mention this. I ran across this a few weeks ago but I'm not actively using Mori and forgot about it until the HN post yesterday. Quick patch I've been using for convenience:

(extend-type js/String
  IFn
  (-invoke
    ([s coll]
     (get coll (.toString s)))
    ([s coll not-found]
      (get coll (.toString s) not-found))))
@swannodette
Copy link
Owner

Strings were never meant to implement IFn, that was a side-effect of the implementation of keywords and symbols. The docs need to be corrected, preferably to demonstrate this behavior with keywords and symbols.

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