Bugfixes: add cljQuot/cljRem to runtime, quot/rem to interpreter. Cleanup: remove unused processAgentActions and sequtils import. 164 tests pass.
This commit is contained in:
@@ -874,6 +874,22 @@ proc evalList(items: seq[CljVal], env: Env): EvalResult =
|
||||
return EvalResult(ok: true, value: cljInt(args[0].intVal mod args[1].intVal))
|
||||
return EvalResult(ok: false, error: "mod requires integers")
|
||||
|
||||
of "quot":
|
||||
numArgs(2)
|
||||
if args[0].kind == ckInt and args[1].kind == ckInt:
|
||||
if args[1].intVal == 0:
|
||||
return EvalResult(ok: false, error: "Division by zero")
|
||||
return EvalResult(ok: true, value: cljInt(args[0].intVal div args[1].intVal))
|
||||
return EvalResult(ok: false, error: "quot requires integers")
|
||||
|
||||
of "rem":
|
||||
numArgs(2)
|
||||
if args[0].kind == ckInt and args[1].kind == ckInt:
|
||||
if args[1].intVal == 0:
|
||||
return EvalResult(ok: false, error: "Division by zero")
|
||||
return EvalResult(ok: true, value: cljInt(args[0].intVal mod args[1].intVal))
|
||||
return EvalResult(ok: false, error: "rem requires integers")
|
||||
|
||||
of "min":
|
||||
numArgs(2)
|
||||
if args[0].kind == ckInt and args[1].kind == ckInt:
|
||||
|
||||
Reference in New Issue
Block a user