diff options
-rw-r--r-- | 046global.cc | 8 | ||||
-rw-r--r-- | 057immutable.cc | 1 | ||||
-rw-r--r-- | 061text.mu | 1 | ||||
-rw-r--r-- | 070table.mu | 4 | ||||
-rw-r--r-- | 075channel.mu | 3 | ||||
-rw-r--r-- | html/046global.cc.html | 8 | ||||
-rw-r--r-- | html/057immutable.cc.html | 1 | ||||
-rw-r--r-- | html/061text.mu.html | 1 | ||||
-rw-r--r-- | html/070table.mu.html | 4 | ||||
-rw-r--r-- | html/075channel.mu.html | 3 | ||||
-rw-r--r-- | html/lambda-to-mu.mu.html | 10 | ||||
-rw-r--r-- | lambda-to-mu.mu | 6 |
12 files changed, 40 insertions, 10 deletions
diff --git a/046global.cc b/046global.cc index 2dc1e760..9d690806 100644 --- a/046global.cc +++ b/046global.cc @@ -4,10 +4,10 @@ //: have access to each other's globals. //: //: This feature is still experimental and half-baked. You can't name global -//: variables, and so like in most tests they don't get checked for types (the -//: only known hole in the type system, can cause memory corruption). We might -//: fix these issues if we ever use globals. Or we might just drop the feature -//: entirely. +//: variables, and they don't get checked for types (the only known hole in +//: the type system, can cause memory corruption). We might fix these issues +//: if we ever use globals. Or we might just drop the feature entirely. +//: [tag: todo] :(scenario global_space) def main [ diff --git a/057immutable.cc b/057immutable.cc index 7b4e331c..578b5f8a 100644 --- a/057immutable.cc +++ b/057immutable.cc @@ -2,6 +2,7 @@ //: products. This layer will start enforcing this check. //: //: One hole for now: variables in surrounding spaces are implicitly mutable. +//: [tag: todo] :(scenario can_modify_ingredients_that_are_also_products) # mutable container diff --git a/061text.mu b/061text.mu index bd7eb89f..d8e40112 100644 --- a/061text.mu +++ b/061text.mu @@ -123,6 +123,7 @@ scenario text-equal-common-lengths-but-distinct [ ] # A new type to help incrementally construct texts. +# todo: make this shape-shifting. container buffer [ length:num data:text diff --git a/070table.mu b/070table.mu index efa78a2c..f82bb9c7 100644 --- a/070table.mu +++ b/070table.mu @@ -1,6 +1,8 @@ # A table is like an array, except that you can index it with arbitrary types # and not just non-negative whole numbers. +# incomplete; doesn't handle hash conflicts + scenario table-read-write [ local-scope tab:&:table:num:num <- new-table 30 @@ -59,6 +61,8 @@ def new-table capacity:num -> result:&:table:_key:_value [ *result <- merge 0/length, capacity, data ] +# todo: tag results as /required so that call-sites are forbidden from ignoring them +# then we could handle conflicts simply by resizing the table def put-index table:&:table:_key:_value, key:_key, value:_value -> table:&:table:_key:_value [ local-scope load-ingredients diff --git a/075channel.mu b/075channel.mu index 985292a3..c1d2d5f3 100644 --- a/075channel.mu +++ b/075channel.mu @@ -155,6 +155,9 @@ def read in:&:source:_elem -> result:_elem, eof?:bool, in:&:source:_elem [ reset lock ] +# todo: create a notion of iterator and iterable so we can read/write whole +# aggregates (arrays, lists, ..) of _elems at once. + def clear in:&:source:_elem -> in:&:source:_elem [ local-scope load-ingredients diff --git a/html/046global.cc.html b/html/046global.cc.html index 234acdc1..cc62df99 100644 --- a/html/046global.cc.html +++ b/html/046global.cc.html @@ -39,10 +39,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment">//: have access to each other's globals.</span> <span class="Comment">//:</span> <span class="Comment">//: This feature is still experimental and half-baked. You can't name global</span> -<span class="Comment">//: variables, and so like in most tests they don't get checked for types (the</span> -<span class="Comment">//: only known hole in the type system, can cause memory corruption). We might</span> -<span class="Comment">//: fix these issues if we ever use globals. Or we might just drop the feature</span> -<span class="Comment">//: entirely.</span> +<span class="Comment">//: variables, and they don't get checked for types (the only known hole in</span> +<span class="Comment">//: the type system, can cause memory corruption). We might fix these issues</span> +<span class="Comment">//: if we ever use globals. Or we might just drop the feature entirely.</span> +<span class="Comment">//: [tag: todo]</span> <span class="Delimiter">:(scenario global_space)</span> <span class="muRecipe">def</span> main [ diff --git a/html/057immutable.cc.html b/html/057immutable.cc.html index c31f5e20..34928ecb 100644 --- a/html/057immutable.cc.html +++ b/html/057immutable.cc.html @@ -39,6 +39,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment">//: products. This layer will start enforcing this check.</span> <span class="Comment">//:</span> <span class="Comment">//: One hole for now: variables in surrounding spaces are implicitly mutable.</span> +<span class="Comment">//: [tag: todo]</span> <span class="Delimiter">:(scenario can_modify_ingredients_that_are_also_products)</span> <span class="Comment"># mutable container</span> diff --git a/html/061text.mu.html b/html/061text.mu.html index 5f9ba882..41234594 100644 --- a/html/061text.mu.html +++ b/html/061text.mu.html @@ -157,6 +157,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] <span class="Comment"># A new type to help incrementally construct texts.</span> +<span class="Comment"># todo: make this shape-shifting.</span> <span class="muData">container</span> buffer [ length:num data:text diff --git a/html/070table.mu.html b/html/070table.mu.html index 9cc6e3e1..6d9b3e0c 100644 --- a/html/070table.mu.html +++ b/html/070table.mu.html @@ -35,6 +35,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Comment"># A table is like an array, except that you can index it with arbitrary types</span> <span class="Comment"># and not just non-negative whole numbers.</span> +<span class="Comment"># incomplete; doesn't handle hash conflicts</span> + <span class="muScenario">scenario</span> table-read-write [ <span class="Constant">local-scope</span> tab:&:table:num:num <span class="Special"><-</span> new-table<span class="Constant"> 30</span> @@ -93,6 +95,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color *result <span class="Special"><-</span> merge <span class="Constant">0/length</span>, capacity, data ] +<span class="Comment"># todo: tag results as /required so that call-sites are forbidden from ignoring them</span> +<span class="Comment"># then we could handle conflicts simply by resizing the table</span> <span class="muRecipe">def</span> put-index table:&:table:_key:_value, key:_key, value:_value<span class="muRecipe"> -> </span>table:&:table:_key:_value [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> diff --git a/html/075channel.mu.html b/html/075channel.mu.html index 7b9ade33..ed6eda1d 100644 --- a/html/075channel.mu.html +++ b/html/075channel.mu.html @@ -191,6 +191,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color reset lock ] +<span class="Comment"># todo: create a notion of iterator and iterable so we can read/write whole</span> +<span class="Comment"># aggregates (arrays, lists, ..) of _elems at once.</span> + <span class="muRecipe">def</span> clear in:&:source:_elem<span class="muRecipe"> -> </span>in:&:source:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> diff --git a/html/lambda-to-mu.mu.html b/html/lambda-to-mu.mu.html index 86b47a69..ccb33e30 100644 --- a/html/lambda-to-mu.mu.html +++ b/html/lambda-to-mu.mu.html @@ -15,12 +15,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .muData { color: #ffff00; } .muControl { color: #c0a020; } -.Delimiter { color: #800080; } .Special { color: #c00000; } +.Delimiter { color: #800080; } +.Comment { color: #9090ff; } .Constant { color: #00a0a0; } .SalientComment { color: #00ffff; } .CommentedCode { color: #6c6c6c; } -.Comment { color: #9090ff; } .muRecipe { color: #ff8700; } .muScenario { color: #00af00; } --> @@ -37,6 +37,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="SalientComment">## experimental compiler to translate programs written in a generic</span> <span class="SalientComment">## expression-oriented language called 'lambda' into Mu</span> +<span class="Comment"># incomplete; code generator not done</span> +<span class="Comment"># potential enhancements:</span> +<span class="Comment"># symbol table</span> +<span class="Comment"># poor man's macros</span> +<span class="Comment"># substitute one instruction with multiple, parameterized by ingredients and products</span> + <span class="muScenario">scenario</span> convert-lambda [ run [ <span class="Constant">local-scope</span> diff --git a/lambda-to-mu.mu b/lambda-to-mu.mu index 734fa126..8e99fd07 100644 --- a/lambda-to-mu.mu +++ b/lambda-to-mu.mu @@ -1,6 +1,12 @@ ## experimental compiler to translate programs written in a generic ## expression-oriented language called 'lambda' into Mu +# incomplete; code generator not done +# potential enhancements: +# symbol table +# poor man's macros +# substitute one instruction with multiple, parameterized by ingredients and products + scenario convert-lambda [ run [ local-scope |