23.03.2013 Views

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

Performance and Evaluation of Lisp Systems - Dreamsongs

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.9 Traverse<br />

3.9.1 The Program<br />

;;; TRAVERSE -- Benchmark that creates <strong>and</strong> traverses<br />

;;; a tree structure.<br />

(defstruct node<br />

(parents ())<br />

(sons ())<br />

(sn (snb))<br />

(entry1 ())<br />

(entry2 ())<br />

(entry3 ())<br />

(entry4 ())<br />

(entry5 ())<br />

(entry6 ())<br />

(mark ()))<br />

(defvar *sn* 0)<br />

(defvar *r<strong>and</strong>* 21.)<br />

(defvar *count* 0)<br />

(defvar *marker* nil)<br />

(defvar *root*)<br />

(defun snb ()<br />

(setq *sn* (1+ *sn*)))<br />

(defun seed ()<br />

(setq *r<strong>and</strong>* 21.))<br />

(defun traverse-r<strong>and</strong>om () (setq *r<strong>and</strong>* (mod (* *r<strong>and</strong>* 17.)<br />

251.)))<br />

153

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!