Lecture overview -- Keyboard shortcut: 'u'  Previous page: SchemeDoc -- Keyboard shortcut: 'p'  Next page: SchemeDoc details -- Keyboard shortcut: 'n'  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Slide 6 : 8

Multi-semicolon style
;;;; .title SchemeDoc Demo
;;;; .author Kurt Normark
;;;; .affiliation Aalborg University, Denmark
;;;; This is a brief example of a Scheme 
;;;; program with multi-semicolon SchemeDoc comments.

; This comment is not extracted.

;;; Factorials. 
;;; .section-id fac-stuff
;;; This section demonstrates a plain function.

;; The factorial function. Also known as n!
;; .parameter n An integer
;; .pre-condition n >= 0
;; .returns n * (n-1) * ... * 1
(define (fac n)
 (if (= n 0) 1 (* n (fac (- n 1)))))

;;; List selection functions.
;;; .section-id list-stuff
;;; This section demonstrates two aliased functions.

;; An alias of car. 
;; .returns The first component of a cons cell
;; .form (head pair)
;; .parameter pair A cons cell
(define head car)

;; An alias of cdr.
;; .returns The second component of a cons cell
;; .form (tail pair)
;; .parameter pair A cons cell
(define tail cdr)
prog1a.scm
A Scheme program with documentation comments - documentation-mark.