Add "extend" to help putting multiple items from one list into another
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript
- Domain
- web-dev
Research direction
The issue names no files or tests; start by tracing the existing list assignment, append, and “split by” handling in the hyperscript implementation. Done means the proposed extend $assignees with ... syntax accepts multiple items from another list, including the shown data-attribute case, while the empty-value behavior is understood or separately scoped.
Written by the indexing model from the issue text.
Description
In Python we have "list.extend(otherlist)" as a multi-item "append" basic function.
I found that this is a bit tedious in hyperscript (or of course I might be missing something). Especially if I'm parsing something where the result could be a non-list (which is also interesting in its own from a typing perspective that splitting an empty string results in a non-list):
<span data-assignees="a b c"
_="init
set $assignees to my @data-assignees split by ' '
if not $assignees then set $assignees to []" />
I wish I could do this instead:
<span data-assignees="a b c"
_="init
set $assignees to []
extend $assignees with my @data-assignees split by ' '
" />
We could also consider whether "split by" should always return a list (I'm not quite sure what's going on there when @data-assignees is an empty value) but that's orthogonal to the extend ability.
- Dominant language
- JavaScript
- Stars
- 3.8k
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bigskysoftware/_hyperscript
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#688 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigskysoftware/_hyperscript#678 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bigskysoftware/_hyperscript#676 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
bigskysoftware/_hyperscript#695 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
bigskysoftware/_hyperscript#685 ·
All issues in bigskysoftware/_hyperscript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·