21 lines
602 B
Plaintext
21 lines
602 B
Plaintext
{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 & 12 returns 20
|
|
applying - on 8 & 12 returns -4
|
|
applying * on 8 & 12 returns 96
|
|
applying / on 8 & 12 returns 0.6666666666666666
|
|
applying % on 8 & 12 returns 8
|
|
applying pow on 8 & 12 returns 68719476736
|
|
applying max on 8 & 12 returns 12
|
|
applying min on 8 & 12 returns 8
|
|
applying = on 8 & 12 returns false
|
|
applying > on 8 & 12 returns false
|
|
applying < on 8 & 12 returns true
|