Primes by Trial Division - Domain Lisp

24 April 2018

Apollo's Domain Lisp is a Portable Standard LISP (PSL) variant. In this dialect, the benchmark looks like a mix of Cambridge and Common LISPs.

(de divp (n list)
  (eq (catch 'ISDIV (mapc list #'(lambda (p)
                     (cond ((zerop (remainder n p)) (throw 'ISDIV T))))))
    T))

(de primes (n)
  (prog (count primes)
    (setq count 3)
    (setq primes (list 2))
    NEXT (cond ((< (length primes) n)
                (cond ((divp count primes) nil)
                      (T (nconc primes (list count)))))
               (T (return primes)))
    (setq count (+ count 1))
    (go NEXT)))

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026

Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Primes Benchmark Source

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Primes Benchmark Results

Other LISPs

Cambridge LISP

Common LISP

Domain Lisp

Golden Common LISP

INTERLISP

Interlisp/65

LISP/80

Pearl LISP

Scheme R³

XLISP