Ticket #83 (closed defect: fixed)

Opened 6 years ago

Last modified 3 years ago

Implement Generators

Reported by: robertwb Owned by: vitja
Priority: major Milestone: 0.15
Component: Python Semantics Keywords:
Cc:

Description (last modified by scoder) (diff)

Merged into mainline now.

Change History

Changed 6 years ago by scoder

  • milestone changed from wishlist to 1.0

Changed 5 years ago by dagss

Assuming one selects a "switch-statement-to-resume-function"-strategy:

I just read about something called "threaded dispatch" which could be used to speed up this over a standard switch statement; basically GCC allowes one to take addresses of labels and dispatch to them later.

One should be able to make conditional macros for this so that it falls backs to a switch dispatch.

Changed 5 years ago by scoder

That's basically how I always thought about this anyway: When yielding a value, keep a pointer to the continuation point and store the local function state away, then return. When continuing, check if the continuation pointer is NULL (in which case we are just starting), otherwise, restore the local function state and jump to the label the pointer points to.

Changed 5 years ago by scoder

  • owner changed from somebody to scoder

Changed 5 years ago by scoder

Changed 4 years ago by scoder

  • owner changed from scoder to somebody

Changed 4 years ago by scoder

  • owner changed from somebody to vitja

Changed 4 years ago by scoder

  • milestone changed from 1.0 to 0.15

Changed 3 years ago by scoder

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

Changed 3 years ago by scoder

  • component changed from Code Generation to Python Semantics
Note: See TracTickets for help on using tickets.