[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #571: merging rest-parameter in combination with
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #571: merging rest-parameter in combination with inlining fails |
Date: |
Sun, 01 May 2011 00:11:52 -0000 |
#571: merging rest-parameter in combination with inlining fails
-----------------------+----------------------------------------------------
Reporter: felix | Owner: felix
Type: defect | Status: new
Priority: critical | Milestone: 4.7.0
Component: compiler | Version: 4.6.x
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Description changed by felix:
Old description:
> The following code causes a compile-time error. Somehow the calls to
> `fail` are incorrectly modified for rest-parameter merging. The output
> should be "UNBOUND VARIABLE: (foo)", but it is "UNBOUND VARIABLE: foo".
> This happens with "-O1 -inline".
>
> (define (lisp-eval x a bt)
> (fail bt "UNBOUND VARIABLE" x))
>
> (define (lisp-apply fun args a bt)
> (let ((hd (car fun)))
> (case hd
> ((label)
> (if (= (length fun) 3)
> (let ((fo (caddr fun)))
> (lisp-apply fo args (cons (cons (cadr fun) fo) a) bt))
> (fail bt "INVALID LABEL FORM" fun)))
> (else (lisp-apply (lisp-eval fun a bt) args a bt)))))
>
> (define (error-hook bt msg args)
> (error msg args))
>
> (define (fail bt msg . args)
> (error-hook bt msg args))
>
> (lisp-eval 'foo '() '())
New description:
The following code causes a compile-time error. Somehow the calls to
`fail` are incorrectly modified for rest-parameter merging. The output
should be "UNBOUND VARIABLE: (foo)", but it is "UNBOUND VARIABLE: foo".
This happens with "-O1 -inline".
{{{
(define (lisp-eval x a bt)
(fail bt "UNBOUND VARIABLE" x))
(define (lisp-apply fun args a bt)
(let ((hd (car fun)))
(case hd
((label)
(if (= (length fun) 3)
(let ((fo (caddr fun)))
(lisp-apply fo args (cons (cons (cadr fun) fo) a) bt))
(fail bt "INVALID LABEL FORM" fun)))
(else (lisp-apply (lisp-eval fun a bt) args a bt)))))
(define (error-hook bt msg args)
(error msg args))
(define (fail bt msg . args)
(error-hook bt msg args))
(lisp-eval 'foo '() '())
}}}
--
--
Ticket URL: <http://bugs.call-cc.org/ticket/571#comment:1>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.