Saturday, August 8, 2009

If you want to put your code in lib/ but you have your features and steps under features/ .. create a file called features/support/env.rb with the following (cucumber will load and run it)


:.unshift File.dirname(__FILE__) + "/../../lib"
some xml

SICP #1

Lecture 1

fixed point - finding the fixed point - take a guess, then apply the function
successively til "it doesnt change much" - how does this work? what does it mean?

eg. use fixed point method to find sqroot - find fixed point of average(x, y/x)


higher-order procedures take as inputs and outputs, procedures

generic operations - eg the many interpretations of '+'

2 ways of dealing with large scale systems
- oo
- operations on aggregates - "streams" eg. a signal processing engineer designing a large electrical system

another way to handle complexity - design a new language that highlights salient things and hides irrelevant detail

"meta-linguistic abstraction"

Three things about a language:
- primitive operations
- means of combination
- means of abstraction - how to make larger order primitives

lisp
definitions are just expressions

lambda - "make a procedure"

key thing about lisp - there is no arbitrary distinction between things that are primitives and things that are defined

case analyses

(DEFINE (ABS X) (COND ((< X 0) (- X)))

lisp - you can define all other constructs for it


(DEFINE (TRY GUESS X)
(IF (GOOD-ENOUGH? GUESS X)
GUESS
(TRY (IMPROVE GUESS X) X))))


recusion - go on ininitely - fix point?

summary

what we are doing is "expressing imperative knowledge"