-
Notifications
You must be signed in to change notification settings - Fork 76
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
eval-free @manipulate macro #11
Comments
Cool! This looks like a way better way to do this. Thanks, will work on it tonight. @lift is exported by React, but @manipulate is exported by Interact. So I think there is some value in keeping @lift for code that doesn't involve Interact. Eval in @lift seems like a bad idea now though, but makes it very useful in non-function contexts. Do you think it's a good idea to introduce a |
I don't think we need a type unless we are going to dispatch on it. |
I forgot to mention we will also have I'm skeptical about the name |
I guess this issue is now addressed by 4f920bf |
Unlike
@lift
(which can probably be deleted now that we have@manipulate
, by the way), I think you can write@manipulate
so that it doesn't useeval
. Usingeval
is always a bad idea in a macro, because it makes it extremely brittle, e.g. you can't use the macro inside a function. Following the syntax in #8, just have the macro transform:into something like
where
widget
is an overloaded function that creates a default widget (or anything that can be passed tosignal
) from the parameters of a given type. e.g.widget(::Bool)
will create a checkbox,widget(::Range)
will create a slider, etcetera.This has the additional advantage that the available widgets for
@manipulate
are no longer hard-coded. Any package can provide additional widgets just by overloadingwidget
.The text was updated successfully, but these errors were encountered: