erg/examples/import.er
2023-05-13 11:50:35 +09:00

20 lines
354 B
Python

a11y = import "a11y"
C = a11y.C
print! a11y.public
# print! a11y.private # error: private variable
print! a11y.C.x
c = a11y.C.new {.x = 0}
print! c.x
id c: C = c
print! id(c) == c
consts = import "consts"
print! consts.physics.G
foo = import "foo"
assert foo.i == 1
assert foo.f(2) == 3
assert foo.FILE == "foo/__init__.er"
assert foo.bar.i == foo.i