Built-in Functions in Frml 0 ▲ The Third Bit 1 hour ago · Tech · hide · 0 comments Previous posts in this series introduced Frml, then explained how it checks simplar scalar code, handles contracts between functions, deals with loops, and checks arrays. This post shows how Frml handles built-in functions like push and pop. Here’s an example program to motivate the discussion: fn main() -> Int { let a: Array<Int> = [1]; push(a, 2); assert length(a) == 2; return 0; } Built-in Functions Frml’s built-in functions live in frml/builtins.py: read(path: String) -> String returns the contents of a file write(path: String, text: String) writes text to a file print(text: String) writes text to standard output split(text: String, sep: String) -> Array<String> splits text on a separator args() -> Array<String> returns the command-line arguments push(array, value) appends a value to an array pop(array) -> value removes and returns the last element TypeChecker.check_call first looks the name up in BUILTINS. For a non-polymorphic built-in, it checks the argument count and each… No comments yet. Log in to reply on the Fediverse. Comments will appear here.