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

Interpolation in W_cmd #24

Open
BeastyBlacksmith opened this issue Sep 5, 2019 · 2 comments
Open

Interpolation in W_cmd #24

BeastyBlacksmith opened this issue Sep 5, 2019 · 2 comments

Comments

@BeastyBlacksmith
Copy link
Contributor

Currently you can't interpolate into W_cmd's, quoting from the PR:

W`Sin[$(1+1)]` # W"Sin"(2)

The main challenge with this is that $ is allowed to be used in a variable name (see >here). I'm not sure how best to do this, but perhaps open a new issue to discuss it.

Originally posted by @simonbyrne in #19 (comment)

@BeastyBlacksmith
Copy link
Contributor Author

Instead one can

W"Set"(W"n", 1+1) |> weval
W`Sin[n]`

@simonbyrne
Copy link
Member

simonbyrne commented May 1, 2020

An alternative would be to provide keywords to weval:

weval(w`Log[1+x]`, x=x)

by wrapping the expression in a Module, Block or With (I'm not sure which one would be best). This would be pretty nice combined with JuliaLang/julia#34331.

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

2 participants