From 0adcab31ac9a3597c1e27806151c3858fb501b24 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Mon, 4 May 2026 20:40:13 -0700 Subject: implement create-in which is used for independent dictionaries also some important TODOs have been discovered Force-Push: yes Change-Id: I8efe7d0074700d6f5c78d4a591e5b590f57f47a9 --- quine.asm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'quine.asm') diff --git a/quine.asm b/quine.asm index 45d9bda..5f13e13 100644 --- a/quine.asm +++ b/quine.asm @@ -11807,6 +11807,26 @@ defword boot_source, 0x40 dq " ; " + ; Notionally, it might make sense to define "create" in terms of + ; "create-in". Any change like that is being postponed to after the removal + ; of flatassembler, when refactorings will be easier. + ; + ; In: + ; name string pointer + ; dictionary handle (points to a pointer to the first item) + dq ": create-in " + dq " dup @ here @ swap pack64 " + ; (name string pointer, dictionary handle, output point) + dq " 0 pack8 0 pack8 " + dq " 3roll packstring " + dq " 8 packalign " + ; (dictionary handle, output point) + dq " swap here @ swap ! " + ; (output point) + dq " here ! " + dq " ; " + + ; The word named "docol" has the job of returning the value that gets used ; as the actual codeword. We make the assumption that the codeword will ; point somewhere near the entry header; we allow for the possibility that @@ -11931,6 +11951,10 @@ defword boot_source, 0x40 ;dq " bye ; doittoit " dq " " + ; TODO running "variable" interactively doesn't work because the string and + ; the "create" invocation step on each other. this is a big deal and really + ; needs to be fixed. + ; TODO find_in/find-in is backwards compared to create-in. ; TODO define ( ... ) comments ; TODO define constant (double-check variable) ; TODO consider defining is-hidden and is-immediate -- cgit 1.4.1