-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't working rightSomething isn't working right
Description
This code does not work as expected:
Pair := (f, s) => { (x) => { x(f, s) } }
first := (p) => { p((f, s) => { f } ) }
first(Pair(1, 2))
I'm pretty sure that the problem is not trying to call (apply) the passed-in function p, because that's working fine in this code:
TRUE := (t, f) => { t }
or := (this, that) => { this(TRUE, that) }
or(TRUE, TRUE)
I think the problem is that the inner function in Pair isn't able to get f and s. I believe I came across the same issue when I attempted to implement closures (and backed it out when it didn't work right). In fact, I think the actual problem here is that closures aren't working properly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't working rightSomething isn't working right