So I decided I would read up on my SICP, because I got tired of watching my privelege since everyone else watches it for me, and picked up Edwin and it's pretty neat. I kind of find it hard to deal with on this tiny keyboard though, I just screwed up everything by accidentally unbinding C-x and couldn't figure out how to redefine it or even operate the windows so that I could be able to read the documentation on how, and it was saying some stuff about errors and buffers and #fs in one of the minimally tall windows. So I closed it and lost everything.
I was trying to do Exercise 1.17 but my multiplication function was already pretty bad with hitting the maximum recursion depth with any kind of ``big'' numbers (but at least worked for smaller ones) and my division function wasn't working right at all. All I have left is this function for finding an element in Pascal's triangle. Here, you guys can pick it apart and make fun of me, I know it's not optimal. Or whine about my indentation most likely.
(define pasct x y)
(cond ((< x 1) 0) ((< y 1) 0) ((= x 1) 1) ((= y x) 1)
(else (+ (pasct x (- y 1)) (pasct (- x 1) (- y 1))))))
Name:
Anonymous2012-06-15 5:12
>>1 watching my privelege
Don't give in to them, faggot.
(define (n/ a b)
(define (iter a b c)
(cond ((> (- a b) 0.0) (iter (-a b) b (+ c 1.0)))
(else c)))
(iter a b 1.0))
How can I get a function to do actual division? This is all that I've got that is anything close, but it can only handle whole integer division.
Maybe I just don't know my lambda calculus. But I'm starting to lose THE ABELSUSS at this point and not understanding anything anymore.