AkronCodeClub / sicp-study-group

A study group to work through Structure and Interpretation of Computer Programs (SICP)
6 stars 3 forks source link

Lambda Expressions and Approximation of Roots #21

Closed glyphrider closed 9 years ago

glyphrider commented 9 years ago

I was intrigued by the discussions we had Monday night regrading closures and refining of code. I noticed that there was a lot of discussion in the lecture(s) regarding approximation of square roots followed by an exercise in approximating cube roots. So, I spent a little time working an evolution from the initial square root idea, to a generic approximation engine that can work through any problem.

What do you guys think?

glyphrider commented 9 years ago

@RickBacci -- you are exactly correct. The abs and avg functions never made it inside the sqrt function, because they were mere building blocks (which also had potential use outside of the approximation domain). The lambda expressions don't need to be named, because they are used to evolve the approximate function into performing square root approximation (or later, cube root approximation); they receive names when they are bound to the formal parameters of the approximate function.

jonknapp commented 9 years ago

yea boy! thank you very much for the end result and especially for the path to get there.

rickbacci commented 9 years ago

@glyphrider Not be be a total noob, but do i have to merge this?

jonknapp commented 9 years ago

The pull request was a way to show his changes in one place for review. It doesn't have to be merged unless he does not have commit access to the repo.

On Thu, Jan 22, 2015 at 3:27 PM, Rick Bacci notifications@github.com wrote:

@glyphrider https://github.com/glyphrider Not be be a total noob, but do i have to merge this?

— Reply to this email directly or view it on GitHub https://github.com/AkronCodeClub/sicp-study-group/pull/21#issuecomment-71092254 .

rickbacci commented 9 years ago

@jonknapp thanks