2022-08-31 04:05:48 +02:00
|
|
|
# Retro/ilo & Retro/napia Words
|
2022-01-31 11:20:32 +01:00
|
|
|
|
2022-08-31 04:05:48 +02:00
|
|
|
This adds support for some words from Retro/ilo. It's intended
|
2022-01-31 11:20:32 +01:00
|
|
|
to aid in portability between the systems.
|
|
|
|
|
|
|
|
The basic math operations are given non-symbolic names and
|
2022-08-31 04:05:48 +02:00
|
|
|
placed in the `n:` namespace. (In Retro/ilo, these are the
|
2022-01-31 11:20:32 +01:00
|
|
|
standard names for these).
|
2022-01-19 11:21:10 +01:00
|
|
|
|
|
|
|
~~~
|
2022-01-31 11:20:32 +01:00
|
|
|
:n:add + ;
|
|
|
|
:n:sub - ;
|
|
|
|
:n:mul * ;
|
|
|
|
:n:div / ;
|
|
|
|
:n:mod mod ;
|
2022-01-19 11:21:10 +01:00
|
|
|
:n:divmod /mod ;
|
2022-08-31 04:05:48 +02:00
|
|
|
|
|
|
|
:comma , ;
|
|
|
|
:gc &Heap swap v:preserve ;
|
2022-01-19 11:21:10 +01:00
|
|
|
~~~
|
|
|
|
|
2022-01-31 11:20:32 +01:00
|
|
|
Provide source data.
|
|
|
|
|
2022-01-19 11:21:10 +01:00
|
|
|
~~~
|
|
|
|
'retro-napia.retro
|
|
|
|
dup 'n:add d:lookup d:source store
|
|
|
|
dup 'n:sub d:lookup d:source store
|
|
|
|
dup 'n:mul d:lookup d:source store
|
|
|
|
dup 'n:div d:lookup d:source store
|
|
|
|
dup 'n:mod d:lookup d:source store
|
|
|
|
dup 'n:divmod d:lookup d:source store
|
|
|
|
drop
|
|
|
|
~~~
|