2010年5月9日星期日

Lisp learning notes1

Although Lisp is a powerful programming language with a very simple syntax. However, the ads is always said in a tricky way. Lots of functions and marcos should be remembered if you want to use lisp. I just want to make a list of functions and marcos I have met in the book to keep me remember of all this.
Here it is:















































formatmost flexible way of output
ta shorthand for the stream *standard-output*
defunfunctions define
loadload a file of expression
compile-filecompile a lisp file
listmake a list
(list :a 1 :b 2 :c 3)property list
getfchoose element by property
defvardefine a variable
pushadd items 1st to 2nd
dolistlooping from 2nd param
~aoutput format consume one argument
~10temit spaces
~%emit one more newline to put blank line
~{ and ~}loops over that list
force-output=flush in c
read-lineread a single line of text
*query-io*global variable contain input stream
orlogical operation
y-or-n-pask for y/n
looprepeat until return called
returnend loop
ifjust "if"
notlogical operation
with-open-fileopens a file
with-standard-io-syntaxensures certain variables that affect
printoutput as a lisp readable format
setfassignment operator
readread from the stream in
evenpreturn T if argument is an even number
remove-if-nottakes a predicate and a list return list match predicate
lambdaanonymous function
equalcompare strings
mapcarmap over a list
defmarcodefine a macro
reversereverse a list
popinverse operation of push
-pcheck if the param is be passed
' or `stop evaluation expression
,start evaluated
#shorthand for get function by name
functionsyntactic sugar for #'
@splices the value
&key / &rest / &optionalvary params
funcall(funcall #'foo para1 para2)call functions
apply==funcall paras be a list

没有评论:

发表评论