Skip to content

Render iterators and generators - #205

Merged
oleavr merged 1 commit into
mainfrom
feature/generators
Oct 17, 2026
Merged

oleavr merged 1 commit into
mainfrom
feature/generators

Conversation

@hsorbo

@hsorbo hsorbo commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Evaluating an expression that yields a generator or other iterator object printed an empty object, since such objects have no own enumerable keys.

Encode them as a new tagged value by pulling up to 100 items, marking when more remain, and label them by their toStringTag so a generator shows as Generator[...] and a Map iterator as Map Iterator[...].

The iterator is consumed by the display, as it would be by any other means of looking at its items.

image

Evaluating an expression that yields a generator or other iterator object
printed an empty object, since such objects have no own enumerable keys.
Encode them as a new tagged value by pulling up to 100 items, marking when
more remain, and label them by their toStringTag so a generator shows as
Generator[...] and a Map iterator as Map Iterator[...]. The iterator is
consumed by the display, as it would be by any other means of looking at
its items.
@hsorbo

hsorbo commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Looks like this when empty..
image

@oleavr
oleavr merged commit 24f5b4d into main Oct 17, 2026
6 checks passed
@oleavr

oleavr commented Oct 17, 2026

Copy link
Copy Markdown
Member

Thanks! 🙌

@oleavr
oleavr deleted the feature/generators branch October 17, 2026 09:18
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