Sha256: 19b34e00a1b78a54e12f8cf101c4350fd08ea71aa01a84db96ce6277536032d9

Contents?: true

Size: 382 Bytes

Versions: 10

Compression:

Stored size: 382 Bytes

Contents

Retro's arithmetic functions are based on those in [[Forth]]. The example is an adaption of the one from Forth.
 
:arithmetic (ab-)
  over       '\na_______=_%n s:put
  dup        '\nb_______=_%n s:put
  dup-pair + '\na_+_b___=_%n s:put
  dup-pair - '\na_-_b___=_%n s:put
  dup-pair * '\na_*_b___=_%n s:put
  /mod       '\na_/_b___=_%n s:put
             '\na_mod_b_=_%n\n" s:put ;

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/retro.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/retro.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/retro.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/retro.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/retro.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/retro.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/retro.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/retro.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/retro.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/retro.txt