:) property access is a little bonkers in hyperscript
you can say
set the todo's name to "Do the laundry"
or
set the name of the todo to "Do the laundry"
or
set name.todo to "Do the laundry"
"the" is white space in the language (allowed before any expression) and helps w/ readability (according to taste)
The first form is what I would recommend in most cases.
The second form is useful when you want to either highlight the property being set or when you want to tweak how the property binds (e.g. to avoid parenthesizing)
The third form is just there because JavaScript, but it works :)
I am definitely enjoying the language, I think the ideas in htmx + hyperscript have massive potential to shift not only frontend, but some fun scripting in Node as well! For that, I am grateful to you. Would love to get involved anyway I can, might start digging through issues in the repository, I learned quite a bit reading hyperscript's source.
the hyperscript parser is definitely idiosyncratic (i joke that i did the opposite of everything my compilers professor taught me) but once you see the patterns it isn't too bad
Comments
:) property access is a little bonkers in hyperscript
you can say
or or "the" is white space in the language (allowed before any expression) and helps w/ readability (according to taste)The first form is what I would recommend in most cases.
The second form is useful when you want to either highlight the property being set or when you want to tweak how the property binds (e.g. to avoid parenthesizing)
The third form is just there because JavaScript, but it works :)
glad you are enjoying the language!
I am definitely enjoying the language, I think the ideas in htmx + hyperscript have massive potential to shift not only frontend, but some fun scripting in Node as well! For that, I am grateful to you. Would love to get involved anyway I can, might start digging through issues in the repository, I learned quite a bit reading hyperscript's source.
sure, jump on the discord:
https://htmx.org/discord
there is a hyperscript channel
the hyperscript parser is definitely idiosyncratic (i joke that i did the opposite of everything my compilers professor taught me) but once you see the patterns it isn't too bad