unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Change of behavior for `define*'?
@ 2010-01-11  2:48 Patrick McCarty
  2010-01-11 21:08 ` Andy Wingo
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McCarty @ 2010-01-11  2:48 UTC (permalink / raw)
  To: guile-devel

Hi,

I'm trying to get LilyPond compiling with Guile git (commit 7cd554),
and I'm running into a problem that I don't see documented in NEWS.

With Guile 1.8.7, this code is valid:

  guile> (use-modules (ice-9 optargs))
  guile> (define* a 1)
  guile> a
  1

But with git, I get the following:

  scheme@(guile-user)> (define* a 1)
  Throw to key `syntax-error':
  ERROR: In procedure sc-expand:
  ERROR: source expression failed to match any pattern in (define* a 1)


Is this an intentional change of behavior in Guile, or is it a bug?

Thanks in advance,
-Patrick




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

* Re: Change of behavior for `define*'?
  2010-01-11  2:48 Change of behavior for `define*'? Patrick McCarty
@ 2010-01-11 21:08 ` Andy Wingo
  2010-01-11 22:18   ` Patrick McCarty
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2010-01-11 21:08 UTC (permalink / raw)
  To: Patrick McCarty; +Cc: guile-devel

On Mon 11 Jan 2010 03:48, Patrick McCarty <pnorcks@gmail.com> writes:

> With Guile 1.8.7, this code is valid:
>
>   guile> (use-modules (ice-9 optargs))
>   guile> (define* a 1)
>   guile> a
>   1

Interesting, I wasn't aware of this. 

> But with git, I get the following:
>
>   scheme@(guile-user)> (define* a 1)
>   Throw to key `syntax-error':
>   ERROR: In procedure sc-expand:
>   ERROR: source expression failed to match any pattern in (define* a 1)
>
>
> Is this an intentional change of behavior in Guile, or is it a bug?

Nope, just a bug, and now fixed.

Thanks for the report!

Andy
-- 
http://wingolog.org/




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

* Re: Change of behavior for `define*'?
  2010-01-11 21:08 ` Andy Wingo
@ 2010-01-11 22:18   ` Patrick McCarty
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McCarty @ 2010-01-11 22:18 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

On 2010-01-11, Andy Wingo wrote:
> On Mon 11 Jan 2010 03:48, Patrick McCarty <pnorcks@gmail.com> writes:
> 
> > With Guile 1.8.7, this code is valid:
> >
> >   guile> (use-modules (ice-9 optargs))
> >   guile> (define* a 1)
> >   guile> a
> >   1
> 
> Interesting, I wasn't aware of this. 

Thanks for the fix.

One other thing... I forgot that `define*-public' is still in (ice-9
optargs).  Guile 1.8 supports variable definitions for this construct
too:

  guile> (use-modules (ice-9 optargs))
  guile> (define*-public a 1)
  guile> a
  1

LilyPond uses (define*-public) like this occasionally, though most of
the time with procedures.

Thanks,
Patrick




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

end of thread, other threads:[~2010-01-11 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11  2:48 Change of behavior for `define*'? Patrick McCarty
2010-01-11 21:08 ` Andy Wingo
2010-01-11 22:18   ` Patrick McCarty

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).