Skip to content

Revisit the iterator protocol and add support to yield. #8

@rainwoodman

Description

@rainwoodman

The iterator protocol in Python is the basis for async calls. I'd like to add support to this.

  • We need to elevate the integer interface to an object based iterator interface. Probably need to add a new basic type for iterators; then there will be subtypes for list, dict, string, and everything else.

  • The cur variable in a dict shall probably be moved out to that iterator.

  • To support generator / yield, the grammar needs to be modified. We need a way to mark a function as a generator. Detecting yield may work. Then we need to modify the codegen to create a generator object when the code is executed. Not sure how yet. Get the iterator done first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions