Defvar and setf 
Author Message
 Defvar and setf

could someone please tell me the difference between defvar, defparameter
and setf and the effects these macros have and why some are mostly used
at the top level and some are mostly used inside functions and
expresions


Mon, 13 Oct 2003 17:38:05 GMT  
 Defvar and setf

Quote:
>>>>> On Thu, 26 Apr 2001 10:38:05 +0100, samwise gamgee ("samwise") writes:

 samwise> could someone please tell me the difference between defvar, defparameter
 samwise> and setf and the effects these macros have and why some are mostly used
 samwise> at the top level and some are mostly used inside functions and
 samwise> expresions

I would recommend consulting the Hyperspec, for example at:
 <http://www.xanalys.com/software_tools/reference/HyperSpec/FrontMatter...>
There you can look up the documentation for each of those forms,
which includes an explanation of the differences between them.
I suggest looking up: DEFVAR, DEFPARAMETER, DEFCONSTANT, SETQ,
and SETF, in that order.



Mon, 13 Oct 2003 19:57:02 GMT  
 Defvar and setf

Quote:

> >>>>> On Thu, 26 Apr 2001 10:38:05 +0100, samwise gamgee ("samwise") writes:

>  samwise> could someone please tell me the difference between defvar, defparameter
>  samwise> and setf and the effects these macros have and why some are mostly used
>  samwise> at the top level and some are mostly used inside functions and
>  samwise> expresions

> I would recommend consulting the Hyperspec, for example at:
>  <http://www.xanalys.com/software_tools/reference/HyperSpec/FrontMatter...>
> There you can look up the documentation for each of those forms,
> which includes an explanation of the differences between them.
> I suggest looking up: DEFVAR, DEFPARAMETER, DEFCONSTANT, SETQ,
> and SETF, in that order.

In addition to looking these up in the spec, since all but setq are macros, macroexpand them.  You can do that in emacs, or like this:
(macroexpand '(defvar foo bar "baz"))


Mon, 13 Oct 2003 21:47:44 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Defvar and setf 2

2. Defvar, setq, setf

3. &whole, defsetf, define-setf-method, define-setf-expansions, &environment and other Lispy Questions

4. CLHS - (redefining) setf expanders and DEFINE-SETF-METHOD

5. SETF methods and SETF functions

6. What's the difference between setf, setq, defvar, defparameter, &c.?

7. DEFVAR weirdness

8. defvar and symbol error

9. defvar

10. defvar and (declaim (special

11. SETQ vs DEFVAR at the top level

12. setf of symbol-function

 

 
Powered by phpBB® Forum Software