Matthew Mondor <mm_li...@pulsar-zone.net> writes: > "Any function may be considered by an implementation to be a a compiled > function if it contains no references to macros that must be expanded > at run time, and it contains no unresolved references to load time > values. See Section 3.2.2 (Compilation Semantics). > > Functions whose definitions appear lexically within a file that has > been compiled with compile-file and then loaded with load are of type > compiled-function. Functions produced by the compile function are of > type compiled-function. Other functions might also be of type > compiled-function." > > As I understand it, it is allowed for CL implementations to compile > immediately, and ECL immediately compiles to bytecode, which can be > interpreted. As you know, the second level of compilation ECL supports > is via C translation compiled with a C compiler, which is optional. > But even in the first level bytecode compilation, all macros have > previously been expanded, etc. > > I'm note sure, but CLisp seems to also do bytecode compilation > immediately, but keeping functions under the type FUNCTION, with > COMPILE being a noop that makes it of type COMPILED-FUNCTION. In which > case, it behaves like you expect in relation to COMPILED-FUNCTION-P.
clisp has a true interpreter, and it will macroexpand several times the same macro. clisp has a byte-code compiler, and a virtual machine. On the other hand, ECL indeed byte-compiles the functions automatically. > (require :cmp) :cmp > (defun f (x) (if (zerop x) 1 (* x (f (1- x))))) F > (function f) #<bytecompiled-function F> > (compile 'f) ;;; Loading #P"/data/languages/ecl/lib/ecl-12.2.1/cmp.fas" ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0 ;;; ;;; End of Pass 1. F NIL NIL > (function f) #<compiled-function F> -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Ecls-list mailing list Ecls-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecls-list