Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

If everything is a function

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:07

By their return value.

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

>>2
But how do you compare a function with another function?

Name: Anonymous 2017-07-07 2:17

>>5
Functions 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

>>5
If they are the same exact function:
Compare their addresses in memory. !(&funcname-&funcname)

Name: Anonymous 2017-07-07 2:39

If everything is a function
No one says this.

Name: Anonymous 2017-07-07 2:40

>>8
it is true in haskell

Name: Anonymous 2017-07-07 14:20

>>7
Operations such as &, ! and - do not exist, you only have functions.

Name: Anonymous 2017-07-07 14:46

>>10
What about C macros? Boolean operations and subtraction are reducible to term rewriting
https://dis.tinychan.org/read/prog/1498927955

Name: Anonymous 2017-07-07 23:21

>>10

eq(adr(f),adr(g))

Name: Anonymous 2017-07-08 0:10

>>12
Functions 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 4:37

>>6
i like u

Name: Anonymous 2017-07-08 5:29

>>13
eq() evaluates to true() if all its arguments are equal, otherwise it evaluates to false().

Name: Anonymous 2017-07-08 14:24

>>16
That's an easy thing to say but it does not explain how one could implement it.

Name: Anonymous 2017-07-08 16:48

>>17
Well, it's not like trying to implement diff.

Name: Anonymous 2017-07-10 6:39

>>18
I'd still want to see these guys do it

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List