bugGuile - Bugs: bug #30611, [1.8.7] (ice-9 optargs) mixes...

 
 

bug #30611: [1.8.7] (ice-9 optargs) mixes keyword and optional args

Submitted by:  Mike Gran <mike121>
Submitted on:  Sat 31 Jul 2010 04:49:35 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Wont Fix
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 06 Sep 2011 09:32:58 PM UTC, comment #3:

2.0.x behaves the same as 1.9.11, and thus differently from 1.8 in this example. The difference wasn't documented in NEWS as it should, but now it's there, so I'll just close the bug.

Ludovic Courtès <civodul>
Project Administrator
Sun 01 Aug 2010 12:12:58 PM UTC, comment #2:

Even if one were to make the argument that 1.8.7's behavior of having a key be read as an optional argument was valid, silently dropping the "3" in the (func 1 #:c 3) in the previous example is problematic.

Consider the following behavior.

$ (define* (funk #:key a) #t)
$ (funk 1 2 3)
=> #t

$ (define* (funk) #t)
$ (funk 1 2 3)
=> ABORT: wrong number of args

IMHO, the first of these two examples should also trigger a wrong-number-of-args error.

Mike Gran <mike121>
Project Member
Sun 01 Aug 2010 08:41:14 AM UTC, comment #1:

How do you know one is correct and the other is not?

If you are saying that 1.9.11's behavior is more intuitive, I agree. We probably need to document this incompatibility in the 1.9.11 NEWS, however.

Andy Wingo <wingo>
Project Administrator
Sat 31 Jul 2010 04:49:35 AM UTC, original submission:

In 1.8.7, the (ice-9 optargs) library does not correctly handle
define*'s that have both optional and keyword arguments.

Consider the following

guile> (use-modules (ice-9 optargs))
guile> (define* (func a #:optional b #:key c) (list a b c))
guile> (func 1 #:c 3)

1.8.7 returns (1 #:c #f). The correct answer is (1 #f 3)

But, this works in 1.9.11.

Mike Gran <mike121>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by civodul (Posted a comment)
  • -unavailable- added by wingo (Posted a comment)
  • -unavailable- added by mike121 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 06 Sep 2011 09:32:58 PM UTCcivodulStatusNone=>Wont Fix
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1