mirror of
https://git.sr.ht/~crc_/retroforth
synced 2024-09-29 05:36:52 +02:00
backport a:index from retro/napia (no longer needs to create a curry function when used)
FossilOrigin-Name: 704f6033f56ff0c908ff8f132d99acd0128a7a28aeb1ba4a4d882a1b5076579b
This commit is contained in:
parent
2ec35cf45c
commit
c19ac3e293
6 changed files with 653 additions and 657 deletions
|
@ -1,5 +1,5 @@
|
|||
# RetroForth 2022.1 Release Notes
|
||||
|
||||
|
||||
# Core Language
|
||||
|
||||
- deprecated
|
||||
|
@ -8,14 +8,18 @@
|
|||
|
||||
- dictionary
|
||||
|
||||
- arrays
|
||||
|
||||
- a:index no longer need to construct a new word to locate
|
||||
the index (backport from retro/napia)
|
||||
|
||||
# VM
|
||||
|
||||
## nga-c: retro.c
|
||||
|
||||
- recognize TAB as whitespace when including files
|
||||
|
||||
# Documentation
|
||||
|
||||
# Documentatio
|
||||
|
||||
# Other
|
||||
|
||||
|
|
|
@ -1628,13 +1628,17 @@ using a variable for the flag/offset value, but it's pretty clean
|
|||
overall.
|
||||
|
||||
~~~
|
||||
:a:index (an-i)
|
||||
push push #-1 #0 pop pop swap
|
||||
[ over eq? [ [ over #-1 eq? [ nip dup ] if ] dip ] if
|
||||
[ n:inc ] dip ]
|
||||
a:for-each drop-pair ;
|
||||
|
||||
{{
|
||||
:identify
|
||||
#-1 swap #0
|
||||
[ TRUE eq? [ over #-1 eq? [ nip dup ] if ] if n:inc ] a:reduce drop ;
|
||||
---reveal---
|
||||
:a:index (an-n)
|
||||
&Heap [ &eq? curry a:map identify ] v:preserve ;
|
||||
:a:index/string (as-n)
|
||||
&Heap [ &s:eq? curry a:map identify ] v:preserve ;
|
||||
}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# RETRO Core 2021.11
|
||||
# RETRO Core 2022.1
|
||||
|
||||
RETRO Core is a minimal Forth implementation for the Nga
|
||||
virtual machine. Like Nga this is intended to be used within
|
||||
|
@ -147,7 +147,7 @@ r 9999
|
|||
d 1536
|
||||
|
||||
: Version
|
||||
d 202111
|
||||
d 202201
|
||||
|
||||
: references
|
||||
r interpret
|
||||
|
|
BIN
ngaImage
BIN
ngaImage
Binary file not shown.
1288
vm/nga-c/image.c
1288
vm/nga-c/image.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue