Skip to content

Render iterators and generators - #205

Open
hsorbo wants to merge 1 commit into
mainfrom
feature/generators
Open

hsorbo wants to merge 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.
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.

1 participant