home *** CD-ROM | disk | FTP | other *** search
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; File: tprint.cl
- ; Description: TPRINT benchmark from the Gabriel tests
- ; Author: Richard Gabriel
- ; Created: 12-Apr-85
- ; Modified: 19-Jul-85 19:05:26 (Bob Shaw)
- ; Language: Common Lisp
- ; Package: User
- ; Status: Public Domain
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ;;; TPRINT -- Benchmark to print and read to the terminal.
-
- (defvar ttest-atoms '(abc1 cde2 efg3 ghi4 ijk5 klm6 mno7 opq8 qrs9
- stu0 uvw1 wxy2 xyz3 \123a \234b \345c \456d
- \567d \678e \789f \890g))
-
- (defun init (m n atoms)
- (let ((atoms (subst () () atoms)))
- (do ((a atoms (cdr a)))
- ((null (cdr a)) (rplacd a atoms)))
- (init-aux m n atoms)))
-
- (defun init-aux (m n atoms)
- (cond ((= m 0) (pop atoms))
- (t (do ((i n (- i 2))
- (a ()))
- ((< i 1) a)
- (push (pop atoms) a)
- (push (init-aux (1- m) n atoms) a)))))
-
- (defvar ttest-pattern (init 6 6 ttest-atoms))
-
- ;;; call: (print ttest-pattern)
-
- (run-benchmark "Tprint" '(print ttest-pattern))
-