-
Notifications
You must be signed in to change notification settings - Fork 0
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
handling let
within a pipeline step
#13
Comments
I can kinda understand how you'd expect this to expand, but why write it this way? @p let
rand(100)
@aside m = mean()
map(_ - m)
end is more straightforward IMO. I never anticipated someone writing multi-statement |
Haha, I do this all the time. It works fine: julia> @p begin
rand(3)
let m = mean(__)
map(x -> x - m, __)
end
end
3-element Vector{Float64}:
-0.5591295398526472
0.19342379352164818
0.3657057463309993 It only fails if I use
|
Generally, I support this approach, but in these scenarios I don't really like Didn't know it "kinda works" already! "Kinda" because |
A
|
Actually, that's a neat idea, I like it! I just never thought of handling subparts of expressions within the pipeline. Just a question on proposed semantics details:
Why not insert
Also, why not insert it automatically? |
let
within a pipeline step
@p begin
rand(3)
let x = 1 * 2 * 3
prod(__) * x
end
end accidentally putting the data into the first line seems unintuitive and bad.
Yes I mean do insert |
It looks like this fails to expand
_
inside themap
call.The text was updated successfully, but these errors were encountered: