import a.fs def main() { print([1, 2, 3]) for x in [1, 2, 3] { print(x) } print(Set([2, 1, 3])) for x in Set([2, 1, 3]) { print(x) } print([1: 2, 3: 4]) d = [1: 2, 3: 4] print(['d = ', d]) for [k, v] in d { print([k, v]) } # print(range(10)) } def* range(n) { i = 0 while i < n { yield i i = i + 1 } } main() print(fs) print(['fs.isdir(.)', fs.isdir('.')]) print(['fs.isfile(.)', fs.isfile('.')]) print(fs.ls('.', sort=true)) print(fs.ls('./src')) print(fs.ls('./src', path=true)) print(fs.ls('src', path=true)) from a.fs import ls from a.fs import isdir as g print(ls) print(g) # print(fs.read('Cargo.toml')) print(['cwd = ', fs.cwd()]) # print(List(fs.walk('./src'))) # for triple in fs.walk('./src') { # print(['triple', triple]) # } for path in fs.files('./src') { print(['path', path]) } fs.write('hi.txt', 'hello data\nthis is some data in hi.txt') import a.env print(env) print(['env.var(HOME)', env.var('HOME')]) # print(env.vars()) for [key, val] in env.vars() { print(['var', key, val]) } class Foo { new(a, b) = new(a = a, b = b) def foo(self) = [10, self.a, self.b] static def foo(m) = 'static foo ' + m } print(['Foo.foo(asdf)', Foo.foo('asdf')]) print(Foo(1, 2)) print(Foo(1, 2).foo())