Unit and benchmark test usage of ::= and :=.
[cslatevm.git] / tests / benchmark / nsievebits.slate
blob24e382c6490c3e1285d27bf23465c37be930657a
2 m@(Integer traits) nsievebits
3 [| count |
4   count := 0.
5   (isPrime ::= BitArray new &capacity: m + 1) atAllPut: True.
6   2 to: m do:
7     [| :i |
8      (isPrime at: i) ifTrue:
9        [(i + i to: m by: i) do: [| :k | isPrime at: k put: False].
10         count += 1]].
11   count
14 n@(Integer traits) bitprimes
16   m ::= (2 raisedTo: n) * 10000.
17   m nsievebits