From a41c6444d30f9ad561d95a1776f796581338df16 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 28 Aug 2026 22:21:52 -0700 Subject: make read-to-buffer take its delimiter as a parameter since the recommended invocation to build Evocation (hehe) does the heavy lifting in interpreted mode, this required a new helper, allocate-string, which takes a string in the scratch space and properly allocates it so it won't be overwritten by future allocations Force-Push: yes Change-Id: Ia73612a65fd7c11af5fe110c573c23c16b777112 --- dynamic.e | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dynamic.e') diff --git a/dynamic.e b/dynamic.e index a02eec0..af5d9b2 100644 --- a/dynamic.e +++ b/dynamic.e @@ -348,6 +348,15 @@ 3roll + 8 packalign here ! ; +~ Takes a string pointer which must be equal to the current value of "here", +~ indicating it is in the temporary allocation space, and allocates it +~ permanently by advancing "here" to the next aligned address after it. +~ +~ (string pointer -- string pointer) +: allocate-string + dup dup stringlen 1+ + 8 packalign here ! ; + + ~ Allocate space by incrementing "here", and output a word entry header in ~ it. Also add it to the "latest" linked list. Use zero as the flag values; ~ accept a string pointer on the stack and use its contents as the name. -- cgit 1.4.1