chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #1437: csi needs double imports (was: csi needs d


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1437: csi needs double imports (was: csi needs double imports shadowed procedures)
Date: Tue, 02 Jan 2018 19:59:39 -0000

#1437: csi needs double imports
--------------------------------+---------------------------
            Reporter:  mario    |      Owner:
                Type:  defect   |     Status:  new
            Priority:  major    |  Milestone:  someday
           Component:  unknown  |    Version:  5.0
          Resolution:           |   Keywords:  double import
Estimated difficulty:           |
--------------------------------+---------------------------
Description changed by mario:

Old description:

> Here's a simple test case:
>
> {{{
> $ cat assoc.scm
> (import srfi-1)
> (define e2 '((2 3) (5 7) (11 13)))
> (assoc 5 e2 <)
>
> $ ~/local/chicken-5-head/bin/csi -s assoc.scm
>
> Error: bad argument count - received 3 but expected 2: #<procedure
> (scheme#assoc x231 lst232)>
>
>         Call history:
>
>         <syntax>          (##core#begin (##core#require expand
> chicken.syntax#))
>         <syntax>          (##core#require expand chicken.syntax#)
>         <syntax>          (##sys#load-library (##core#quote expand))
>         <syntax>          (##core#quote expand)
>         <eval>    (##sys#load-library (##core#quote library))
>         <eval>    (##sys#load-library (##core#quote library))
>         <eval>    (##sys#load-library (##core#quote expand))
>         <syntax>          (define e2 (quote ((2 3) (5 7) (11 13))))
>         <syntax>          (##core#begin (##core#ensure-toplevel-
> definition e2) (##core#set! e2 (quote ((2 3) (5 7) (11 13)))))
>         <syntax>          (##core#ensure-toplevel-definition e2)
>         <syntax>          (##core#undefined)
>         <syntax>          (##core#set! e2 (quote ((2 3) (5 7) (11 13))))
>         <syntax>          (quote ((2 3) (5 7) (11 13)))
>         <syntax>          (##core#quote ((2 3) (5 7) (11 13)))
>         <syntax>          (assoc 5 e2 <)
>         <eval>    (assoc 5 e2 <)        <--
> }}}
>
> The compiled version works ok:
>
> {{{
> $ ~/local/chicken-5-head/bin/csc assoc.scm
> In file included from assoc.c:8:
> /home/mario/local/chicken-5-head/include/chicken/chicken.h:2411:37:
> warning: expression result unused [-Wunused-value]
>     C_CHECKp(x,C_bignump(C_VAL1(x)),0);
>                                     ^
> /home/mario/local/chicken-5-head/include/chicken/chicken.h:858:37: note:
> expanded from macro 'C_CHECKp'
> # define C_CHECKp(v,a,x)           (x)
>                                     ^
> 1 warning generated.
>
> $ ./assoc
>
> $ echo $?
> 0
> }}}
>

> If I import srfi-1 twice, it works in the interpreter:
>
> {{{
> $ cat assoc.scm
> (import srfi-1)
> (import srfi-1)
> (define e2 '((2 3) (5 7) (11 13)))
> (assoc 5 e2 <)
>
> $ ~/local/chicken-5-head/bin/csi -s assoc.scm
>
> $ echo $?
> 0
> }}}
>
> I'm using
>
> {{{
> $ ~/local/chicken-5-head/bin/csi -version
> (c) 2008-2017, The CHICKEN Team
> (c) 2000-2007, Felix L. Winkelmann
> Version 5.0.0 (rev baf6363)
> linux-unix-clang-x86-64 [ 64bit dload ptables ]
> }}}
>

> I cannot reproduce this problem with 5.0.0pre4.

New description:

 Here's a simple test case:

 {{{
 $ cat assoc.scm
 (import srfi-1)
 (define e2 '((2 3) (5 7) (11 13)))
 (assoc 5 e2 <)

 $ ~/local/chicken-5-head/bin/csi -s assoc.scm

 Error: bad argument count - received 3 but expected 2: #<procedure
 (scheme#assoc x231 lst232)>

         Call history:

         <syntax>          (##core#begin (##core#require expand
 chicken.syntax#))
         <syntax>          (##core#require expand chicken.syntax#)
         <syntax>          (##sys#load-library (##core#quote expand))
         <syntax>          (##core#quote expand)
         <eval>    (##sys#load-library (##core#quote library))
         <eval>    (##sys#load-library (##core#quote library))
         <eval>    (##sys#load-library (##core#quote expand))
         <syntax>          (define e2 (quote ((2 3) (5 7) (11 13))))
         <syntax>          (##core#begin (##core#ensure-toplevel-definition
 e2) (##core#set! e2 (quote ((2 3) (5 7) (11 13)))))
         <syntax>          (##core#ensure-toplevel-definition e2)
         <syntax>          (##core#undefined)
         <syntax>          (##core#set! e2 (quote ((2 3) (5 7) (11 13))))
         <syntax>          (quote ((2 3) (5 7) (11 13)))
         <syntax>          (##core#quote ((2 3) (5 7) (11 13)))
         <syntax>          (assoc 5 e2 <)
         <eval>    (assoc 5 e2 <)        <--
 }}}

 The compiled version works ok:

 {{{
 $ ~/local/chicken-5-head/bin/csc assoc.scm
 In file included from assoc.c:8:
 /home/mario/local/chicken-5-head/include/chicken/chicken.h:2411:37:
 warning: expression result unused [-Wunused-value]
     C_CHECKp(x,C_bignump(C_VAL1(x)),0);
                                     ^
 /home/mario/local/chicken-5-head/include/chicken/chicken.h:858:37: note:
 expanded from macro 'C_CHECKp'
 # define C_CHECKp(v,a,x)           (x)
                                     ^
 1 warning generated.

 $ ./assoc

 $ echo $?
 0
 }}}


 If I import srfi-1 twice, it works in the interpreter:

 {{{
 $ cat assoc.scm
 (import srfi-1)
 (import srfi-1)
 (define e2 '((2 3) (5 7) (11 13)))
 (assoc 5 e2 <)

 $ ~/local/chicken-5-head/bin/csi -s assoc.scm

 $ echo $?
 0
 }}}

 I suspect the same problem is affecting srfi-71: https://salmonella-
 linux-x86-64.call-cc.org/master/gcc/linux/x86-64/2018/01/02/salmonella-
 report/test/srfi-71.html

 I'm using

 {{{
 $ ~/local/chicken-5-head/bin/csi -version
 (c) 2008-2017, The CHICKEN Team
 (c) 2000-2007, Felix L. Winkelmann
 Version 5.0.0 (rev baf6363)
 linux-unix-clang-x86-64 [ 64bit dload ptables ]
 }}}


 I cannot reproduce this problem with 5.0.0pre4.

--

--
Ticket URL: <https://bugs.call-cc.org/ticket/1437#comment:1>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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