-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
It should not try to call vectors with 0 arguments #2
Comments
Why exactly is it happening? Are you putting vector in dictionary? Why? It’s actually perfectly valid to return substitute of functions (e.g. maps) as well as real functions from dictionary. |
I am building a personal website. The website has a list of works. The works have a description that has to be translated in English and Spanish. So I put the works (which are stored in a vector) in the dictionary. Is this a bad idea? Should it be a list instead? I know that I can store functions in the dictionary, but I do not want to store a function whose only purpose is to return the vector. I chose to fork tongue and make the change I mentioned here. |
Interesting, I haven't envisioned tongue to be a storage for any random stuff, only strings. But your use-case makes sense, I'm thinking now how to better address it without sacrificing agility that ifn provides. Any ideas (besides chaning to fn?) |
Revisiting this, it's not that difficult to simply dispatch the proper collection without putting the collections inside tongue's dictionaries. Putting a large, dynamic amount of data inside the dictionaries does not seem like a good practice. You can close this, if you want. Greets! |
In core.cljc:
(if (ifn? t) (t) t)))
I think it should be:
(if (fn? t) (t) t)))
This way, vectors stop being called with 0 arguments.
The text was updated successfully, but these errors were encountered: