2 ms·
I think the fact that the language is designed to be embedded on elements makes it clear that the implicit subject and object is the current element (the "me" o
by recursivedoubts 4y ago
I think the fact that the language is designed to be embedded on elements makes it clear that the implicit subject and object is the current element (the "me" or "I" symbol in hyperscript
<div _="on mousenter toggle .expand" ...>
...
</div>
So the language comes across as imperative statements, with the current element being the default subject and object, as with english instructions. Most commands (statements) accept a noun target:
<div _="on mousenter toggle .expand on the closest <section/>" ...>
...
</div>
But, due to the embedded nature of the language it still comes across as you telling the diff to toggle the class on the other section.
There is also a tell command that allows you to switch the default object (which you can access explicitly in the "you" and "yourself" symbols:
<div _="on mousenter
tell the closest <section/>
toggle .expand" ...>
...
</div>
Insanity, I know. There are also three, count'em three different ways to access properties:
set x to arr.length
set y to the arr's length
set z to the length of the array
Fun! Also insane.
But also fun!