Author Topic: My head hurts.. problem with a list  (Read 7074 times)

0 Members and 1 Guest are viewing this topic.

Brick_top

  • Guest
Re: My head hurts.. problem with a list
« Reply #30 on: March 02, 2011, 03:46:42 PM »
EDIT:  Wait a minute... I thought the result was meant to be as in post #5?

yeah, it is as in post #5

Nope...

Code: [Select]
_$ (mapcar '+ (cons 0 '(10 20 30 40 50)) '(10 20 30 40 50))
(10 30 50 70 90)

From your description in post#5, correct result should be:

Code: [Select]
(10 30 60 100 150)

Sorry my english tricked me I meant to say "yeah it is meant to be as in post #5"

Brick_top

  • Guest
Re: My head hurts.. problem with a list
« Reply #31 on: March 02, 2011, 03:48:56 PM »
a shortened Ron's
Code: [Select]
(mapcar '+ (cons 0 lst) lst)

Is this for real?  :-o   :-o

Don't have autocad right now

That gives the same result as my "wrong" answer ... but nonetheless cool.  :-)

Impressive anyway.. for me