- Intent
- Abstract out naturally parrallel evaluation
- Motivation
- Merge two functional streams
- Implementation
- The coroutines can be implemented using generators. The example shows an example application
- Examples
//if gen and gen2 are generators function merge_data() { try { do { $data[] = 10*gen() + 5 + 4*gen2(); ... } while( some_condition( ... ) ); } catch ( $e ) { .... } return $data; }
Coroutines (generator based)
by vlado on Wed, 2006-07-26 09:50- Printer-friendly version
- Login to post comments