From 41fe99682b04df0fe42c4d086c4026504dc89126 Mon Sep 17 00:00:00 2001 From: crc <> Date: Tue, 19 Jul 2022 16:57:49 +0000 Subject: [PATCH] stdlib: add d:rehash FossilOrigin-Name: 4e7206c7c65744287e66e0a3096ba3f2c215d4e7811c2e0195a371233bdb7a93 --- example/rilo-editor.retro | 2 +- image/retro.forth | 19 + ngaImage | Bin 44368 -> 44604 bytes vm/nga-c/image.c | 1275 +++++++++++++++++++------------------ 4 files changed, 659 insertions(+), 637 deletions(-) diff --git a/example/rilo-editor.retro b/example/rilo-editor.retro index 2c4d7fb..ee27d84 100644 --- a/example/rilo-editor.retro +++ b/example/rilo-editor.retro @@ -111,7 +111,7 @@ data store limits. ~~~ ~~~ -:run &block:buffer s:evaluate ; +:run &block:buffer ; :use (block) set load run ; diff --git a/image/retro.forth b/image/retro.forth index 3dda851..18053b3 100644 --- a/image/retro.forth +++ b/image/retro.forth @@ -1911,6 +1911,25 @@ generic "keyboard" input, the basic listener here can be used. &listen #1 store ~~~ +## Dictionary Hashing + +In the future, we will be making use of hashes to help improve +the performance of dictionary lookups. The following words can +be used to update the hashes. + +In RetroForth/ilo, the hashes are used exclusively. We can't do +that here; keeping name data is needed for some introspection +tasks, and since Nga allows for 64-bit cells, can't guarantee +the constraints will be met. So we'll be bootstrapping using +the names, and patching in the hashes later. + +~~~ +&s:hash 'd:Hash-Function var-n + +:d:rehash (-) + [ [ d:name @d:Hash-Function call ] sip d:hash store ] d:for-each ; +~~~ + ## The End ## Legalities diff --git a/ngaImage b/ngaImage index b4c40064d16dc3fd341c2065325a9e8af30214e7..cc6a7d1ae47e8375affeea81e4b79babcfbef6be 100644 GIT binary patch delta 245 zcmca`i)qgtCSFE%1_mo_28L!J?%T*)EL+Z1Bi8j*bRtFfjAF{!TPzlg&7z;fO>MYC+oF})fWLJ zQh^wx0a-JU%K&ml9Z)HVE(6gV3=Dff;`|H@AZvkK1}+dEhzp?d2Z4ehb-RFK0!Z?C RPkcVH32@LBKrUU delta 78 zcmdmUhv~vCCSFE%1_mo_1_lox4&KOHF09A^1gSt=0%8CGh+PE4Wl%Q5