_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

feat(Syntax addition): to match language style, "for item in myList indexed by i"

Open BirdeeHub opened this issue 1 year ago • 2 comments

for item in myList indexed by i for item in myList by i

Support for both of the above index clauses because the normal one reads terribly in a language that otherwise reads amazingly.

The one way to do it before was obviously only

for item in myList index i

An example of the new syntax from a project

_="
on load put the children of the closest parent <div /> into myList
then for item in myList indexed by i
if the item's index does not exist
set the item's index to i
then set the item's id to item's id + '_' + i
"

As opposed to

_="
on load put the children of the closest parent <div /> into myList
then for item in myList index i
if the item's index does not exist
set the item's index to i
then set the item's id to item's id + '_' + i
"

BirdeeHub avatar Jun 03 '24 13:06 BirdeeHub

_hyperscript_tests.pdf

New test results with the 2 new tests for the 2 new syntaxes

BirdeeHub avatar Jun 03 '24 14:06 BirdeeHub

I just realized, should I remove the built versions from this PR?

BirdeeHub avatar Oct 05 '24 12:10 BirdeeHub

thank you sorry it took so long to merge!

1cg avatar Dec 13 '24 19:12 1cg