diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-11-16 23:39:46 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-11-16 23:39:46 -0800 |
commit | 6e455985c745d976f2c185ff6fa6f9b59280e1a7 (patch) | |
tree | bddcc690c3b546499a15e519dccb77d91060090e /continuation1.mu | |
parent | 1437d8417a4ab70646bafa41f64214f4c931300f (diff) | |
download | mu-6e455985c745d976f2c185ff6fa6f9b59280e1a7.tar.gz |
4123
Diffstat (limited to 'continuation1.mu')
-rw-r--r-- | continuation1.mu | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/continuation1.mu b/continuation1.mu index 11811c1d..8e9b1d03 100644 --- a/continuation1.mu +++ b/continuation1.mu @@ -4,25 +4,17 @@ # # Expected output: # 1 -# 2 -# 3 def main [ local-scope k:continuation <- call-with-continuation-mark create-yielder - { - x:num, done?:bool <- call k # should return 1 - break-if done? - $print x 10/newline - loop - } + x:num <- call k # should return 1 + $print x 10/newline ] -def create-yielder -> n:num, done?:bool [ +def create-yielder -> n:num [ local-scope load-ingredients - n <- copy 0 return-continuation-until-mark - done?:bool <- greater-or-equal n, 3 - n <- add n, 1 + return 1 ] |