print = block(*args, sep=" ", end="\n", file=System stdout,
    file write(sep join(args))
    file write(end)
    file flush
    None
)

abs = block(x,
    x :__abs__
)

all = block(xs,
    xs foreach(x,
        (x bool) ifFalse(return False)
    )
    True
)

any = block(xs,
    xs foreach(x,
        (x bool) ifTrue(return True)
    )
    False
)

map = block(f, xs,
    rs = List clone
    xs foreach(x,
        rs append(f(x))
    )
    rs
)

filter = block(f, xs,
    rs = List clone
    xs foreach(x,
        (f is None) ifTrue(
            not x is None ifTrue(
                rs append(x)
            )
        ) ifFalse(
            f(x) ifTrue(
                rs append(x)
            )
        )
    )
    rs
)
