Skip to content

Commit

Permalink
Always sort defs.
Browse files Browse the repository at this point in the history
This is what most humans will want. Other use cases for getting definitions and doing things with them can use either def? for a very fast lookup, or usage to read the information.
  • Loading branch information
booniepepper committed Jul 13, 2023
1 parent 6dc71c1 commit 904c9f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/builtins.zig
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ pub fn defs(dt: *DtMachine) !void {
try quote.append(.{ .string = cmdName });
}

const items = quote.items;
std.mem.sort(DtVal, items, dt, DtVal.isLessThan);

try dt.push(.{ .quote = quote });
}

Expand Down

0 comments on commit 904c9f2

Please sign in to comment.