{"action":"closed","issue":{"url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/issues/51","labels_url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/issues/51/comments","events_url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/issues/51/events","html_url":"https://github.com/Mellow-Programming-Language/Mellow/issues/51","id":101304888,"number":51,"title":"Implement the `assert` statement","user":{"login":"CollinReeser","id":639071,"avatar_url":"https://avatars.githubusercontent.com/u/639071?v=3","gravatar_id":"","url":"https://api.github.com/users/CollinReeser","html_url":"https://github.com/CollinReeser","followers_url":"https://api.github.com/users/CollinReeser/followers","following_url":"https://api.github.com/users/CollinReeser/following{/other_user}","gists_url":"https://api.github.com/users/CollinReeser/gists{/gist_id}","starred_url":"https://api.github.com/users/CollinReeser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CollinReeser/subscriptions","organizations_url":"https://api.github.com/users/CollinReeser/orgs","repos_url":"https://api.github.com/users/CollinReeser/repos","events_url":"https://api.github.com/users/CollinReeser/events{/privacy}","received_events_url":"https://api.github.com/users/CollinReeser/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/labels/codegen","name":"codegen","color":"d4c5f9"},{"url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/labels/core%20feature","name":"core feature","color":"207de5"},{"url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/labels/parsing","name":"parsing","color":"d4c5f9"},{"url":"https://api.github.com/repos/Mellow-Programming-Language/Mellow/labels/typechecking","name":"typechecking","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":{"login":"CollinReeser","id":639071,"avatar_url":"https://avatars.githubusercontent.com/u/639071?v=3","gravatar_id":"","url":"https://api.github.com/users/CollinReeser","html_url":"https://github.com/CollinReeser","followers_url":"https://api.github.com/users/CollinReeser/followers","following_url":"https://api.github.com/users/CollinReeser/following{/other_user}","gists_url":"https://api.github.com/users/CollinReeser/gists{/gist_id}","starred_url":"https://api.github.com/users/CollinReeser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CollinReeser/subscriptions","organizations_url":"https://api.github.com/users/CollinReeser/orgs","repos_url":"https://api.github.com/users/CollinReeser/repos","events_url":"https://api.github.com/users/CollinReeser/events{/privacy}","received_events_url":"https://api.github.com/users/CollinReeser/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-08-16T22:23:04Z","updated_at":"2015-10-15T03:05:06Z","closed_at":"2015-10-15T03:05:06Z","body":"`assert` will take one argument, with an optional second argument. The first argument will be a boolean expression, the second optional argument a string.\r\n\r\nIf the boolean expression evaluates to `true` at runtime, the `assert` statement is a no-op (save for evaluating the boolean expression).\r\n\r\nIf the boolean expression evaluates to `false` at runtime, the `assert` statement prints a string that indicates the file and line/column location of the assertion failure, and additionally the contents of the optionally passed string, and then forces program exit.\r\n\r\n`assert` statements can be disabled through the use of the `--release` switch.\r\n\r\n```go\r\na := [1, 2, 3, 4, 5];\r\nassert(contains!int(a, 5), \"Failed to find element in array using `contains`!\");\r\n```"}}