[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Error when compiling function with doc string, declaration
From: |
Jared Davis |
Subject: |
[Gcl-devel] Error when compiling function with doc string, declaration |
Date: |
Wed, 15 Mar 2006 12:03:31 -0600 |
User-agent: |
Mozilla Thunderbird 1.0.7 (X11/20051013) |
Hi Camm,
I am running GCL 2.6.7 CLtL1, installed via apt-get on ubuntu. If I write:
(defun foo (x)
"baz"
(declare (type integer x))
x))
Then this is accepted, and everything seems fine. For example, I can write
(documentation 'foo 'function) and "baz" is returned; similarly I can run (foo
3) and obtain 3 as expected. But if I try to compile foo, I get an error message:
Compiling gazonk6.lsp.
; (DEFUN FOO ...) is being compiled.
;;; The declaration (DECLARE (TYPE INTEGER X)) was found in a bad place.
No FASL generated.
Error: Cannot open the file NIL..
Fast links are on: do (si::use-fast-links nil) for debugging
Error signalled by LET.
Broken at LOAD. Type :H for Help.
If I switch the order of the declaration and the documentation string, the
problem goes away.
Maybe this is a bug. But, looking at the grammar for "defun" on the Common Lisp
Hyperspec, it seems like providing both documentation and declarations is
actually not allowed. How bizarre! Could this really be intentional?
For what it's worth, this error does not seem to occur on GCL 2.6.6, but does
occur on 2.7.0 ANSI.
Thanks,
Jared