top | item 45682811

(no title)

gradschool | 4 months ago

I know everyone says SK combinators can express any computable function, but I don't get it. How do we write this function foo in terms of SK combinators alone? Is there some obvious programming trick I'm missing that makes it trivial? (It wouldn't be the first time.)

foo(x) = if (x == K) return S else return K

discuss

order

subleq|4 months ago

That's not a computable function. Function equality (x==K) is undecidable.

Jtsummers|4 months ago

And that's covered in the last chapter of To Mock a Mockingbird (this submission prompted me to pull it off the shelf this morning).

solomonb|4 months ago

Just postulate function extensionality and move on with life. :D

andoando|4 months ago

Are you asking how to do a if else statement?