stdlib: add d:rehash
FossilOrigin-Name: 4e7206c7c65744287e66e0a3096ba3f2c215d4e7811c2e0195a371233bdb7a93
This commit is contained in:
parent
1ca786f95a
commit
41fe99682b
4 changed files with 659 additions and 637 deletions
|
@ -111,7 +111,7 @@ data store limits.
|
|||
~~~
|
||||
|
||||
~~~
|
||||
:run &block:buffer s:evaluate ;
|
||||
:run &block:buffer ;
|
||||
|
||||
:use (block) set load run ;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
ngaImage
BIN
ngaImage
Binary file not shown.
1275
vm/nga-c/image.c
1275
vm/nga-c/image.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue