Helmut Eller writes:
 > 
 > Try this:
 > 
 >   (defun compare-chars (char1 char2 ignore-case)
 >     (flet ((compare (char=)
 >           (funcall char= char1 char2)))
 >       (if ignore-case
 >        (compare #'char-equal)
 >        (compare #'char=))))
 >   
 >   (compile 'compare-chars)
 > 
 > Now
 > 
 >   (compare-chars #\a #\A t)
 > 
 > returns NIL, and not T as expected.  I'm using CMUCL-18d on Linux.
 > 
However:

(defun compare-chars (char1 char2 ignore-case)
    (flet ((compare (my-char=)
             (funcall my-char= char1 char2)))
      (if ignore-case
          (compare #'char-equal)
          (compare #'char=))))
  
  (compile 'compare-chars)

works fine.

It looks like the compiler does not like that a reserved word is
redefined and it chooses the standard one instead of the redefined one.

Reply via email to