Skip to content

Instantly share code, notes, and snippets.

@joseoliv
Created June 14, 2019 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseoliv/df12bbc3c33cee07f0cef7faec0fa129 to your computer and use it in GitHub Desktop.
Save joseoliv/df12bbc3c33cee07f0cef7faec0fa129 to your computer and use it in GitHub Desktop.
assert
package metaobjectTest
@doc{*
Macro 'assert' has the following syntax:
assert expr;
'assert' is a macro keyword and 'expr' a Cyan expression. A ';'
should end the macro call.
At runtime, if 'expr' is false, an error message is issued.
The program is NOT terminated.
*}
object Assert
func run {
assert "This message should be printed" == "";
assert "Do not print this" size > 10;
assert 0 == 0;
assert " "*3 == " ";
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment