;;;; A sample source fil
;; The fak function, n!
Show source file in large font In meta-demo: Link from fak to it's cross reference table entry 1.2. The next entry 1.4. Discussing details
(define (fak n) (if (= n 0) ; A linked program source marker to section 1.4:
'Discussing details'
Mark char: a 1 ; A linked program source marker to section 1.4:
'Discussing details'
Mark char: b (* n (fak (- n 1))) ; A linked program source marker to section 1.4:
'Discussing details'
Mark char: c ) ) ;; Return the list of the first n elements of lst. ;; If n < (length lst) just return lst Show source file in large font In meta-demo: Link from list-prefix to it's cross reference table entry 1.3. The next steps
(define (list-prefix lst n) (if (< (length lst) n) lst (list-prefix-1 lst n))) Show source file in large font In meta-demo: Link from list-prefix-1 to it's cross reference table entry 1.3. The next steps
(define (list-prefix-1 lst n) (if (= n 0) '() (cons (car lst) (list-prefix-1 (cdr lst) (- n 1)))))