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

Eliminate dot macro #240

Open
twavv opened this issue Jan 1, 2020 · 1 comment
Open

Eliminate dot macro #240

twavv opened this issue Jan 1, 2020 · 1 comment

Comments

@twavv
Copy link
Member

twavv commented Jan 1, 2020

I'd like to eliminate the @dot and @dot_ macros (I'd like to eliminate the underscore-postfixed macros anyway in favor of a keyword argument but that's for later).

Truthfully, I think the macro isn't very self-explanatory. It confused me for quite some time (probably longer than it should have, truthfully). I'd rather allow interpolation of windows into JSExpr expressions (this shouldn't be too hard to do, especially with JSExpr/WebIO v1.0) so that we'd do something like this. It's also probably logical to execute JavaScript with this bound to the receiver object.

focus!(window::Window) = @js window $window.focus()
focus!(window::Window) = @js window this.focus()

This also makes it easier for things to be implemented in "userspace" (since @dot is unexported).

@NHDaly
Copy link
Collaborator

NHDaly commented Jan 2, 2020

Yeah makes sense to me. A lot of the Javascript interaction is confusing. The difference between @js and @js_ as well, yeah.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants