Why don't people like lisp?

Michael Walter cm at leetspeak.org
Wed Oct 15 19:25:33 EDT 2003


larry wrote:
> Here's a more realistic example that illustrates exactly the opposite
> point. Take the task of finding the sum of the square of a bunch of
> numbers.
> Do people really think to themselves when they do this task:
> Umm first make a variable called sum 
> then set that variable sum to zero.
> Then get the next number in the list,
> square it, 
> add it to the old value of sum, 
> store the resulting value into sum,
> then get the next variable,etc....
> 
> No they they think: sum up the square of a bunch of numbers.
> This  has an almost direct translation to the lisp style:
> (apply '+ (mapcar #'(lambda(x)(* x x)) numlist)).
Well..
   sum (map (\x -> x ** 2) [1..10])
in Haskell, or
   sum (map ((lambda x: x ** 2), range(1,11)))
in Python. But not really sure what point you're trying to make, oh well :)
> 
> 
> The reason why the imperative style of programming seems natural is
> because that's what people are used to programming in. It isn't
> necessarily the way they formulate the problem to themselves. There is
> always a translation step.
> 
> "Francis Avila" <francisgavila at yahoo.com> wrote in message 
> 
>>UD: things
>>Gxyz: x is baked at y degrees for z minutes.
>>Hx: x is a cake.
>>Ix: x is batter.
>>
>>For all x, ( (Ix & Gx(350)(45)) > Hx )
>>
>>(i.e. "Everything that's a batter and put into a 350 degree oven for 45
>>minutes is a cake")
>>
>>...instead of...
>>
>>1. Heat the oven to 350 degrees.
>>2. Place batter in oven.
>>3. Bake 45 minutes
>>4. Remove cake from oven.
>>
>>(i.e. "To make a cake, bake batter in a 350 degree oven for 45 minutes")
>>
>>...then lisp will take over the universe.  Never mind that the symbolic
>>logic version has more precision.





More information about the Python-list mailing list