Name:
Anonymous
2017-07-06 17:06
Then how do you make a function that checks if two values are equal?
Name:
Anonymous
2017-07-06 17:17
very simpel, if equal code, equal values. not equal definition coding? not equal function.
fun one:
int funone(int x)
{
return 2 * x + 10
}
fun two:
int funtwo(int x)
{
return 2 * (x + 5)
}
different codings? different values, fun one = fun two false
but if elsewhere is fun one = fun one (different variable), same value
Name:
Anonymous
2017-07-06 17:58
function eq(a,b) return !(a-b)
If a==b a-b==0 !0 =1!(a-b)
if a!=b a-b==(!0) !!0=0
Name:
Anonymous
2017-07-07 1:55
>>2But how do you compare a function with another function?
Name:
Anonymous
2017-07-07 2:17
>>5Functions f(x) and g(x) are equal if and only if there does not exist an x such that f(x) != g(x).
Name:
Anonymous
2017-07-07 2:18
>>5If they are the same exact function:
Compare their addresses in memory. !(&funcname-&funcname)
Name:
Anonymous
2017-07-07 14:20
>>7Operations such as &, ! and - do not exist, you only have functions.
Name:
Anonymous
2017-07-07 14:46
>>10What about C macros? Boolean operations and subtraction are reducible to term rewriting
https://dis.tinychan.org/read/prog/1498927955
Name:
Anonymous
2017-07-08 0:10
>>12Functions have no addresses, but even if they had, you still haven't explained how eq would be implemented.
Name:
Anonymous
2017-07-08 3:05
make a function that implements diff
Name:
Anonymous
2017-07-08 5:29
>>13eq() evaluates to true() if all its arguments are equal, otherwise it evaluates to false().
Name:
Anonymous
2017-07-08 14:24
>>16That's an easy thing to say but it does not explain how one could implement it.
Name:
Anonymous
2017-07-08 16:48
>>17Well, it's not like trying to implement diff.
Name:
Anonymous
2017-07-10 6:39
>>18I'd still want to see these guys do it