1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-04 09:33:02 +00:00

Add mod function to core.

The `mod` function is a pair function with `%`, or te remainder
function and is distinct from it. This is taken from common lisp.
This commit is contained in:
Calvin Rose
2020-01-23 18:54:30 -06:00
parent b8d530da36
commit 28d41039b8
9 changed files with 108 additions and 22 deletions

View File

@@ -108,6 +108,7 @@ static const JanetInstructionDef janet_ops[] = {
{"mkstu", JOP_MAKE_STRUCT},
{"mktab", JOP_MAKE_TABLE},
{"mktup", JOP_MAKE_TUPLE},
{"mod", JOP_MODULO},
{"movf", JOP_MOVE_FAR},
{"movn", JOP_MOVE_NEAR},
{"mul", JOP_MULTIPLY},
@@ -121,6 +122,7 @@ static const JanetInstructionDef janet_ops[] = {
{"pusha", JOP_PUSH_ARRAY},
{"put", JOP_PUT},
{"puti", JOP_PUT_INDEX},
{"rem", JOP_REMAINDER},
{"res", JOP_RESUME},
{"ret", JOP_RETURN},
{"retn", JOP_RETURN_NIL},