Standard library¶
The RCL standard library is a dict of functions that is in scope by default under the name std
. Most of the built-in functionality is not in this std
dict, but in methods on the builtin types. See the next chapters for those.
range¶
std.range: (lower: Int, upper: Int) -> List[Int]
Return the range of integers lower
through upper
. The lower bound is inclusive and the upper bound is exclusive. When the lower bound is greater than the upper bound, range
returns an empty list.
std.range(3, 7)
// Evaluates to:
[3, 4, 5, 6]
std.range(7, 3)
// Evaluates to:
[]
read_file_utf8¶
std.read_file_utf8: (path: String) -> String
Return the contents of the file at the given path. Paths are treated the same as for imports, and are subject to the same sandbox restrictions. The file must contain valid UTF-8 text without byte order mark.