summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--dynamic.e13
-rw-r--r--labels.e16
-rw-r--r--quine.asm5
3 files changed, 18 insertions, 16 deletions
diff --git a/dynamic.e b/dynamic.e
index a260abe..55db683 100644
--- a/dynamic.e
+++ b/dynamic.e
@@ -50,6 +50,12 @@
 : oldest-entry
   latest @ { dup @ } { @ } while ;
 
+~ (dictionary handle -- entry pointer or 0)
+: oldest-entry-in
+  dup
+  dup { { dup @ } { @ } while } if
+  dup 3roll = { drop 0 } if ;
+
 ~ (entry pointer -- entry pointer or 0)
 : next-newer-entry
   latest @
@@ -57,6 +63,13 @@
   { dup { 2dup @ != } if }
   { @ } while swap drop ;
 
+~ (entry pointer, dictionary handle -- entry pointer or 0)
+: next-newer-entry-in
+  @
+  2dup = { 2drop 0 exit } if
+  { dup { 2dup @ != } if }
+  { @ } while swap drop ;
+
 ~ (entry pointer -- pointer)
 : guess-entry-end
   dup entry-flags@ 64 & 64 = { exit } if
diff --git a/labels.e b/labels.e
index 0d2b60d..d90ab0a 100644
--- a/labels.e
+++ b/labels.e
@@ -75,22 +75,6 @@
   entry-to-execution-token dup 8 + @ .hex64 space @ .hex8
   newline ;
 
-~ TODO this should go elsewhere
-~ (dictionary handle)
-: oldest-entry-in
-  dup
-  dup { { dup @ } { @ } while } if
-  dup 3roll = { drop 0 } if
-  ;
-
-~ TODO this should go elsewhere
-~ (entry pointer, dictionary handle)
-: next-newer-entry-in
-  @
-  2dup = { 2drop 0 exit } if
-  { dup { 2dup @ != } if }
-  { @ } while swap drop ;
-
 ~   This prints the headings for all the labels that have been created. Note
 ~ that labels that have been created once stay in the dictionary forever, even
 ~ if subsequent passes neither use nor define them. That's because the control
diff --git a/quine.asm b/quine.asm
index 3002cab..6027e5e 100644
--- a/quine.asm
+++ b/quine.asm
@@ -12048,6 +12048,11 @@ defword boot_source, 0x40
   dq ": oldest-entry                                                  "
   dq "  latest @ { dup @ } { @ } while ;                              "
 
+  dq ": oldest-entry-in                                               "
+  dq "  dup                                                           "
+  dq "  dup { { dup @ } { @ } while } if                              "
+  dq "  dup 3roll = { drop 0 } if ;                                   "
+
   dq ": next-newer-entry                                              "
   dq "  latest @                                                      "
   dq "  2dup = { 2drop 0 exit } if                                    "