unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
@ 2012-03-11 11:47 Stefan Israelsson Tampe
  2012-07-06  9:25 ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Israelsson Tampe @ 2012-03-11 11:47 UTC (permalink / raw)
  To: 10991


[-- Attachment #1.1: Type: text/plain, Size: 699 bytes --]

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)

[-- Attachment #1.2: Type: text/html, Size: 821 bytes --]

[-- Attachment #2: local-stx.scm --]
[-- Type: text/x-scheme, Size: 521 bytes --]

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


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

* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
  2012-03-11 11:47 bug#10991: syntax-local-binding does not play well with fluid-let-syntax Stefan Israelsson Tampe
@ 2012-07-06  9:25 ` Andy Wingo
  2012-07-06 19:03   ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2012-07-06  9:25 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: 10991

Hi Stefan,

Sorry for the late reply.

On Sun 11 Mar 2012 12:47, Stefan Israelsson Tampe <stefan.itampe@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/





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

* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
  2012-07-06  9:25 ` Andy Wingo
@ 2012-07-06 19:03   ` Stefan Israelsson Tampe
  2012-07-06 19:37     ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Israelsson Tampe @ 2012-07-06 19:03 UTC (permalink / raw)
  To: Andy Wingo; +Cc: 10991

[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]

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@pobox.com> wrote:

> Hi Stefan,
>
> Sorry for the late reply.
>
> On Sun 11 Mar 2012 12:47, Stefan Israelsson Tampe <stefan.itampe@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/
>

[-- Attachment #2: Type: text/html, Size: 1748 bytes --]

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

* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
  2012-07-06 19:03   ` Stefan Israelsson Tampe
@ 2012-07-06 19:37     ` Andy Wingo
  2012-07-06 19:46       ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2012-07-06 19:37 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: 10991

Hi Stefan,

Thanks for looking at this.

On Fri 06 Jul 2012 21:03, Stefan Israelsson Tampe <stefan.itampe@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/





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

* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
  2012-07-06 19:37     ` Andy Wingo
@ 2012-07-06 19:46       ` Stefan Israelsson Tampe
  2012-09-23 10:22         ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Israelsson Tampe @ 2012-07-06 19:46 UTC (permalink / raw)
  To: Andy Wingo; +Cc: 10991

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

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@pobox.com> wrote:

> Hi Stefan,
>
> Thanks for looking at this.
>
> On Fri 06 Jul 2012 21:03, Stefan Israelsson Tampe <stefan.itampe@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/
>

[-- Attachment #2: Type: text/html, Size: 1226 bytes --]

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

* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
  2012-07-06 19:46       ` Stefan Israelsson Tampe
@ 2012-09-23 10:22         ` Stefan Israelsson Tampe
  2013-03-13 10:44           ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Israelsson Tampe @ 2012-09-23 10:22 UTC (permalink / raw)
  To: Andy Wingo; +Cc: 10991

[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]

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@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@pobox.com> wrote:
>
>> Hi Stefan,
>>
>> Thanks for looking at this.
>>
>> On Fri 06 Jul 2012 21:03, Stefan Israelsson Tampe <
>> stefan.itampe@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/
>>
>
>

[-- Attachment #2: Type: text/html, Size: 2132 bytes --]

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

* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
  2012-09-23 10:22         ` Stefan Israelsson Tampe
@ 2013-03-13 10:44           ` Andy Wingo
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2013-03-13 10:44 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: 10991-done

On Sun 23 Sep 2012 12:22, Stefan Israelsson Tampe <stefan.itampe@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/





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

end of thread, other threads:[~2013-03-13 10:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-11 11:47 bug#10991: syntax-local-binding does not play well with fluid-let-syntax Stefan Israelsson Tampe
2012-07-06  9:25 ` Andy Wingo
2012-07-06 19:03   ` Stefan Israelsson Tampe
2012-07-06 19:37     ` Andy Wingo
2012-07-06 19:46       ` Stefan Israelsson Tampe
2012-09-23 10:22         ` Stefan Israelsson Tampe
2013-03-13 10:44           ` Andy Wingo

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