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

possible to open up types oninnerjoin? #24

Open
ssfrr opened this issue Feb 18, 2020 · 2 comments
Open

possible to open up types oninnerjoin? #24

ssfrr opened this issue Feb 18, 2020 · 2 comments

Comments

@ssfrr
Copy link

ssfrr commented Feb 18, 2020

It looks like the functions given to innerjoin need to be Union{Function, Type}, which precludes callable objects. Would it be possible to remove that restriction?

For some local code I defined (name::Symbol)(x) = getfield(x, name), so I don't have to do so many r->r.foo and can instead just do things like map(:foo, coll), etc. It doesn't work with innerjoin though.

@andyferris
Copy link
Member

Yes it would be good to support this.

Recently I had moved from Function to include Type as well and expanded the signatures of many of the functions here to accept multiple containers in lieue of functions.

This results in ambiguities between e.g. group(f, array) and group(array1, array2) - here knowing if the first argument is a function/type thing is quite crucial.

Any ideas on the API here are welcome but both those use cases are quite valid. Arguably group could be split into to generic functions though. Thoughts?

@andyferris
Copy link
Member

By the way I’ve been tempted to make a PR to make 'Symbolcallable like that inBase` - it’s a really nice Clojure feature for example.

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