You already said that. I don't believe it. If you get stuck on something it'll be subtraction.
here's the compose(doesn't work due to extra ring)
expt:
(still doesn't work,numbers okay but the value of number is incorrect)
The value reported by PLUS has to be a (Church) number, i.e. a function of the form
Your PLUS is, correctly, a function of A and B, but if I'm not mistaken, that function doesn't return a number. Am I confused?
With TIMES, you luck out because the inner composition of functions produces a λx . something automatically, so you don't need an explicit λx in your definition.
And with EXPT you really luck out because the λf part is implicit also. I think it's so cool that the complexity of the definitions are exactly backwards from what you'd expect. That's why I didn't want to let you do TIMES by repeated calls to PLUS.
P.S. You know about Restore, right?
I am completely confused
Well, starting from the end, Restore is how you get back damaged projects.
For the others, you want a function of two numbers that reports a number. A number looks like
For example,
So a function of two numbers that reports a number will generally be
As it turns out, for PLUS you need all of that -- four nested lambdas. But, sort of magically, TIMES turns out to be a little easier, and EXPT a lot easier, than expected. The expression that replaces the ... for TIMES turns out to return a function of x, and the ... expression for EXPT returns a function of f that returns a function of x, i.e., a number.
Is that understandable? If not, try to ask a more specific question.
i still don't understand why my plus doesn't work while the try does
(i didnt even save a copy so no restore)
(i knew about restore but ur context is about lambdas so i didnt think about it)
If it makes you feel better, I started twice to explain how you wrote plus wrong, but you didn't!
You just called it wrong:
In strict lambda calculus, functions all have exactly one input. If you want a function with more inputs, you have to curry it.
When I teach this, I tell students they can cheat and build lambda expressions (rings) with more than one input.
But what you did was build PLUS in strict curried style, but test it as a function with two inputs. Either way is okay, but you have to be consistent.
Okay I'm confused. You were saying plus didn't work, and in https://forum.snap.berkeley.edu/t/calculus/10826/43 you used that TRY to show PLUS not working.
i didnt test it
the test block is by jens
i shuld be consistent
booleans after 5 minutes

(w/ that extra call to annihiliate extra rings)
(foo and bar content editted)
Cons!
I'll do subtraction last bc u say its hard
@bh?
Whoops!The unnecceary annihiliation of rings!
remove extra call in ifthenelse
Yay! Great job! Isn't ZERO? elegant?
One little thing: Just as in regular Snap! programming, you don't have to say
because ??? already has either TRUE or FALSE as its value.
By the way, about
All of this project is by me; the files have "Jens" in their names because this is the version I wrote for Jens, as opposed to the version I'm still trying to make work for myself. :~) But never mind who wrote it; you were complaining because the TEST call didn't give the answer you were expecting.
Good grief, can't I ever have a day off? I spent a lot of yesterday at an art show, and I'm going back there at least some of this weekend, so beware!
Oh that was the rememberd part last year so blame my past self
okay
sry
Groovy.
pproblem on subtraction
also im not on the computer that stores that project so i have to wait a day(ill be on that computer after that day)
Umm, can you ask a more specific question? "I know I have to X, but in order to do that I have to be able to do Y, and I can't figure out that part."
while loop
I know I have to mk a while loop, but in order to do that I have to be able to do know how to do it, and I can't figure out that part.
Ah. Well, first of all, a "loop" makes sense only when you're doing sequential, imperative programming. In functional programming you can't really say "first do this, then do that," although you can sometimes do equivalent things with λx . λy . y, which returns the second of two expressions. But since lambda calculus is normal order, when you call that function there's no guarantee that x will be computed before y.
What you have instead of looping is recursion. If your function has a name, e.g., WHILE, you can define (WHILE cond expr) as
λc . λe . if-then-else (c) (WHILE c e) false
But of course in λ calculus there's no DEFINE, so the only way anything has a name is by λ-binding. So one of the big difficulties is figuring out how a procedure can have a name for itself, in its own scope.
oof
my problem is actually on if-then-else
i k the y combinator
wait how did this post get into my drafts?