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

Add another escape for things evaluated before the function definition #308

Open
pdeffebach opened this issue Nov 16, 2021 · 0 comments
Open

Comments

@pdeffebach
Copy link
Collaborator

You often see

@rsubset df :a in Set([1, 2])

this is super slow because you have to make Set([1, 2]) evaluated every time.

The following works

julia> transform(df, let 
           y = 1
           :a => (t -> t .+ y) => :c
       end)
1×3 DataFrame
 Row │ a      b      c     
     │ Int64  Int64  Int64 
─────┼─────────────────────
   1 │     1      2      2

julia> y
ERROR: UndefVarError: y not defined

We could add some sort of escape character, like ^ or $ for things that get evaluated before the function is defined.

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