↑ Up |
Time measurement, pausing threads.
x
seconds.
The number x
can be a float and thus fractional parts of
a second are possible.
c = time.clock() time.sleep(0.1) print(c())
# Format (each of type integer): [year, month, day, hour, minute, second] # Example: template = "{4(0)}-{2(0)}-{2(0)}T{2(0)}:{2(0)}:{2(0)}" print(template % time.time())
Interface to the runtime system.
n
.
Zero means success, other values indicate an error.
PATH
.
This list may be changed freely and may contain relative paths.
But note that relative paths are problematic: they becomde invalid
if the current working directory changes. That path[0]
should be the absolute path of the directory where argv[0]
is found.
sys.path
with another list will not work.
main
with a new call stack of
size n
. This is used to obtain unlimited recursion
depth.
use sys: call f = |n| 0 if n==0 else f(n-1)+1 function main() print(f(10^5)) end call(10^6,main)
null
if the process was successful, otherwise
an integer.
cmd("sh",["-c","GET en.wikipedia.org > /tmp/0"]) s = read("/tmp/0")
print(*a)
and put(*a)
, but
print to stderr instead of stdout.
x
is a table object, else false.
x
is a class object, else false.
null
for
a non-pointer object. The only non-pointer objects are
null
, empty
and
objects of type Bool
, Int
, Float
,
Complex
. Note that they are considered non-pointer, even
if internally stored behind a pointer. Note that the address is not
stored as an integer, because an integer cannot hold an u64 value.
This modules patches functions (that take callbacks)
with Moss implementations to dispense with the hardware callstack.
It should be used together with sys.call
to
enable unlimited recursion depth.
The following functions are patched:
List.map, List.filter, Iterable.map, Iterable.filter, Iterable.all, Iterable.any, Iterable.count, Iterable.reduce
path
leads to a directory.
path
leads to a file.
"."
and ".."
.
File
.
f: File
n
bytes and return them as a byte list.