Content deleted Content added
Building conditionals out of lambda calculus |
mNo edit summary |
||
Line 61:
::Yes. You need some means of making a branch, or conditional statement -- either ''cond'' or ''if'' can provide this. As for ''eq'', it is not used for arithmetical equality, but rather for determining whether two symbols are the same. Arithmetic doesn't enter into it -- this is a minimal set of operations for list and program-code manipulation, not for arithmetic. Anyhow, arithmetic can be implemented (slowly!) in terms of lists or functions, as by using a W-representation or [[Church integer]]s. --[[User:Fubar Obfusco|FOo]] 15:04, 7 Aug 2003 (UTC)
:::Forgive my notation, but True can be defined as "\ x . x" and False as "\ x ." where "\" is lambda. Then cond would be unnecessary because True and False would take care of it. Of course, if you're using eager evaluation, this isn't quite true, because "(False foo)" will still evaluate foo (which doesn't matter if it's referentially transparent).[[User:P3d0|P3d0]] 15:15, 7 Aug 2003 (UTC)
|