next up previous contents
Next: Loop Up: Improvements in Common Previous: Errors

Miscellaneous Features

The step  function has been replaced by a new implementation. Details are given in Appendix A.

The standard function function-lambda-expression  replaces get-lambda-expression .

A very rudimentary describe  functions is available; it will be improved in the future.

A byte code compiler for XLISP is included in Release 3. For code that spend much time in tight loops, the compiler can lead to significant speed improvements.

The interface to the compiler is through two functions, compile  and compile-file . Suppose f is defined as

(defun f (x) (+ x 1))
Then
> #'f
#<Closure-F: #c6741c>
> (compile 'f)
F
> #'f
#<Byte-Code-Closure: #c73644>

compile  can also be used to compile a lambda expression:

> (compile nil '(lambda (x) (+ x 1)))
#<Byte-Code-Closure: #d77350>

The function compile-file  takes a file name string as its required argument. If the file has no extension, a .lsp extension is added. It compiles the file into a file with a .fsl extension. When load  is given a string "fred" as its argument, it first looks for "fred.fsl" and then for "fred.lsp". If both are present, the .fsl files is used if it is newer than the .lsp file; otherwise the .lsp file is used.

Currently the compiler ignores all declarations, including special declarations, and all proclamations other than special ones. Future versions will use inline and optimize declarations to choose among code generation strategies.

The .fsl files produced by the compiler contain ordinary lisp expressions that are read in by the reader. Constants are printed out with *print-circle*  and *print-readably*  turned on. This should be sufficient, but if things get confused by a lot of messing with packages, it may help to also turn on *print-symbol-package* . This can be done by supplying the :print-symbol-package  keyword argument to compile-file  with a non- nil value.

The function compiled-function-p  returns true for internal compiled functions ( SUBR's) or byte compiled functions.

The compiler is based on CPS conversion (see, for example, Friedman, Wand and Haynes [3]). The design is based on the ORBIT compiler as described in Krantz et al. [4] and on Brooks, Gabriel and Steele [2].

At this point the compiler does not do anything special for vectorized arithmetic or anything else statistical. In the future I will explore adding optimizations designed to deal with problems specific to statistical usage. The basic design should make this reasonably easy.


next up previous contents
Next: Loop Up: Improvements in Common Previous: Errors



Luke Tierney
Wed Feb 26 05:25:18 CST 1997