Skip to content

Commit

Permalink
adding exit()
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevan Little committed Apr 3, 2013
1 parent 2f93a5b commit 55b92f5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/scala/org/moe/runtime/builtins/CorePackage.scala
Expand Up @@ -50,5 +50,22 @@ object CorePackage {
)
)

pkg.addSubroutine(
new MoeSubroutine(
"exit",
new MoeSignature(List(new MoeOptionalParameter("$status"))),
env,
{ (e) =>
val status = e.get("$status").get
if (status.isUndef) {
r.getSystem.exit()
} else {
r.getSystem.exit(status.unboxToInt.get)
}
getUndef
}
)
)

}
}

0 comments on commit 55b92f5

Please sign in to comment.