retro.forth: minor reorganizations

FossilOrigin-Name: 0aa751dedd90a0b82e1a545d487c6b64495e11dfaa222bb6ba4cd39b14300290
This commit is contained in:
crc 2020-02-11 21:13:58 +00:00
parent 96fe3943bb
commit 45bc0209c7
3 changed files with 633 additions and 636 deletions

View file

@ -494,22 +494,12 @@ Forth, where non-zero values are true.
:FALSE (-n) #0 ;
~~~
The basic Rx kernel doesn't provide two useful forms which I'll
provide here.
~~~
:lteq? (nn-f) dup-pair \eqpultpo \or...... ;
:gteq? (nn-f) swap lteq? ;
~~~
~~~
:if; (qf-) over &if dip 0; pop drop-pair ;
:-if; (qf-) over &-if dip #-1 xor 0; pop drop-pair ;
~~~
And then some numeric comparators.
Some numeric comparisons.
~~~
:not (n-n) #-1 xor ;
:lteq? (nn-f) dup-pair \eqpultpo \or...... ;
:gteq? (nn-f) swap lteq? ;
:n:MAX (-n) #-5 fetch ;
:n:MIN (-n) #-4 fetch ;
:n:zero? (n-f) #0 eq? ;
@ -521,6 +511,14 @@ And then some numeric comparators.
:n:odd? (n-f) #2 /mod drop n:-zero? ;
~~~
The basic Rx kernel doesn't provide two useful forms which I'll
provide here.
~~~
:if; (qf-) over &if dip 0; pop drop-pair ;
:-if; (qf-) over &-if dip not 0; pop drop-pair ;
~~~
## More Stack Shufflers.
`rot` rotates the top three values.
@ -550,7 +548,6 @@ so they can be inlined. Here's the high level forms:
~~~
:/ (nq-d) \diswdr.. ; primitive
:mod (nq-r) \didr.... ; primitive
:not (n-n) #-1 xor ;
:n:pow (bp-n) #1 swap [ over * ] times nip ;
:n:negate (n-n) #-1 * ;
:n:square (n-n) dup * ;

BIN
ngaImage

Binary file not shown.

File diff suppressed because it is too large Load diff