diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-06-12 22:34:45 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-06-12 22:34:45 -0700 |
commit | d44123cabaa730c778a0e2644c75dbfba6a7ab30 (patch) | |
tree | a24e90f9fc864ea5b1c5e1f13433f55ad7acd30b /html/tangle.mu.html | |
parent | 1ae4e0d95f7e37dc7d0b146542fc39b4aed491de (diff) | |
download | mu-d44123cabaa730c778a0e2644c75dbfba6a7ab30.tar.gz |
1556
Diffstat (limited to 'html/tangle.mu.html')
-rw-r--r-- | html/tangle.mu.html | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/html/tangle.mu.html b/html/tangle.mu.html index 4edc9c2d..4337e012 100644 --- a/html/tangle.mu.html +++ b/html/tangle.mu.html @@ -17,7 +17,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } .Comment { color: #8080ff; } .Constant { color: #008080; } .Special { color: #ff6060; } -.Identifier { color: #008080; } +.muControl { color: #804000; } .muRecipe { color: #ff8700; } --> </style> @@ -39,32 +39,32 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># possibilities.</span> <span class="muRecipe">recipe</span> factorial [ - <span class="Identifier">default-space</span>:address:array:location<span class="Special"> <- </span>new location:type, <span class="Constant">30:literal</span> - n:number<span class="Special"> <- </span><span class="Identifier">next-ingredient</span> + <span class="Constant">default-space</span>:address:array:location<span class="Special"> <- </span>new location:type, <span class="Constant">30:literal</span> + n:number<span class="Special"> <- </span><span class="Constant">next-ingredient</span> <span class="Delimiter">{</span> - <span class="Identifier"> +base-case</span> +<span class="Constant"> +base-case</span> <span class="Delimiter">}</span> - <span class="Identifier"> +recursive-case</span> +<span class="Constant"> +recursive-case</span> ] -<span class="muRecipe">after</span><span class="Identifier"> +base-case</span> [ +<span class="muRecipe">after</span> +base-case [ <span class="Comment"># if n=0 return 1</span> zero?:boolean<span class="Special"> <- </span>equal n:number, <span class="Constant">0:literal</span> - <span class="Identifier">break-unless</span> zero?:boolean - <span class="Identifier">reply</span> <span class="Constant">1:literal</span> + <span class="muControl">break-unless</span> zero?:boolean + <span class="muControl">reply</span> <span class="Constant">1:literal</span> ] -<span class="muRecipe">after</span><span class="Identifier"> +recursive-case</span> [ +<span class="muRecipe">after</span> +recursive-case [ <span class="Comment"># return n * factorial(n - 1)</span> x:number<span class="Special"> <- </span>subtract n:number, <span class="Constant">1:literal</span> subresult:number<span class="Special"> <- </span>factorial x:number result:number<span class="Special"> <- </span>multiply subresult:number, n:number - <span class="Identifier">reply</span> result:number + <span class="muControl">reply</span> result:number ] <span class="muRecipe">recipe</span> main [ 1:number<span class="Special"> <- </span>factorial <span class="Constant">5:literal</span> - <span class="Identifier"> $print</span> <span class="Constant">[result: ]</span>, 1:number, [ + $print <span class="Constant">[result: ]</span>, 1:number, [ ] ] </pre> |