Commit 5556ce5e authored by Chris Müller's avatar Chris Müller
Browse files

Implement (exit FIXNUM)

Add systemcall exit to the runtime environment.
parent 04936952
......@@ -22,6 +22,13 @@
struct org_cherry_value*
org_cherry_system_exit(struct org_cherry_environment* env, struct org_cherry_value* args)
{
if(IS_NULL(args))
exit(EXIT_SUCCESS);
else if(IS_FIXNUM(HEAD(args)))
exit(HEAD(args)->fixnum_value);
else
org_cherry_env_raise(env, org_cherry_string("Exit is expecting a fixnum for the first argument"));
return org_cherry_false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment