Sha256: ce859534dce48de22eb313fcf80d72c5c37dc2aba5ff8944f062feeb520b1dc4

Contents?: true

Size: 687 Bytes

Versions: 10

Compression:

Stored size: 687 Bytes

Contents

Translation of Racket

{def arithmetic 
 {lambda {:x :y}
  {S.map {{lambda {:x :y :op} 
                  {br}applying :op on :x & :y returns {:op :x :y}} :x :y}
         + - * / % pow max min = > <}}}
-> arithmetic

{arithmetic 8 12}
-> 
applying + on 8 &amp; 12 returns 20 
applying - on 8 &amp; 12 returns -4 
applying * on 8 &amp; 12 returns 96 
applying / on 8 &amp; 12 returns 0.6666666666666666 
applying % on 8 &amp; 12 returns 8 
applying pow on 8 &amp; 12 returns 68719476736 
applying max on 8 &amp; 12 returns 12 
applying min on 8 &amp; 12 returns 8 
applying = on 8 &amp; 12 returns false 
applying > on 8 &amp; 12 returns false 
applying < on 8 &amp; 12 returns true

Version data entries

10 entries across 7 versions & 1 rubygems

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