diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-05-22 03:57:59 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-05-22 03:57:59 -0700 |
| commit | 3f3bda4692b4017c7ad6ed1c434313b9dcc62cfb (patch) | |
| tree | ee847faa5e64ce80a00a0bd2160ebb576b8d4ad4 /log-load.e | |
| parent | 83953f9e4b4fb3130c8ac5e1b8408a2830e21c23 (diff) | |
small changes towards self-hosting
Force-Push: yes Change-Id: I6cf15b4e37b66a04afd5af9dfd9cc3d5eb52b894
Diffstat (limited to 'log-load.e')
| -rw-r--r-- | log-load.e | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/log-load.e b/log-load.e index 2b7cbd2..d1e4a2f 100644 --- a/log-load.e +++ b/log-load.e @@ -108,53 +108,6 @@ ~ this file. -~ Find-in is the main word that provides the capability to look up words by -~ name, though it's usually used via "find" rather than being called directly. -~ -~ Find-in traverses the linked list formed by a particular dictionary's -~ next-entry pointers, looking for an entry that matches a given name. The -~ dictionary pointer is the pointer (not handle) to the root of the list, -~ which runs from newest to oldest. For example, dereferencing the value of -~ "latest" gives the pointer to the main dictionary, which can be passed to -~ find-in. -~ -~ Having find-in separated out is convenient when working with alternate -~ dictionaries, but the main reason for having it is not convenience but -~ necessity: During Evocation's startup, there is a period before global -~ variables are easily accessible, so there would be no way to implement -~ "find". The warm-start routine (see execution.e and transform.e) has the -~ job of fixing that, and it makes extensive use of find-in to do so. -~ -~ TODO this probably deserves its own file? -~ -~ (dictionary pointer, string pointer -- entry pointer or 0) -: find-in - ~ It will be more convenient to have the entry pointer on top. - swap - - { - ~ If the entry pointer is null, exit. - ~ (name pointer to find, current entry pointer) - dup 0 = { swap drop exit } if - - ~ Check this entry's "hidden" flag. - ~ (name pointer to find, current entry pointer) - dup entry-flags@ 0x80 & 0x80 != { - ~ Test whether this entry is a match. - ~ (name pointer to find, current entry pointer) - 2dup 10 + stringcmp 0 = { - ~ If we're here, it's a match. Clean up our working state and exit. - ~ (name pointer to find, current entry pointer) - swap drop exit - } if - } if - - ~ If we're here, it's not a match; traverse the pointer and repeat. - ~ (name pointer to find, current entry pointer) - @ - } forever ; - - ~ This has the same value as the constant control-stack-size, which is ~ defined in execution.e. Everything will break if it doesn't. ~ |