[Ecls-list] Strange warning in method.

Pascal J. Bourguignon pjb at informatimago.com
Mon Aug 9 13:57:18 UTC 2010


Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> writes:

> On Sun, Aug 1, 2010 at 4:24 PM, Pascal J. Bourguignon
> <pjb at informatimago.com> wrote:
>> I guess if the optimizer determines that a variable is of a given
>> type, it should also initialize with a value valid for that type.
>
> No, this is the resposability of the programmer.  (LET (A)) is
> equivalent to (LET ((A NIL))) not just in the rethorical sense of
> "equivalence" but in the sense of direct translation from one to the
> other.
>
> In this case the problem may well be that the macroexpansion of FIND
> or NTH is not correct.

You're right, the problem is with FIND (notice that FIND is a
function, so that would be in the open-coding of FIND, not a
macro-expansion):

---(a.lisp)-------------------------------------------------------------
(defun f (tag list)
  (find tag list))
------------------------------------------------------------------------


> (compile-file "/tmp/a.lisp")

;;;
;;; Compiling /tmp/a.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; Compiling (DEFUN F ...).
;;; Warning:
;;;   in file a.lisp, position 0
;;;   at (DEFUN F ...)
;;;   ! In LET/LET* bindings, the type of the form NIL is SYMBOL, not FIXNUM.
;;; End of Pass 1.
;;; Emitting code for F.
;;; Note:
;;;   Invoking external command:
;;;   gcc "-I/home/pjb/opt/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib64/libffi-3.0.9/include/ -fPIC  -D_THREAD_SAFE -Dlinux -O2 -w -c "/tmp/a.c" -o "/tmp/a.o"
;;; 
;;; Note:
;;;   Invoking external command:
;;;   gcc -o "/tmp/a.fas" -L"/home/pjb/opt/lib/" "/tmp/a.o"  "-Wl,--rpath,/home/pjb/opt/lib/" -shared    -lffi -lecl  -lgmp -lgc -lpthread -ldl  -lm 
;;; 
;;; Finished compiling /tmp/a.lisp.
;;;
#P"/tmp/a.fas"
T
NIL
> 

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/





More information about the ecl-devel mailing list