SE701:Screencasts:scar107:OptionalParameters: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		
m 3 revision(s)  | 
			
(No difference) 
 | 
Latest revision as of 05:27, 3 November 2008
Can be downloaded from here. Note - new and improved! Well, kinda. It's still not particularly exciting, but I made the resolution bigger so it's easier to see/read. Ooooh!
Cheatsheet:
- &optional: specifies that the following unnamed argument is optional
 
(defun do-stuff (&optional on-something))
- &key: specifies that the following argument is named
 
(defun do-stuff (&key (thing "hello")) (print thing)) (do-stuff :thing "nahhh")
- &rest: specifies that a variable number of arguments should be assigned to a list in the following argument
 
(make-list (&rest args) (for i in args do (print i)))
Choice!