diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-08-30 21:32:54 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-08-30 21:32:54 -0700 |
commit | 53930831c4185c5ccb56864c881acf6d67dd1bd1 (patch) | |
tree | 8826f80e35f7e168a1554176ad4108dca1c0fa42 /071recipe.cc | |
parent | b74744cd5851e034a88d4a335b22a372ebb39237 (diff) | |
download | mu-53930831c4185c5ccb56864c881acf6d67dd1bd1.tar.gz |
3986 - bring back delimited continuations
They're back after a long hiatus: commit 2295 in Oct 2015. I'm not convinced anymore that this is actually a correct implementation of continuations. Issues on at least two fronts: a) These aren't safe yet. Since continuations can be called multiple times, we need to disable reclamation of locals inside a continuation. There may be other type- or memory-safety issues. However, delimited continuations at least seem possible to make safe. Undelimited continuations (call/cc) though are permanently out. b) They may not actually be as powerful as delimited continuations. Let's see if I can build 'yield' out of these primitives.
Diffstat (limited to '071recipe.cc')
-rw-r--r-- | 071recipe.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/071recipe.cc b/071recipe.cc index a3a258c7..92ac83ac 100644 --- a/071recipe.cc +++ b/071recipe.cc @@ -208,6 +208,7 @@ recipe from_reagent(const reagent& r) { assert(r.type); recipe result_header; // will contain only ingredients and products, nothing else result_header.has_header = true; + // Begin Reagent->Recipe(r, recipe_header) if (r.type->atom) { assert(r.type->name == "recipe"); return result_header; @@ -275,8 +276,10 @@ reagent next_recipe_reagent(const type_tree* curr) { bool is_mu_recipe(const reagent& r) { if (!r.type) return false; - if (r.type->atom) + if (r.type->atom) { + // End is_mu_recipe Atom Cases(r) return r.type->name == "recipe-literal"; + } return r.type->left->atom && r.type->left->name == "recipe"; } |