unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mike Gran <spk121@yahoo.com>
Cc: 23821-done@debbugs.gnu.org
Subject: bug#23821: Misleading error for optargs
Date: Tue, 28 Feb 2017 22:03:10 +0100	[thread overview]
Message-ID: <878toqkoz5.fsf@pobox.com> (raw)
In-Reply-To: <738648054.2214015.1466571839142.JavaMail.yahoo@mail.yahoo.com> (Mike Gran's message of "Wed, 22 Jun 2016 05:03:59 +0000 (UTC)")

On Wed 22 Jun 2016 07:03, Mike Gran <spk121@yahoo.com> writes:

> The following program returns a confusing error with guile 2.0.11
>
>   (use-modules (ice-9 optargs)) 
>   (define* (func A #:key B) 
>      #t) 
>   (func 1 2)

I have now fixed this in 2.0 and master.  In master it led me to
discover a pretty serious bug.  Now what you get at run-time is:

  wingo@clucks:~/src/guile$ meta/guile /tmp/foo.scm
  ;;; note: source file /tmp/foo.scm
  ;;;       newer than compiled /home/wingo/src/guile/cache/guile/ccache/2.2-LE-8-3.9/tmp/foo.scm.go
  ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
  ;;;       or pass the --no-auto-compile argument to disable.
  ;;; compiling /tmp/foo.scm
  ;;; /tmp/foo.scm:4:4: warning: wrong number of arguments to `func'
  ;;; compiled /home/wingo/src/guile/cache/guile/ccache/2.2-LE-8-3.9/tmp/foo.scm.go
  Backtrace:
             6 (apply-smob/1 #<catch-closure 8730a0>)
  In ice-9/boot-9.scm:
      713:2  5 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
  In ice-9/eval.scm:
      619:8  4 (_ #(#(#<directory (guile-user) 8eb6c0>)))
  In ice-9/boot-9.scm:
     2346:4  3 (save-module-excursion _)
    3843:12  2 (_)
  In /tmp/foo.scm:
        4:4  1 (_)
        2:0  0 (func _ #:B _)

  /tmp/foo.scm:2:0: In procedure func:
  /tmp/foo.scm:2:0: Invalid keyword: 2

Which seems OK.

Andy





      reply	other threads:[~2017-02-28 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <738648054.2214015.1466571839142.JavaMail.yahoo.ref@mail.yahoo.com>
2016-06-22  5:03 ` bug#23821: Misleading error for optargs Mike Gran
2017-02-28 21:03   ` Andy Wingo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878toqkoz5.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=23821-done@debbugs.gnu.org \
    --cc=spk121@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).