-- "Global" constructs class System inherits IO { void: Object <- while false loop 0 pool; or(p: Bool, q: Bool) : Bool { if p then true else if q then true else false fi fi }; and(p: Bool, q: Bool) : Bool { if p then if q then true else false fi else false fi }; assert(condition: Bool, method_name: String, error_msg: String) : Object { if not condition then { out_string("\n") .out_string("Assertion failed at ") .out_string(type_name()) .out_string(".") .out_string(method_name) .out_string("(): ") .out_string(error_msg) .out_string("\n"); abort(); } else void fi }; not_implemented(method_name: String) : Object {{ out_string("\n") .out_string("Method ") .out_string(type_name()) .out_string(".") .out_string(method_name) .out_string("() isn't implemented!") .out_string("\n"); abort(); }}; not_implemented_retint(method_name: String) : Int {{ not_implemented(method_name); 0; }}; not_implemented_retstr(method_name: String) : String {{ not_implemented(method_name); ""; }}; };