]> gitweb.factorcode.org Git - factor.git/commitdiff
Remove unused and redundant math.erato
authorSamuel Tardieu <sam@rfc1149.net>
Fri, 26 Dec 2008 19:58:47 +0000 (20:58 +0100)
committerSamuel Tardieu <sam@rfc1149.net>
Fri, 26 Dec 2008 20:03:12 +0000 (21:03 +0100)
The math.erato module brings nothing more is brought by lprimes
from math.primes. Remove it, as it has no user, and a better version
is available in math.primes.erato anyway.

extra/math/erato/erato-docs.factor [deleted file]
extra/math/erato/erato-tests.factor [deleted file]
extra/math/erato/erato.factor [deleted file]

diff --git a/extra/math/erato/erato-docs.factor b/extra/math/erato/erato-docs.factor
deleted file mode 100644 (file)
index 29bd302..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-USING: help.markup help.syntax ;
-IN: math.erato
-
-HELP: lerato
-{ $values { "n" "a positive number" } { "lazy-list" "a lazy prime numbers generator" } }
-{ $description "Builds a lazy list containing the prime numbers between 2 and " { $snippet "n" } " (inclusive)." } ;
diff --git a/extra/math/erato/erato-tests.factor b/extra/math/erato/erato-tests.factor
deleted file mode 100644 (file)
index 041cb8d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-! Copyright (c) 2007 Samuel Tardieu.
-! See http://factorcode.org/license.txt for BSD license.
-USING: lists.lazy math.erato tools.test ;
-IN: math.erato.tests
-
-[ { 2 3 5 7 11 13 17 19 } ] [ 20 lerato list>array ] unit-test
diff --git a/extra/math/erato/erato.factor b/extra/math/erato/erato.factor
deleted file mode 100644 (file)
index 7f92623..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-! Copyright (c) 2007 Samuel Tardieu.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors bit-arrays fry kernel lists.lazy math math.functions
-    math.primes.list math.ranges sequences ;
-IN: math.erato
-
-<PRIVATE
-
-TUPLE: erato limit bits latest ;
-
-: ind ( n -- i )
-    2/ 1- ; inline
-
-: is-prime ( n limit -- bool )
-    [ ind ] [ bits>> ] bi* nth ; inline
-
-: indices ( n erato -- range )
-    limit>> ind over 3 * ind spin <range> ;
-
-: mark-multiples ( n erato -- )
-    2dup [ sq ] [ limit>> ] bi* <= [
-        [ indices ] keep bits>> '[ _ f -rot set-nth ] each
-    ] [ 2drop ] if ;
-
-: <erato> ( n -- erato )
-    dup ind 1+ <bit-array> dup set-bits 1 erato boa ;
-
-: next-prime ( erato -- prime/f )
-    [ 2 + ] change-latest [ latest>> ] keep
-    2dup limit>> <= [
-        2dup is-prime [ dupd mark-multiples ] [ nip next-prime ] if
-    ] [
-        2drop f
-    ] if ;
-
-PRIVATE>
-
-: lerato ( n -- lazy-list )
-    dup 1000003 < [
-        0 primes-under-million seq>list swap '[ _ <= ] lwhile
-    ] [
-        <erato> 2 [ drop next-prime ] with lfrom-by [ ] lwhile
-    ] if ;