mirror of
https://github.com/janet-lang/janet
synced 2025-11-06 02:23:03 +00:00
Extend power of the each form
This changes the implementation of the `next` function which is now used to implement each. This let's us iterate over more types, not just tables and structs.
This commit is contained in:
@@ -87,6 +87,8 @@ static const JanetInstructionDef janet_ops[] = {
|
||||
{"in", JOP_IN},
|
||||
{"jmp", JOP_JUMP},
|
||||
{"jmpif", JOP_JUMP_IF},
|
||||
{"jmpni", JOP_JUMP_IF_NIL},
|
||||
{"jmpnn", JOP_JUMP_IF_NOT_NIL},
|
||||
{"jmpno", JOP_JUMP_IF_NOT},
|
||||
{"ldc", JOP_LOAD_CONSTANT},
|
||||
{"ldf", JOP_LOAD_FALSE},
|
||||
@@ -110,6 +112,7 @@ static const JanetInstructionDef janet_ops[] = {
|
||||
{"movn", JOP_MOVE_NEAR},
|
||||
{"mul", JOP_MULTIPLY},
|
||||
{"mulim", JOP_MULTIPLY_IMMEDIATE},
|
||||
{"next", JOP_NEXT},
|
||||
{"noop", JOP_NOOP},
|
||||
{"prop", JOP_PROPAGATE},
|
||||
{"push", JOP_PUSH},
|
||||
|
||||
Reference in New Issue
Block a user