gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: bug in defmacro's processing of &whole in subterms


From: Camm Maguire
Subject: [Gcl-devel] Re: bug in defmacro's processing of &whole in subterms
Date: 21 Oct 2005 23:00:36 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and thanks!  This should be fixed now.  Still have 4
failures in ansi-tests/defmacro.lsp relating to some lexical
environment variable capture at defmacro eval time that GCL is not
currently doing.  If you run across any clarification here, I'd be
interested. 

Take care,

Robert Boyer <address@hidden> writes:

> The transcript below illustrates a bug in defmacro's treatment of &whole.
> 
> Allegro, SBCL, ABCL, and Clisp do not cause an error here.  It's as though in
> GCL the &whole eats an arg when it should not.  By the way, I suspect that
> fixing this error will eliminate two discrepancies between what GCL does and
> what the ANSI doc says; see even further below on this.
> 
> Bob
> 
> -------------------------------------------------------------------------------
> transcript
> 
> % g
> GCL (GNU Common Lisp)  2.7.0 ANSI    Oct 19 2005 15:38:42
> Source License: LGPL(gcl,gmp), GPL(unexec,bfd)
> Binary License:  GPL due to GPL'ed components: (BFD UNEXEC)
> Modifications of this banner must retain notice of a compatible license
> Dedicated to the memory of W. Schelter
> 
> Use (help) to get some basic information on how to use GCL.
> 
> >(defmacro foo ((&whole a b)) 3)
> 
> FOO
> 
> >(foo (1))
> 
> Error in IF [or a callee]: Too few arguments are supplied to 
> defmacro-lambda-list.
> 
> Fast links are on: do (si::use-fast-links nil) for debugging
> Broken at SYSTEM::DM-TOO-FEW-ARGUMENTS.  Type :H for Help.
>  1 (Continue) Return to top level.
> dbl:>>% 
> 
> 
> -------------------------------------------------------------------------------
> 
> >From the ANSI doc.
> 
>  (defmacro dm2b (&whole form a (&whole b (c . d) &optional (e 5))
>                  &body f &environment env)
>    ``(,',form ,,a ,',b ,',(macroexpand c env) ,',d ,',e ,',f))
>  ;Note that because backquote is involved, implementations may differ
>  ;slightly in the nature (though not the functionality) of the expansion.
>  (macroexpand '(dm2b x1 (((incf x2) x3 x4)) x5 x6))
> 
>  Here GCL causes the error:
> 
>   Error in IF [or a callee]: Too few arguments are supplied to
>   defmacro-lambda-list.
> 
>  => (LIST* '(DM2B X1 (((INCF X2) X3 X4))
>                    X5 X6)
>             X1
>             '((((INCF X2) X3 X4)) (SETQ X2 (+ X2 1)) (X3 X4) 5 (X5 X6))),
>      T
>  (let ((x1 5))
>    (macrolet ((segundo (x) `(cadr ,x)))
>      (dm2b x1 (((segundo x2) x3 x4)) x5 x6)))
> 
>  Here GCL causes the error:
> 
>   Error in IF [or a callee]: Too few arguments are supplied to
>   defmacro-lambda-list.
> 
>  => ((DM2B X1 (((SEGUNDO X2) X3 X4)) X5 X6)
>       5 (((SEGUNDO X2) X3 X4)) (CADR X2) (X3 X4) 5 (X5 X6))
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]