From 4c97ba914e2627677223c97c04b4532aef9f8025 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 18 Nov 2014 04:35:39 -0800 Subject: 269 Minor cleanup and code comments. I'm starting to feel the need for formatting primitives, so I don't use comments just to provide section headings. --- factorial.mu | 2 ++ 1 file changed, 2 insertions(+) (limited to 'factorial.mu') diff --git a/factorial.mu b/factorial.mu index 25ab1eba..ee928e86 100644 --- a/factorial.mu +++ b/factorial.mu @@ -2,10 +2,12 @@ ((default-scope scope-address) <- new (scope literal) (30 literal)) ((n integer) <- arg) { begin + ; if n=0 return 1 ((zero? boolean) <- eq (n integer) (0 literal)) (break-unless (zero? boolean)) (reply (1 literal)) } + ; return n*factorial(n-1) ((x integer) <- sub (n integer) (1 literal)) ((subresult integer) <- factorial (x integer)) ((result integer) <- mul (subresult integer) (n integer)) -- cgit 1.4.1-2-gfad0