summaryrefslogtreecommitdiff
path: root/tests/examplefiles/scheme/r6rs-comments.scm
blob: 4c4188f5961fde5583816085835a3576b1ef841c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!r6rs

#|

   The FACT procedure computes the factorial

   of a non-negative integer.

   #| These comments can be nested too. |#

|#

(define fact

  (lambda (n)

    ;; base case

    (if (= n 0)

        #;(= n 1)
        #;(= n [1+ (eval '(n))])1
        #;[= n (1+ [eval '[n]])];; another comment
        #;1
        ; identity of *

        (* n (fact (- n 1))))))