Programming efficiently in Lisp
In the last month's article you have learned how to manipulate Lists. In this article we will learn more efficient ways of List handling. There are quite a few commands in AutoLisp that allow you to manipulate lists (subst, append, etc.).
But what about commands that will allow you to apply a function to items in a list ? Let's look at (mapcar) first.
(mapcar)
The function (mapcar) allows you to perform a "function" on each element of the list. Let's try a simple example :
What we want to do is add 1 to each element of a list.
(setq a 1)
(mapcar '1+ (list a))
Read More
Newsletter Feedback
|
|
|
|
|
|
This
offer is valid for Australia, Canada, India, Singapore,
UK and USA addresses only. |
|
|
|
|
|
|
 |
|
|
|
|
|
|
|
|
|
 |
|
|
|