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.
---(a.lisp)------------------------------------------------------------- (eval-when (:compile-toplevel) (print (list (lisp-implementation-type) (lisp-implementation-version)))) (defclass c () ((tag :initarg :tag :accessor c-tag) (children :initarg :children :accessor c-children))) (defmethod ff ((c c) tag index) (if (zerop index) (find tag (c-children c) :key (function c-tag)) (nth index (remove tag (c-children c) :key (function c-tag) :test-not (function equal))))) ------------------------------------------------------------------------ [...@mdi-development-1 localhost:10.0 |MDI| tmp]$ ecl ECL (Embeddable Common-Lisp) 10.7.1 Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level in: #<process SI:TOP-LEVEL 09912fc0>. > (compile-file "a.lisp") ;;; Loading #P"/usr/local/lib/ecl-10.7.1/cmp.fas" ;;; ;;; Compiling a.lisp. ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0 ;;; ("ECL" "10.7.1") ;;; Compiling (DEFCLASS C ...). ;;; Compiling (DEFMETHOD FF ...). ;;; Warning: ;;; in file a.lisp, position 233 ;;; at (DEFMETHOD FF ...) ;;; ! In LET/LET* bindings, the type of the form NIL is SYMBOL, not FIXNUM. ;;; End of Pass 1. ;;; Emitting code for FF. ;;; Note: ;;; Invoking external command: ;;; gcc "-I/usr/local/include/" -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -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"/usr/local/lib/" "/tmp/a.o" "-Wl,--rpath,/usr/local/lib/" -shared -lffi -lecl -lgmp -lpthread -ldl -lm ;;; ;;; Finished compiling a.lisp. ;;; #P"/tmp/a.fas" T NIL > -- __Pascal Bourguignon__ http://www.informatimago.com/ ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Ecls-list mailing list Ecls-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecls-list