[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Questions about (function eq)
I have several questions concerning the difference between
    (pushnew 'foo bar :test #'eq)
and
    (pushnew 'foo bar :test 'eq)
What are the semantic differences?  Is there
a difference between
    (defun xyz ()
	(flet ((eq (a b) (bar a b)))
	  (pushnew 'foo bar :test #'eq)))
and
    (defun xyz ()
	(flet ((eq (a b) (bar a b)))
	  (pushnew 'foo bar :test 'eq)))
What are the stylistic differences?
Which of the following macro definitions
is preferred?  Why?
(defmacro foo (fn)
  (if (eq fn 'eq)
      '(expansion-1 ...)
      '(expansion-2 ...)))
(defmacro foo (fn)
  (if (eq fn #'eq)
      '(expansion-1 ...)
      '(expansion-2 ...)))
(defmacro foo (fn)
  (if (or (eq fn #'eq) (eq fn 'eq))
      '(expansion-1 ...)
      '(expansion-2 ...)))
Michael Greenberg
greenberg@cs.umass.edu