GNU bug report logs - #10991
syntax-local-binding does not play well with fluid-let-syntax

Previous Next

Package: guile;

Reported by: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>

Date: Sun, 11 Mar 2012 12:18:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10991 in the body.
You can then email your comments to 10991 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#10991; Package guile. (Sun, 11 Mar 2012 12:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 11 Mar 2012 12:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: syntax-local-binding does not play well with fluid-let-syntax
Date: Sun, 11 Mar 2012 12:47:22 +0100
[Message part 1 (text/plain, inline)]
loading local-stx shows that setting a macro via fluid-let-syntax does not
play well with syntax-local-binding who just sees the outside main
definition and not the newly introduced binding!
 -------------------

(use-modules (system syntax))
(use-modules (srfi srfi-11))

(eval-when (compile load eval)
  (define (%f x) (error "this macro should never be called")))

(define-syntax f %f)

(define-syntax info
  (lambda (x)
    (syntax-case x ()
      ((_ f)
       (let-values (((key ret) (syntax-local-binding #'f)))
         (pk key)
         ret)))))

;;This shows that f rebounds to yield #t but the info returns %f
(eq?
 (fluid-let-syntax ((f (lambda x #'#t)))
   (pk (f 1))
   (info f))
 %f)
[Message part 2 (text/html, inline)]
[local-stx.scm (text/x-scheme, attachment)]

Information forwarded to bug-guile <at> gnu.org:
bug#10991; Package guile. (Fri, 06 Jul 2012 12:17:02 GMT) Full text and rfc822 format available.

Message #8 received at 10991 <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
Cc: 10991 <at> debbugs.gnu.org
Subject: Re: bug#10991: syntax-local-binding does not play well with
	fluid-let-syntax
Date: Fri, 06 Jul 2012 11:25:36 +0200
Hi Stefan,

Sorry for the late reply.

On Sun 11 Mar 2012 12:47, Stefan Israelsson Tampe <stefan.itampe <at> gmail.com> writes:

> ;;This shows that f rebounds to yield #t but the info returns %f
> (eq?
>  (fluid-let-syntax ((f (lambda x #'#t)))
>    (pk (f 1))
>    (info f))
>  %f)

This is by design.  This is as in Racket, where there is a difference
between syntax-local-value and syntax-parameter-value.  In master, there
is an additional parameter to resolve-identifier,
`resolve-syntax-parameters?'.

Suggestion: if you want this, add a similar parameter to psyntax.scm in
stable-2.0, and in both branches plumb it through to a keyword argument
on syntax-local-binding.  Update the docs, too :)  You had the
beginnings of a patch on bug 10992.

Thanks!

Andy
-- 
http://wingolog.org/




Information forwarded to bug-guile <at> gnu.org:
bug#10991; Package guile. (Fri, 06 Jul 2012 19:09:01 GMT) Full text and rfc822 format available.

Message #11 received at 10991 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
To: Andy Wingo <wingo <at> pobox.com>
Cc: 10991 <at> debbugs.gnu.org
Subject: Re: bug#10991: syntax-local-binding does not play well with
	fluid-let-syntax
Date: Fri, 6 Jul 2012 21:03:42 +0200
[Message part 1 (text/plain, inline)]
Ok, I'm not using this at the moment so I can wait for master to become
guile-2.2.

I do not know yet why this complexity is needed though (I asked on the
racket channel but
could not make anything useful out of the comments) Best to leave it as you
suggest.

/Regards
Stefan

On Fri, Jul 6, 2012 at 11:25 AM, Andy Wingo <wingo <at> pobox.com> wrote:

> Hi Stefan,
>
> Sorry for the late reply.
>
> On Sun 11 Mar 2012 12:47, Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
> writes:
>
> > ;;This shows that f rebounds to yield #t but the info returns %f
> > (eq?
> >  (fluid-let-syntax ((f (lambda x #'#t)))
> >    (pk (f 1))
> >    (info f))
> >  %f)
>
> This is by design.  This is as in Racket, where there is a difference
> between syntax-local-value and syntax-parameter-value.  In master, there
> is an additional parameter to resolve-identifier,
> `resolve-syntax-parameters?'.
>
> Suggestion: if you want this, add a similar parameter to psyntax.scm in
> stable-2.0, and in both branches plumb it through to a keyword argument
> on syntax-local-binding.  Update the docs, too :)  You had the
> beginnings of a patch on bug 10992.
>
> Thanks!
>
> Andy
> --
> http://wingolog.org/
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#10991; Package guile. (Fri, 06 Jul 2012 19:44:02 GMT) Full text and rfc822 format available.

Message #14 received at 10991 <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
Cc: 10991 <at> debbugs.gnu.org
Subject: Re: bug#10991: syntax-local-binding does not play well with
	fluid-let-syntax
Date: Fri, 06 Jul 2012 21:37:57 +0200
Hi Stefan,

Thanks for looking at this.

On Fri 06 Jul 2012 21:03, Stefan Israelsson Tampe <stefan.itampe <at> gmail.com> writes:

> Ok, I'm not using this at the moment so I can wait for master to become
> guile-2.2.

Even in that case there needs to be an interface to resolve syntax
parameters or not, and master doesn't have that yet.  So this bug is
still a bug even on master.

Regards,

Andy
-- 
http://wingolog.org/




Information forwarded to bug-guile <at> gnu.org:
bug#10991; Package guile. (Fri, 06 Jul 2012 19:52:02 GMT) Full text and rfc822 format available.

Message #17 received at 10991 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
To: Andy Wingo <wingo <at> pobox.com>
Cc: 10991 <at> debbugs.gnu.org
Subject: Re: bug#10991: syntax-local-binding does not play well with
	fluid-let-syntax
Date: Fri, 6 Jul 2012 21:46:05 +0200
[Message part 1 (text/plain, inline)]
Ok, a second reading of your mail after your answer and I know what to do,
I will hack on a patch
for 2.0 and master that as you say, plumb it through, will do it after a
few weeks though!
/Stefan

On Fri, Jul 6, 2012 at 9:37 PM, Andy Wingo <wingo <at> pobox.com> wrote:

> Hi Stefan,
>
> Thanks for looking at this.
>
> On Fri 06 Jul 2012 21:03, Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
> writes:
>
> > Ok, I'm not using this at the moment so I can wait for master to become
> > guile-2.2.
>
> Even in that case there needs to be an interface to resolve syntax
> parameters or not, and master doesn't have that yet.  So this bug is
> still a bug even on master.
>
> Regards,
>
> Andy
> --
> http://wingolog.org/
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#10991; Package guile. (Sun, 23 Sep 2012 10:25:01 GMT) Full text and rfc822 format available.

Message #20 received at 10991 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
To: Andy Wingo <wingo <at> pobox.com>
Cc: 10991 <at> debbugs.gnu.org
Subject: Re: bug#10991: syntax-local-binding does not play well with
	fluid-let-syntax
Date: Sun, 23 Sep 2012 12:22:43 +0200
[Message part 1 (text/plain, inline)]
Currently master seams to work, (I checked it on wip-rtl). What's perhaps
is missing is a
simple change to local-syntax-value to add a keyword so that one can decide
if one wants
the definition value of the syntax parameter. Peronally I can't find a
reason to need this feature and
suggest that we add this if someone complains about the semantic.

With this new information personally I'm fine with closing this Bug.

/Stefan

On Fri, Jul 6, 2012 at 9:46 PM, Stefan Israelsson Tampe <
stefan.itampe <at> gmail.com> wrote:

>
> Ok, a second reading of your mail after your answer and I know what to do,
> I will hack on a patch
> for 2.0 and master that as you say, plumb it through, will do it after a
> few weeks though!
> /Stefan
>
>
> On Fri, Jul 6, 2012 at 9:37 PM, Andy Wingo <wingo <at> pobox.com> wrote:
>
>> Hi Stefan,
>>
>> Thanks for looking at this.
>>
>> On Fri 06 Jul 2012 21:03, Stefan Israelsson Tampe <
>> stefan.itampe <at> gmail.com> writes:
>>
>> > Ok, I'm not using this at the moment so I can wait for master to become
>> > guile-2.2.
>>
>> Even in that case there needs to be an interface to resolve syntax
>> parameters or not, and master doesn't have that yet.  So this bug is
>> still a bug even on master.
>>
>> Regards,
>>
>> Andy
>> --
>> http://wingolog.org/
>>
>
>
[Message part 2 (text/html, inline)]

Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Wed, 13 Mar 2013 10:46:02 GMT) Full text and rfc822 format available.

Notification sent to Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>:
bug acknowledged by developer. (Wed, 13 Mar 2013 10:46:02 GMT) Full text and rfc822 format available.

Message #25 received at 10991-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
Cc: 10991-done <at> debbugs.gnu.org
Subject: Re: bug#10991: syntax-local-binding does not play well with
	fluid-let-syntax
Date: Wed, 13 Mar 2013 11:44:36 +0100
On Sun 23 Sep 2012 12:22, Stefan Israelsson Tampe <stefan.itampe <at> gmail.com> writes:

> What's perhaps is missing is a simple change to local-syntax-value to
> add a keyword so that one can decide if one wants the definition value
> of the syntax parameter.

I have added this in master (to syntax-local-binding) and documented
it.  Closing this bug.

Andy
-- 
http://wingolog.org/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 10 Apr 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.