473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

the perens in lisp dilects is there for a reson... macros.

macros are sort of like c macros but more powerful. they are the
manafestation of treating code like data. lisp code is just a textual
representation of a data structure that is the list. this means that
you can manipulate code to emulate structured controll constructs and
elemanate boilerplate code. to show you the power of a macro heer is a
while loop

<code>
(defmacro while (test &body body)
`(do ()
((not ,test))
,@body)
</code>

Another one would be untill

<code>
(defmacro untill (test &body body)
`(while (not ,test) ,@body))
</code>

wich is defined on top of while

another test to wead out programers would be lisp stile macros because
of variable capture
and other perls of the macro world. but higenic macros can not have the
power of true macros

i also hear you talk about introspection. in lisp you use eval list

lets define a sum function to show you

<code>
(defun sum (lst)
(eval (append '(+) lst)))
</code>

another example would be this

<code>
(loop (print (eval (read))))
</code>
this is an interactive top level in 1 line

another use is for calling of functions

<code>
(defvar cmds `('foo ,(lambda () (format t "hello world")))
(funcall (getf cmds (read-from-string (read-line))))
</code>
of corse no error checking for comas and other things that could crash
the program

Aug 5 '06 #1
1 1298

<at*******@aol.comwrote in message

I presume you accidentally misdirected this to the wrong newsgroup.
Otherwise, it would be off-topic spam. In any case, you should learn how
to spell or use a spell-checker.

Aug 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
16
by: mike420 | last post by:
Tayss wrote: > > app = wxPySimpleApp() > frame = MainWindow(None, -1, "A window") > frame.Show(True) > app.MainLoop() > Why do you need a macro for that? Why don't you just write
37
by: seberino | last post by:
I've been reading the beloved Paul Graham's "Hackers and Painters". He claims he developed a web app at light speed using Lisp and lots of macros. It got me curious if Lisp is inherently faster...
852
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.