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

Broadcasting tuples in Julia 0.5 #291

Closed
giordano opened this issue Dec 1, 2016 · 5 comments
Closed

Broadcasting tuples in Julia 0.5 #291

giordano opened this issue Dec 1, 2016 · 5 comments

Comments

@giordano
Copy link

giordano commented Dec 1, 2016

Julia master has the ability to broadcast tuples (PR JuliaLang/julia#16986), which is incredibly handy. Is it possible to backport this feature to Julia 0.5 with Compat?

@wsshin
Copy link

wsshin commented Dec 28, 2016

I want this capability as well!

@stevengj
Copy link
Member

stevengj commented Dec 28, 2016

I don't think it's practical to backport (cc @pabloferz).

@pabloferz
Copy link
Contributor

There's a one-liner on that PR that could be backported to 0.5

@inline broadcast{N}(f, t::NTuple{N}, ts::Vararg{NTuple{N}}) = map(f, t, ts...)

This would probably be enough to satisfy most of people's needs when broadcasting over tuples. Unfortunately, handling mixtures of arrays, tuples and/or scalars is too disruptive to be back-portable.

@giordano
Copy link
Author

giordano commented Jan 2, 2017

@pabloferz for my use case that should do the trick.

@cossio
Copy link

cossio commented Aug 18, 2017

Has Julia 0.6 lost the ability to broadcast tuples? The following does not work

x = y = 0.
x, y += 2.

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

5 participants