about summary refs log tree commit diff stats
path: root/archive/2.vm/tangle.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-01 17:04:37 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-01 17:04:37 -0800
commit2a4088119cf41175457414dfa59bd4064b8f0562 (patch)
tree64fe184e399f9870ebd481a90eec34d51e5dff68 /archive/2.vm/tangle.mu
parent23fd294d85959c6b476bcdc35ed6ad508cc99b8f (diff)
downloadmu-2a4088119cf41175457414dfa59bd4064b8f0562.tar.gz
5852
Diffstat (limited to 'archive/2.vm/tangle.mu')
-rw-r--r--archive/2.vm/tangle.mu36
1 files changed, 0 insertions, 36 deletions
diff --git a/archive/2.vm/tangle.mu b/archive/2.vm/tangle.mu
deleted file mode 100644
index 91f12dea..00000000
--- a/archive/2.vm/tangle.mu
+++ /dev/null
@@ -1,36 +0,0 @@
-# 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 basic demonstration of
-# possibilities.
-
-def factorial n:num -> result:num [
-  local-scope
-  load-inputs
-  <factorial-cases>
-]
-
-after <factorial-cases> [
-  # if n=0 return 1
-  return-unless n, 1
-]
-
-after <factorial-cases> [
-  # return n * factorial(n - 1)
-  {
-    break-unless n
-    x:num <- subtract n, 1
-    subresult:num <- factorial x
-    result <- multiply subresult, n
-    return result
-  }
-]
-
-def main [
-  1:num <- factorial 5
-  # trailing space in next line is to help with syntax highlighting
-  $print [result: ], 1:num, [ 
-]
-]