marting 发表于 2017-12-11 08:53:52

【电子书】直击AUTOLISP (20个精彩的范例)





This is a review of several valuable examples of AutoLISP and Visual LISP taken from the AUGI
LISP guild over the last couple of years. Since this is called The LISP Guilds Greatest Hits I
would like to present the programs and tips like the “Top Twenty” countdown, starting at #20.


#20 What is mapcar lambda and how

I decided to seek out the recognized leading expert in the world on AutoLISP for this informative
explanation of the origins of Mapcar Lambda to add to add to my presentation.

According to Bill Kramer:
MAPCAR = Multiple APplications of the CAR command.

CAR = Contents of the Address Register - an IBM 504 Assembler mnemonic.When a list was
called into the processor component of the computer, there were two registers or places to store
numbers for manipulation. One was called the "A" register, the other was the "D" register.The
creators of LISP decided to store the pointer to the data in the A register and the pointer to the
next set of pointers in the D register.Thing to remember is that the 504 had only 504 bytes of
RAM.... wow!

Now, how about LAMBDA?Ever heard the term "it's Greek to me"?In mathematical language the
Greek letters are often employed to represent unknowns or derived values.The use of Lambda, a
Greek letter, signifies an unknown.It is not the origins of the Lambda-Lambda-Lambda house in
the Revenge of the Nerds movies <grin>!
End quote.

Mapcar is a function that will perform a specific function to every member of a list. So,
(mapcar ‘strcase (list “a” “b” “c”))

would return ‘(“A” “B” “C”). Lambda is an anonymous function very similar to the defun statement
except it doesn’t have a function name. Like,
(lambda (X)(strcase X)) is similar to (defun MYFUNCT (X)(strcase X))
So using the lambda function instead of the ‘strcase shown above with X being the argument being
passed to the function. So,

(mapcar ‘(lambda (X)(strcase X)) (list “a” “b” “c”))

would return the list ‘(“A” “B” “C”) also.
Or
(mapcar ‘(lambda (X)(+ X Y)) (list 1 2 3)(list 0.5 0.5 0.5))
would return the list ‘(1.5 2.5 3.5)



**** Hidden Message *****

leon90482888 发表于 2017-12-11 09:19:44

好文章,谢谢分享

434939575 发表于 2017-12-11 09:47:22

谢谢分享!20个好多

sh_h 发表于 2017-12-11 09:55:00

向大师学习,谢谢分享!!!

cq025 发表于 2017-12-11 10:22:07

kkkkkkkkkkkkkkkkkkk

yoyoho 发表于 2017-12-11 11:13:21

感谢分享程序!!!

HLCAD 发表于 2017-12-11 11:14:04

感谢大师分享

819534890 发表于 2017-12-11 11:15:18

回复学习,谢谢分享

愤怒的菜鸟 发表于 2017-12-12 14:02:37

reading~~~

dnbcgrass 发表于 2017-12-12 21:45:30

回复学习学习{:1_12:}

sicky111 发表于 2017-12-13 00:05:44

英文版的吗?

liulisheng 发表于 2017-12-13 11:17:32

看看有什么

evayleung 发表于 2017-12-13 11:17:41

支持一下,谢谢分享。。。。。。

ngc 发表于 2017-12-13 12:20:06

看着是英文,尝试看看

langke52 发表于 2017-12-14 01:46:37

谢谢分享。
页: [1] 2 3 4 5 6
查看完整版本: 【电子书】直击AUTOLISP (20个精彩的范例)