- Code: Select all
`10 CLS`

20 PRINT "2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97"

30 END

I have tried to translate this program to newLISP:

- Code: Select all
`(define (prime? x) (= (first (factor x)) x))`

(println (filter prime? (sequence 2 100)))

My code is as short as Basic one, but it is still 20% slower than a sample code from newLISP manual:

- Code: Select all
`(define (primes n , p)`

(dotimes (e n)

(if (= (length (factor e)) 1)

(push e p -1))) p)