Skip to content

support long else...if blocks? - #897

Open
spaghetti-squash wants to merge 9 commits into
mainfrom
else-ii-questionmark
Open

support long else...if blocks?#897
spaghetti-squash wants to merge 9 commits into
mainfrom
else-ii-questionmark

Conversation

@spaghetti-squash

@spaghetti-squash spaghetti-squash commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This essentially lets us continue to honor the contract of if_ as it previously existed and as it existed in the first else work. But we don't need to honor the latter, because it hasn't been released.

I don't love that the frontmost elements don't need to be an object but subsequent entries do. Maybe it makes sense to keep if_ as it once was, and do ifElse that accepts just an ElseTrain argument?

Base automatically changed from else to main September 5, 2026 14:38

@Ignose Ignose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure where size limits for macros are housed (maybe Libram lets the user put this particular gun to this foot) but otherwise this looks good.

@spaghetti-squash

spaghetti-squash commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure where size limits for macros are housed (maybe Libram lets the user put this particular gun to this foot) but otherwise this looks good.

Libram doesn't track size limits, macros are remarkably stateless. Like, all they contain is an array of bare strings for their steps.

We could adjust the Type of the ElseTrain to be

export type ElseTrain =
  [...Tuple<ElseIfComponent, Range<0, 69>>] | [...Tuple<ElseIfComponent, Range<0, 68>>, string | Macro | undefined]

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants