✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 2106_prime_sieve_bitfield: the `std/field:new` sieve relocated into
// an imported module.
//
// `field` appends one declaration, which put it in the synthesizing class
// alongside store, regex, kernel and parser — but unlike those four it was never
// probed across a boundary, so which side of the line it falls on is what this
// pins. A capture-shadowing symptom seen elsewhere in field was never tied to
// module placement either way.
import app/lib
app/lib:run()
Supporting Files
import std/io
import std/field
pub tor run {}
run = std/field:new(bits: 1000001)
| field f |> for(2..1001)
! each p |> std/field:test(f, i: p): pv |> if(pv == 0)
| then |> for(0..(1000000 - p * p) / p + 1)
! each k |> std/field:set(f, i: p * p + k * p)
| done |> std/field:count-zeros(f, lo: 2, hi: 1000001): c |> std/io:print.ln("{{ c:d }}") |> std/field:free(f)
| err e |> std/io:print.ln("ERR {{ e:s }}")
Actual
78498
Expected output
78498
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN