-
-
Notifications
You must be signed in to change notification settings - Fork 70
feature suggestion: supporting attribute calls with argument given in map #46
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
Comments
@davidpham87 sorry for delayed response. How would you feel about this:
That same modification would then percolate to
or would you prefer
I could probably also do |
The last option would be the most flexible.
|
@jjtolton No problem, you have been helping me on Zulip (I am Neo). I don't know which dark magic you use in macro world, but this would be great (py. obj method **kwargs}) ;; or (py. module fn **{:as kwargs}) but I think (py.** obj method kwargs) ;; would be the cleanest of all. It could be just a function wrapping But it would be great with module/function calls like (np/linspace **{:start 0 :stop 1}) Let's wait on @cnuernber for his opinion. |
Alright after thinking it over, I'll investigate a |
@davidpham87 please review #57 and let me know if that looks like it will work the way you were expecting :) |
Thanks a lot for the work. I really love the syntax. I think though we should not support the multiarities of theses methods as it is counterintuitive. Maybe have an alias for py/call-kw to have the two arities. The reason it bothers me is the **method variant as change the position of the kwargs (I know it is common in Clojure, but for a specialized library, what do you think of going with the “least amount of surprise” path? |
The kwargs is always last in **, which means if you use it with just one arg, that arg will be the kwargs, which would cover your original use-case. I figure that is the arrity that will probably be used most, but now there is an arrity that covers all options. But I’ll ask for some more feedback and see what the consensus is |
Hello,
Thanks a lot for the library, it has been a real pleasure to use.
For now, we can call a function like this:
but it would be great if we could integrate a macro, say
$a**
such that we could performObviously we could also do this
However, I think it would be a beneficial addition to the library.
Best regards,
David
The text was updated successfully, but these errors were encountered: