From: Andreas Eder
Subject: gcl warning message
Date: 
Message-ID: <m3ekihar36.fsf@banff.eder.de>
Hi,

I'm getting a strange message from gcl
(GCL (GNU Common Lisp)  2.6.5 ANSI    Nov 26 2004 08:52:13)

When compiling maxima gcl produces the folling warning:

Compiling /home/are/maxima/maxima/src/commac.lisp.
End of Pass 1.  
; (DEFUN LISTIFY1) is being compiled.
;; Warning: Wrong number of args for LAST: 2 instead of 1.
End of Pass 2.  
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
Finished compiling binary-gcl/commac.o.

Why is that warning about the wrong number of args for LAST?
As far as I know last takes to argument.

I can reproduce it with a small example:

(defun test (l n) (last l n))

compiling that produces the same error message but the code seems to
work.

It all looks so strange to me.

Andreas

-- 
Wherever I lay my .emacs, there's my $HOME.
From: Artem V. Andreev
Subject: Re: gcl warning message
Date: 
Message-ID: <82734344.0411260818.7d2fae38@posting.google.com>
Andreas Eder <············@gmx.net> wrote in message news:<··············@banff.eder.de>...
> Hi,
> 
> I'm getting a strange message from gcl
> (GCL (GNU Common Lisp)  2.6.5 ANSI    Nov 26 2004 08:52:13)
> 
> When compiling maxima gcl produces the folling warning:
> 
> Compiling /home/are/maxima/maxima/src/commac.lisp.
> End of Pass 1.  
> ; (DEFUN LISTIFY1) is being compiled.
> ;; Warning: Wrong number of args for LAST: 2 instead of 1.
> End of Pass 2.  
> OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
> Finished compiling binary-gcl/commac.o.
> 
> Why is that warning about the wrong number of args for LAST?
> As far as I know last takes to argument.

This is because GCL is still not 100% ANSI compatible.
LAST had only a single argument in CLtL1; the ANSI commitee adopted the second
argument circa 1988 so that LAST be consistent with BUTLAST.

What's really strange is that LAST in GCL actually takes two arguments, so the
warning is obviously just a little bug