From e5c11a5137d538b7713dd8708ca767c208824c06 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 26 Dec 2016 01:17:01 -0800 Subject: 3709 - line numbers in html Each line number also gets an anchor name, but I'm not hyperlinking them for now because I don't want to encourage bookmarking these links just yet. They aren't permalinks because every revision may change what's at any given line number. --- html/tangle.mu.html | 104 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 40 deletions(-) (limited to 'html/tangle.mu.html') diff --git a/html/tangle.mu.html b/html/tangle.mu.html index ce74c293..9a21434e 100644 --- a/html/tangle.mu.html +++ b/html/tangle.mu.html @@ -6,7 +6,7 @@ - + @@ -25,48 +26,71 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color - +
-# example program: constructing functions out of order
-#
-# We construct a factorial function with separate base and recursive cases.
-# Compare factorial.mu.
-#
-# This isn't a very tasteful example, just a simple demonstration of
-# possibilities.
-
-def factorial n:num -> result:num [
-  local-scope
-  load-ingredients
-  {
-    <base-case>
-  }
-  <recursive-case>
-]
-
-after <base-case> [
-  # if n=0 return 1
-  zero?:bool <- equal n, 0
-  break-unless zero?
-  return 1
-]
-
-after <recursive-case> [
-  # return n * factorial(n - 1)
-  x:num <- subtract n, 1
-  subresult:num <- factorial x
-  result <- multiply subresult, n
-]
-
-def main [
-  1:num <- factorial 5
-  # trailing space in next line is to help with syntax highlighting
-  $print [result: ], 1:num, [ 
-]
-]
+ 1 # example program: constructing functions out of order
+ 2 #
+ 3 # We construct a factorial function with separate base and recursive cases.
+ 4 # Compare factorial.mu.
+ 5 #
+ 6 # This isn't a very tasteful example, just a simple demonstration of
+ 7 # possibilities.
+ 8 
+ 9 def factorial n:num -> result:num [
+10   local-scope
+11   load-ingredients
+12   {
+13     <base-case>
+14   }
+15   <recursive-case>
+16 ]
+17 
+18 after <base-case> [
+19   # if n=0 return 1
+20   zero?:bool <- equal n, 0
+21   break-unless zero?
+22   return 1
+23 ]
+24 
+25 after <recursive-case> [
+26   # return n * factorial(n - 1)
+27   x:num <- subtract n, 1
+28   subresult:num <- factorial x
+29   result <- multiply subresult, n
+30 ]
+31 
+32 def main [
+33   1:num <- factorial 5
+34   # trailing space in next line is to help with syntax highlighting
+35   $print [result: ], 1:num, [ 
+36 ]
+37 ]
 
-- cgit 1.4.1-2-gfad0