----------------------------------------------------------------------
--
-- This file requires an alternative lexer, therefore it must be
-- compiled that way:
--
-- > mlc -x pythonic.lua pysample.lua
--
-- Or, if you want to execute it right away:
--
-- > mlc -x pythonic.lua -x pysample.lua
--
----------------------------------------------------------------------

print "Eratosthenes' Sieve, in pythonic Metalua:"

function print_sieve (limit):
  local sieve, i = { }, 2
  while i<limit:
    while sieve[i]:
      i=i+1
    print(i)
    for j = i*i, limit, i:
      sieve[j] = true
    i=i+1

print_sieve(100)