Opened 5 years ago

Last modified 4 years ago

#1437 closed defect

csi needs double imports shadowed procedures — at Initial Version

Reported by: Mario Domenech Goulart Owned by:
Priority: major Milestone: 5.0
Component: expander Version: 5.0.0
Keywords: double import Cc:
Estimated difficulty:

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.

Change History (0)

Note: See TracTickets for help on using tickets.