Groups
Sign in
Groups
Seattle SICP Study Group
Conversations
About
Send feedback
Help
Exercise 2.6
1 view
Skip to first unread message
Quux Man
unread,
Nov 7, 2007, 2:20:03 PM
11/7/07
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to seattle-sicp...@googlegroups.com
I don't remember going over this very thoroughly. Here's benny99's (from #haskell) solution:
(
define
(
zero f
)
(
lambda
(
x
)
x
)
)
(
define
(
one f
)
(
lambda
(
x
)
(
f x
)
)
)
(
define
(
two f
)
(
lambda
(
x
)
(
f
(
f x
)
)
)
)
(
define
(
add-1 n
)
(
lambda
(
f
)
(
lambda
(
x
)
(
f
(
(
n f
)
x
)
)
)
)
)
(
define
(
add n m
)
(
lambda
(
f
)
(
lambda
(
x
)
(
(
compose
(
m f
)
(
n f
)
)
x
)
)
)
)
(
define
(
chn->n c
)
(
(
c
(
lambda
(
x
)
(
+
x 1
)
)
)
0
)
)
This brings up my original problem with the problem: it's not very well defined. Is he asking to define an add that's faster than adding 1 n or m times? Is this possible using Church Numerals? Or is the question asking something simpler?
Reply all
Reply to author
Forward
0 new messages