Module course.cycles
- Demonstration cycles
Demonstration cycles.
This is part of the course library. To use this library:
#INCLUDE "course.module"
Index
-
Process
delta
- Duplicate a stream of numbers -
Process
id
- Copy input to output -
Process
plus
- Add two streams of numbers together -
Process
prefix
- Output a fixed number, then copy input to output -
Process
succ
- Add one to input numbers -
Process
tail
- Drop the first input number, then copy input to output
Declarations
demo_cycles.occ
:33Process id
PROC id (CHAN INT in?, out!)
Copy input to output.
demo_cycles.occ
:44Process succ
PROC succ (CHAN INT in?, out!)
Add one to input numbers.
demo_cycles.occ
:55Process plus
PROC plus (CHAN INT in.1?, in.2?, out!)
Add two streams of numbers together.
demo_cycles.occ
:68Process delta
PROC delta (CHAN INT in?, out.1!, out.2!)
Duplicate a stream of numbers.
demo_cycles.occ
:81Process prefix
PROC prefix (VAL INT n, CHAN INT in?, out!)
Output a fixed number, then copy input to output.
demo_cycles.occ
:90Process tail
PROC tail (CHAN INT in?, out!)
Drop the first input number, then copy input to output.