* bound identifiers
@ 2012-01-16 19:46 Stefan Israelsson Tampe
2012-01-16 21:28 ` Andy Wingo
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Israelsson Tampe @ 2012-01-16 19:46 UTC (permalink / raw)
To: guile-devel
[-- Attachment #1: Type: text/plain, Size: 323 bytes --]
why are these two not equal in the sense of bound-identifier=?
#(syntax-object x ((top) #(ribcage () () ()) #(ribcage () () ()) #(ribcage
#(x) #((m1104 top)) #("i1105"))) (hygiene guile-user))
#(syntax-object x ((#f top) shift #(ribcage () () ()) #(ribcage #(x)
#((m1104 top)) #("i1105"))) (hygiene guile-user)))
/Stefan
[-- Attachment #2: Type: text/html, Size: 365 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bound identifiers
2012-01-16 19:46 bound identifiers Stefan Israelsson Tampe
@ 2012-01-16 21:28 ` Andy Wingo
2012-01-16 21:56 ` Stefan Israelsson Tampe
2012-01-16 22:01 ` Andy Wingo
0 siblings, 2 replies; 6+ messages in thread
From: Andy Wingo @ 2012-01-16 21:28 UTC (permalink / raw)
To: Stefan Israelsson Tampe; +Cc: guile-devel
On Mon 16 Jan 2012 20:46, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
> why are these two not equal in the sense of bound-identifier=?
>
> #(syntax-object x ((top) #(ribcage () () ()) #(ribcage () () ()) #(ribcage #(x) #((m1104 top)) #("i1105"))) (hygiene guile-user))
> #(syntax-object x ((#f top) shift #(ribcage () () ()) #(ribcage #(x) #((m1104 top)) #("i1105"))) (hygiene guile-user)))
One has been anti-marked and the other has not? Meaning that one was
made up by your syntax expander, and the other and the other came in as
part of the form.
But that's not the right question or answer. Can you should where these
identifiers come from?
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bound identifiers
2012-01-16 21:28 ` Andy Wingo
@ 2012-01-16 21:56 ` Stefan Israelsson Tampe
2012-01-16 23:30 ` Andy Wingo
2012-01-16 22:01 ` Andy Wingo
1 sibling, 1 reply; 6+ messages in thread
From: Stefan Israelsson Tampe @ 2012-01-16 21:56 UTC (permalink / raw)
To: Andy Wingo; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]
In syntax parse the racket code stores syntax values inside structs and
then transport them
down the macro chain as argument to macros. Then when unpacking the struct
they are compared
with arguments of syntax values. I think that this is the reason. I tried
to experiment with
psyntax macro expander to poke inside structs and that solved this issue.
But on the other hand
even worse problem appeared.
What I did now was to manually clean the syntax values e.g. remove #f and
shift from the
syntax value and this gave the best result.
As you see, it's just wild west to get the racket code working.
Mayby just writing a version from scratch would be better.
/Stefan
On Mon, Jan 16, 2012 at 10:28 PM, Andy Wingo <wingo@pobox.com> wrote:
> On Mon 16 Jan 2012 20:46, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > why are these two not equal in the sense of bound-identifier=?
> >
> > #(syntax-object x ((top) #(ribcage () () ()) #(ribcage () () ())
> #(ribcage #(x) #((m1104 top)) #("i1105"))) (hygiene guile-user))
> > #(syntax-object x ((#f top) shift #(ribcage () () ()) #(ribcage #(x)
> #((m1104 top)) #("i1105"))) (hygiene guile-user)))
>
> One has been anti-marked and the other has not? Meaning that one was
> made up by your syntax expander, and the other and the other came in as
> part of the form.
>
> But that's not the right question or answer. Can you should where these
> identifiers come from?
>
> Andy
> --
> http://wingolog.org/
>
[-- Attachment #2: Type: text/html, Size: 2043 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bound identifiers
2012-01-16 21:28 ` Andy Wingo
2012-01-16 21:56 ` Stefan Israelsson Tampe
@ 2012-01-16 22:01 ` Andy Wingo
1 sibling, 0 replies; 6+ messages in thread
From: Andy Wingo @ 2012-01-16 22:01 UTC (permalink / raw)
To: Stefan Israelsson Tampe; +Cc: guile-devel
On Mon 16 Jan 2012 22:28, Andy Wingo <wingo@pobox.com> writes:
> On Mon 16 Jan 2012 20:46, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
>
>> why are these two not equal in the sense of bound-identifier=?
>>
> But that's not the right question or answer. Can you should where these
> identifiers come from?
Sorry, I've been making lots of typos recently. I meant to say, "can
you show where these identifiers come from?"
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bound identifiers
2012-01-16 21:56 ` Stefan Israelsson Tampe
@ 2012-01-16 23:30 ` Andy Wingo
2012-01-17 15:33 ` Stefan Israelsson Tampe
0 siblings, 1 reply; 6+ messages in thread
From: Andy Wingo @ 2012-01-16 23:30 UTC (permalink / raw)
To: Stefan Israelsson Tampe; +Cc: guile-devel
On Mon 16 Jan 2012 22:56, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:
> As you see, it's just wild west to get the racket code working.
:)
Can you give a stripped-down test case for this particular behavior?
That code is paged into my and Mark's minds right now :)
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: bound identifiers
2012-01-16 23:30 ` Andy Wingo
@ 2012-01-17 15:33 ` Stefan Israelsson Tampe
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Israelsson Tampe @ 2012-01-17 15:33 UTC (permalink / raw)
To: Andy Wingo; +Cc: guile-devel
[-- Attachment #1.1: Type: text/plain, Size: 442 bytes --]
Yes!
see attachement!
/Stefan
On Tue, Jan 17, 2012 at 12:30 AM, Andy Wingo <wingo@pobox.com> wrote:
> On Mon 16 Jan 2012 22:56, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > As you see, it's just wild west to get the racket code working.
>
> :)
>
> Can you give a stripped-down test case for this particular behavior?
>
> That code is paged into my and Mark's minds right now :)
>
> Andy
> --
> http://wingolog.org/
>
[-- Attachment #1.2: Type: text/html, Size: 914 bytes --]
[-- Attachment #2: bound-id.scm --]
[-- Type: text/x-scheme, Size: 413 bytes --]
(use-modules (srfi srfi-9))
(define-record-type data
(make-data stx)
data?
(stx data-stx))
(define-syntax b
(lambda (x)
(syntax-case x ()
((_ s)
(with-syntax ((d (datum->syntax #'#f (make-data #'s))))
#'(c #'s #'d))))))
(define (c s d)
(let ((d (data-stx (syntax->datum d))))
(pk s)
(pk d)
(bound-identifier=? s d)))
(eval '(let ((t 1)) (b t)) (current-module))
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-01-17 15:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16 19:46 bound identifiers Stefan Israelsson Tampe
2012-01-16 21:28 ` Andy Wingo
2012-01-16 21:56 ` Stefan Israelsson Tampe
2012-01-16 23:30 ` Andy Wingo
2012-01-17 15:33 ` Stefan Israelsson Tampe
2012-01-16 22:01 ` 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).