2022-10-25 11:59:21 +02:00
|
|
|
# New Words
|
|
|
|
|
|
|
|
This contains a variety of words from my more recent systems.
|
|
|
|
|
|
|
|
Notes:
|
|
|
|
|
|
|
|
`aa:` is a new set of array words. These will be replacing the
|
|
|
|
existing set in the future.
|
|
|
|
|
2022-08-31 04:05:48 +02:00
|
|
|
~~~
|
|
|
|
:aa:make (...n-a) here [ dup comma &comma times ] dip ;
|
|
|
|
|
|
|
|
:aa:map
|
|
|
|
swap [ fetch-next [ [ fetch over call ] sip
|
|
|
|
&store sip n:inc ] times
|
|
|
|
drop-pair ] sip ;
|
|
|
|
|
|
|
|
:aa:contains? (an-f)
|
|
|
|
swap #0 swap [ swap [ over eq? ] dip or ] a:for-each nip ;
|
|
|
|
|
|
|
|
:aa:first (a-n) #0 a:fetch ;
|
2023-01-15 23:09:35 +01:00
|
|
|
:aa:last (a-n) dup a:length n:dec a:fetch ;
|
2022-09-06 16:29:32 +02:00
|
|
|
|
2023-01-15 23:09:35 +01:00
|
|
|
:a:dup here [ dup a:length comma &comma a:for-each ] dip ;
|
2022-08-31 04:05:48 +02:00
|
|
|
~~~
|
2023-03-06 20:36:58 +01:00
|
|
|
|
|
|
|
~~~
|
|
|
|
:d:use-hashes
|
|
|
|
&eq? &d:lookup #5 - store
|
|
|
|
[ d:hash fetch ] &d:lookup #8 - store
|
|
|
|
#2049 &d:lookup store
|
|
|
|
&s:hash &d:lookup n:inc store ;
|
2023-03-07 13:54:00 +01:00
|
|
|
|
|
|
|
:d:use-strings
|
|
|
|
&s:eq? &d:lookup #5 - store
|
|
|
|
&d:name &d:lookup #8 - store
|
|
|
|
#0 &d:lookup store
|
|
|
|
#0 &d:lookup n:inc store ;
|
2023-03-06 20:36:58 +01:00
|
|
|
~~~
|