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 checks to bind macro #728

Closed
wants to merge 1 commit into from
Closed

add checks to bind macro #728

wants to merge 1 commit into from

Conversation

Pangoraw
Copy link
Collaborator

@Pangoraw Pangoraw commented Nov 28, 2020

Hello! 👋

This prevents executing code that could break some functions by defining new methods.

Example:

@bind a CheckBox(), default=true

Would throw an error before executing where it would not have
previously, redefining CheckBox() to true (see #486).

There seems to be currently no tests for @bind (https://github.com/fonsp/Pluto.jl/blob/master/test/runtests.jl#L23).
Should I add some ?

Fixes #486

this prevents executing code that could break some functions by
defining new methods

Example:
```julia
@Bind a CheckBox(), default=true
```
Would throw an error before executing where it would not have
previously,
redefining `CheckBox()` to `true`
@fonsp
Copy link
Owner

fonsp commented Nov 28, 2020

Thanks! But I would rather fix the underlying issue with ExpressionExplorer: #486 (comment)

@fonsp
Copy link
Owner

fonsp commented Nov 28, 2020

About tests: this is difficult because you need to run a browser, but it is being worked on: #621

@fonsp fonsp closed this Nov 28, 2020
@fonsp
Copy link
Owner

fonsp commented Nov 28, 2020

For example, this code:

@bind x myslider=Slider(1:100)

is legal, as is:

@bind y myslider::Slider

The bug in our expression explorer meant that the user-generated function CheckBox did not get removed, otherwise it would have been fine.

@Pangoraw
Copy link
Collaborator Author

You're right ! I had not fully understood the scope of the problem. Sorry for the time wasted

@fonsp
Copy link
Owner

fonsp commented Nov 28, 2020

No worries, always happy with your contributions!

@Pangoraw Pangoraw deleted the fix_bind branch February 19, 2021 18:12
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

Successfully merging this pull request may close these issues.

CheckBox() not working in session after coding error
2 participants