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

@aside like Chain.jl #136

Open
rben01 opened this issue Oct 17, 2023 · 0 comments
Open

@aside like Chain.jl #136

rben01 opened this issue Oct 17, 2023 · 0 comments

Comments

@rben01
Copy link

rben01 commented Oct 17, 2023

Lazy.jl’s threading macros are nice, but as far as I can tell there is no way to “skip over” a line so that it runs without having its output fed into the next line. Chain.jl has the very handy @aside macro for this purpose. It would be nice if something similar could be added to Lazy.jl. Currently I hack around this with

@as y x begin
    f(y)
    g(y)
    y |> function(z)
        side_effect(z)  # this is where I'd like to use @aside
        return z  # this is just y
    end
    h(y)
end

I'd much prefer just

@as y x begin
    f(y)
    g(y)
    @aside side_effect(y)
    h(y)
end
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

1 participant