unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #30611] [1.8.7] (ice-9 optargs) mixes keyword and optional args
@ 2010-07-31  4:49 Mike Gran
  2010-08-01  8:41 ` Andy Wingo
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Gran @ 2010-07-31  4:49 UTC (permalink / raw)
  To: Mike Gran, bug-guile


URL:
  <http://savannah.gnu.org/bugs/?30611>

                 Summary: [1.8.7] (ice-9 optargs) mixes keyword and optional
args
                 Project: Guile
            Submitted by: mike121
            Submitted on: Sat 31 Jul 2010 04:49:35 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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.






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30611>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug #30611] [1.8.7] (ice-9 optargs) mixes keyword and optional args
  2010-07-31  4:49 [bug #30611] [1.8.7] (ice-9 optargs) mixes keyword and optional args Mike Gran
@ 2010-08-01  8:41 ` Andy Wingo
  2010-08-01 12:12   ` Mike Gran
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Wingo @ 2010-08-01  8:41 UTC (permalink / raw)
  To: Andy Wingo, Mike Gran, bug-guile


Follow-up Comment #1, bug #30611 (project guile):

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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30611>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug #30611] [1.8.7] (ice-9 optargs) mixes keyword and optional args
  2010-08-01  8:41 ` Andy Wingo
@ 2010-08-01 12:12   ` Mike Gran
  2011-09-06 21:32     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Gran @ 2010-08-01 12:12 UTC (permalink / raw)
  To: Andy Wingo, Mike Gran, bug-guile


Follow-up Comment #2, bug #30611 (project guile):

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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30611>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug #30611] [1.8.7] (ice-9 optargs) mixes keyword and optional args
  2010-08-01 12:12   ` Mike Gran
@ 2011-09-06 21:32     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2011-09-06 21:32 UTC (permalink / raw)
  To: Ludovic Courtès, Andy Wingo, Mike Gran, bug-guile

Update of bug #30611 (project guile):

                  Status:                    None => Wont Fix               
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up 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.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?30611>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-06 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-31  4:49 [bug #30611] [1.8.7] (ice-9 optargs) mixes keyword and optional args Mike Gran
2010-08-01  8:41 ` Andy Wingo
2010-08-01 12:12   ` Mike Gran
2011-09-06 21:32     ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).