Paste: checking primality of number

Author: andy
Mode: factor
Date: Wed, 20 Jan 2010 11:56:27
Plain Text |
! why doesn't the last function compile?

: divides? ( x y -- ? ) swap mod 0 = ;
: check-divisability ( x -- y ) [ divides? ] curry ;
: 3-to-sqrtn ( n step -- array ) [ drop 3 swap sqrt >integer ] keep <range> >array ;
: unprime? ( x -- ? ) [ 2 3-to-sqrtn ] keep check-divisability [ or ] map-reduce ;

New Annotation

Summary:
Author:
Mode:
Body: