diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-20 09:07:28 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-20 09:07:28 -0700 |
commit | 52d0bbf6b30ec041ed2f12572d6ddc03ecfe981b (patch) | |
tree | 5036b52c44d5892c3f1a4a8160af655b6962d0bb | |
parent | d059fe743df6a5e8a72fc1418f2c3ba1ed5ac1e6 (diff) | |
download | mu-52d0bbf6b30ec041ed2f12572d6ddc03ecfe981b.tar.gz |
3525
-rw-r--r-- | html/http-client.mu.html | 6 | ||||
-rw-r--r-- | http-client.mu | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/html/http-client.mu.html b/html/http-client.mu.html index 50b203f2..bd5520c3 100644 --- a/html/http-client.mu.html +++ b/html/http-client.mu.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color * { font-size: 12pt; font-size: 1em; } .Delimiter { color: #800080; } .muControl { color: #c0a020; } +.Comment { color: #9090ff; } .Constant { color: #00a0a0; } .Special { color: #c00000; } .CommentedCode { color: #6c6c6c; } @@ -30,6 +31,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color </head> <body> <pre id='vimCodeElement'> +<span class="Comment"># example program: reading a URL over HTTP</span> + <span class="muRecipe">def</span> main [ <span class="Constant">local-scope</span> google:&:source:char<span class="Special"> <- </span>start-reading-from-network <span class="Constant">0/real-resources</span>, <span class="Constant">[google.com]</span>, <span class="Constant">[/]</span> @@ -38,10 +41,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="Delimiter">{</span> c:char, done?:bool<span class="Special"> <- </span>read google <span class="muControl">break-if</span> done? -<span class="CommentedCode">#? $print c, 10/newline</span> n<span class="Special"> <- </span>add n, <span class="Constant">1</span> -<span class="CommentedCode">#? skip?:bool <- lesser-than n, 10000</span> -<span class="CommentedCode">#? loop-if skip?</span> b<span class="Special"> <- </span>append b, c <span class="CommentedCode">#? trunc?:bool <- greater-or-equal n, 10000</span> <span class="CommentedCode">#? loop-unless trunc?</span> diff --git a/http-client.mu b/http-client.mu index eddbe2a4..b7fa8b30 100644 --- a/http-client.mu +++ b/http-client.mu @@ -1,3 +1,5 @@ +# example program: reading a URL over HTTP + def main [ local-scope google:&:source:char <- start-reading-from-network 0/real-resources, [google.com], [/] @@ -6,10 +8,7 @@ def main [ { c:char, done?:bool <- read google break-if done? -#? $print c, 10/newline n <- add n, 1 -#? skip?:bool <- lesser-than n, 10000 -#? loop-if skip? b <- append b, c #? trunc?:bool <- greater-or-equal n, 10000 #? loop-unless trunc? |