chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Keyword parameters bug?


From: fulvio ciriaco
Subject: Re: [Chicken-users] Keyword parameters bug?
Date: Wed, 15 Apr 2009 20:03:18 +0200 (CEST)

Hi,
until they fix it you can
(define (test #!key (some-arg #f) (string #f)) (list some-arg string))
Fulvio

From: Alonso Andres <address@hidden>
Subject: Re: [Chicken-users] Keyword parameters bug?
Date: Wed, 15 Apr 2009 11:27:19 -0300

> On Wed, Apr 15, 2009 at 3:12 AM, felix winkelmann <address@hidden> wrote:
>>
>> I can not reproduce this. Are you using the svn trunk or the 4.0.0 tarball?
>>
> 
> Hi Felix. Yes, the 4.0.0 tarball: Version 4.0.0 - SVN rev. 13887
> 
> It turns out that what was causing this problem was the readline egg
> that I ported to Chicken 4. When I removed it from my .csirc it worked
> fine.
> 
> I tried to find what was causing this problem in the readline egg, and
> it seems it has something to do with the "(import scheme)" inside the
> module. Maybe it's not properly ported/compiled, since other modules
> using "(import scheme)" don't trigger this problem when using keywords
> inside procedures. I'd like to see an official port of readline into
> Chicken 4 by the way.
> 
> I could reproduce this problem after using "(import scheme)" that way:
> 
> ----------[$ csi]
> 
> CHICKEN
> (c)2008-2009 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 4.0.0 - SVN rev. 13887
> linux-unix-gnu-x86 [ manyargs dload ptables applyhook ]
> compiled 2009-04-07 on ubuntu (Linux)
> 
> ; loading /home/alonso/.csirc ...
> #;1> (define (test-proc #!key some-arg string) (display some-arg)
> (newline) (display string) (newline))
> #;2> (test-proc some-arg: "X" string: "Y")
> X
> Y
> #;3> (import scheme)
> ; loading /usr/local/lib/chicken/4/scheme.import.so ...
> #;4> (define (test-proc #!key some-arg string) (display some-arg)
> (newline) (display string) (newline))
> #;5> (test-proc some-arg: "X" string: "Y")
> X
> #<procedure (string . chars1001)>
> #;6>
> ----------
> 
> It seems that after the import, the keyword parameters don't work
> correctly anymore.
> 
> Another example using modules:
> 
> ----------[$ csi]
> 
> CHICKEN
> (c)2008-2009 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 4.0.0 - SVN rev. 13887
> linux-unix-gnu-x86 [ manyargs dload ptables applyhook ]
> compiled 2009-04-07 on ubuntu (Linux)
> 
> ; loading /home/alonso/.csirc ...
> #;1> (module some-module * (import scheme chicken) (define (test-proc
> #!key some-arg string) (display some-arg) (newline) (display string)
> (newline)))
> ; loading /usr/local/lib/chicken/4/scheme.import.so ...
> ; loading /usr/local/lib/chicken/4/chicken.import.so ...
> #;2> (import some-module)
> #;3> (test-proc some-arg: "X" string: "Y")
> X
> #<procedure (string . chars1001)>
> #;4>
> ----------
> 
> Note: now my .csirc is empty (actually every line is commented out to
> be more precise), so the line "; loading /home/alonso/.csirc ..."
> shouldn't have any effect while using csi.
> 
> Thanks,
> 
>                 Alonso
> 
> 
> _______________________________________________
> Chicken-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/chicken-users




reply via email to

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