-
Notifications
You must be signed in to change notification settings - Fork 46
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
@lift macro? #10
Comments
This is nice! Yes! I will work on this. There is this idea of creating macros that feel like Mathematica's Manipulate. cc @one-more-minute |
With my suggestions, you could do:
and it should work. |
Something like this should work, as a start:
|
Note that this only really works for interactive use because of the reliance on |
One could potentially do even better: instead of just looking for But this seems rather tricky to get right. A |
@stevengj I do the bottom-up evaluation and try to find values to which a |
since we have the
works. Also take a look at this simple @manipulate macro: https://github.com/shashi/Interact.jl/blob/master/src/manipulate.jl |
That seems reasonable. (As I mentioned above, anything that uses |
I find the
lift(x -> foo(x), y)
syntax a little awkward. What you really want to do is to be able to just writefoo(y)
and have it automatically create aLift
.Doing that directly seems too hard, because it would involve overriding every conceivable function to have
Signal
variants. But something like this could be accomplished by a macro:What the
@lift
macro would do would be to walk the expression tree, and any symbol that it finds corresponding to a defined value of type<: Signal
would get converted into a function parameter in a call tolift
.It's a little tricky to get the metaprogramming right here, but I think it should be do-able and will make this a lot easier to use.
The text was updated successfully, but these errors were encountered: