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

Function chaining and composition with funcitons having more that one argument #29917

Closed
sirex opened this issue Nov 3, 2018 · 2 comments
Closed

Comments

@sirex
Copy link

sirex commented Nov 3, 2018

It would be nice if these would work:

julia> 1:9 |> filter(isodd)
5-element Array{Int64,1}:
 1
 3
 5
 7
 9

julia> sqrt(16) |> convert(Int)
4

julia> map(convert(Int)  sqrt, [4, 9, 16])
3-element Array{Int64,1}:
 2
 3
 4

Probably there are more functions like this, that could return function with single argument to be used in chaining or composition.

This is not easy to do in all cases, for example split with single argument can't be converted to function.

@StefanKarpinski
Copy link
Member

See #5571, #24990 and #26436 for related discussions.

@sirex sirex closed this as completed Nov 4, 2018
@javadba
Copy link

javadba commented Dec 20, 2019

This JIRA was closed without a clear explanation of what if anything were added to the language. Per instruction by @StefanKarpinski have posted a question here https://discourse.julialang.org/t/does-julia-support-chaining-of-collections-methods-function-chaining-at-this-point/32519

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

3 participants