Documenting Spheres

This document demonstrates how Spheres should be documented, using a LAML SchemeDoc subset.

These are the rules of the format:

These are the types (hierarchy) of documentation comments:

;!!! .title A Scheme source file with documentation-mark comments.
;; .author Alvaro Castro-Castilla
;; This is a Scheme file with a few simple functions.
;; The functions are written and organized with the purpose
;; of demonstrating the SchemeSpheres documentation


;;!! The fac and fib functions.

;;! Calculate the factorial of n.
;; .parameter n An integer
;; .pre-condition The integer must be non-negative.
;; .returns n!
(define (fac n)
  (if (= 0 n) 1 (* n (fac (- n 1)))))

;;! Calculated the fib function.
;; Notice that this is a very inefficient
;; implementation.
;; .parameter n An integer
;; .pre-condition The integer must be non-negative.
;; .returns The n't fiabonaci number.
(define (fib n)
  (cond ((or (= n 0) (= n 1)) 1)
        (else (+ (fib (- n 1)) (fib (- n 2))))))