# boolean default class OptParam def main is shared x = OptParam() x.val = true x.foo('default') assert x.val == false x.foo('provided', true) assert x.val var val = false def foo(s as String, b = false) if s == 'default' assert b == false .val = b