From 904c9f29534df5770702b8d7ba6921eaf6ccf9fc Mon Sep 17 00:00:00 2001 From: booniepepper Date: Thu, 13 Jul 2023 15:55:31 -0700 Subject: [PATCH] Always sort defs. 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. --- src/builtins.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/builtins.zig b/src/builtins.zig index e0efbb7..dec1c54 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -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 }); }