e would be adding a field to the record.
The embedded make-struct calls from the expansion would result in a
record with the new number of fields, but with #f for the new fields.
This is actually a quite powerful capability. For example if we wanted
to add a field to list the names of the bound i
atches. I've manually removed the parts that
patch psyntax-pp.scm, to not hurt our eyeballs :)
>From 68673f7507736f9a39d2d1eac9ef2a9ad1fd80dc Mon Sep 17 00:00:00 2001
From: Andy Wingo
Date: Sun, 15 Jan 2012 18:39:44 +0100
Subject: [PATCH 1/3] add syntax-locally-bound-identifiers
Hi Andy,
> There's another thing that really should be fixed, for the sake of
> preserving our ability to change the implementation `local-eval' in the
> future.
>
> Since (the-environment) can be included in code compiled to disk, the
> lexical environment objects that it returns are effectively
(filter (lambda (x)
> (eq? (syntax-local-binding x)
> 'lexical))
> (syntax-locally-bound-identifiers
> #'scope
> #'(list (cons 'i
There's another thing that really should be fixed, for the sake of
preserving our ability to change the implementation `local-eval' in the
future.
Since (the-environment) can be included in code compiled to disk, the
lexical environment objects that it returns are effectively now part of
our ABI.
e)
> + (call-with-values (lambda ()
> + (analyze-identifiers
> + (syntax-locally-bound-identifiers #'scope)))
> + (lambda (capture formals wrappers patterns)
> + (define (wrap-expression x)
> + (let lp ((x
On Fri 20 Jan 2012 13:33, Andy Wingo writes:
> Here are a couple of patches.
Aaaand, the patches:
>From f549f273139bda9591194766157bb771a67d9563 Mon Sep 17 00:00:00 2001
From: Andy Wingo
Date: Sun, 15 Jan 2012 18:39:44 +0100
Subject: [PATCH 1/2] add syntax-locally-bound-identifiers
*
Hello,
Here are a couple of patches. The first implements a new helper,
syntax-locally-bound-identifiers, documented thusly:
-- Scheme Procedure: syntax-locally-bound-identifiers id
Return a list of identifiers that were visible lexically when the
identifier ID was created, in order
On Tue 17 Jan 2012 00:27, Andy Wingo writes:
> TBH I think this is the best thing we can do for local-eval. We
> preserve flexibility for local-eval, make other experiments possible,
> and the local-eval implementation is a bit more perspicacious, as the
> scoping is more lexical (in the same fi
Yes!
see attachement!
/Stefan
On Tue, Jan 17, 2012 at 12:30 AM, Andy Wingo wrote:
> On Mon 16 Jan 2012 22:56, Stefan Israelsson Tampe
> 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?
Andy Wingo writes:
> What if instead we implemented closure serialization somehow? Then we
> would handle procedural macros too, and bound-identifiers would still be
> sufficient.
>
> Maybe that idea is a little too crazy.
Are we still talking about Scheme? The language with
ca
On Mon 16 Jan 2012 22:56, Stefan Israelsson Tampe
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/
tching it a bit, but perhaps it is partially apt?)
Now, specific commentary.
> How about something like (bound-identifiers #'here)?
scheme@(guile-user)> (bound-identifiers #'here)
$5 = ()
scheme@(guile-user)> (let ((x 10)) (bound-identifiers #'here))
$6 = (#(syntax-object x ((#
On Mon 16 Jan 2012 22:28, Andy Wingo writes:
> On Mon 16 Jan 2012 20:46, Stefan Israelsson Tampe
> 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
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 expande
On Mon 16 Jan 2012 20:46, Stefan Israelsson Tampe
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
;> identifiers: they come from the code itself. They are input the macro,
>>> and as such need an anti-mark.
>>>
>>> The anti-mark will be stripped from the expansion when the transformer
>>> that called `bound-identifiers' returns.
>>
>> Does
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
identifiers, and to
>> capture some subset of them. It will do so by introducing references to
>> them in the expansion of some macro. However they are not introduced
>> identifiers: they come from the code itself. They are input the macro,
>> and as such need an anti-mark.
>&
ansion of some macro. However they are not introduced
> identifiers: they come from the code itself. They are input the macro,
> and as such need an anti-mark.
>
> The anti-mark will be stripped from the expansion when the transformer
> that called `bound-identifiers' returns.
Does this
hem. It will do so by introducing references to
them in the expansion of some macro. However they are not introduced
identifiers: they come from the code itself. They are input the macro,
and as such need an anti-mark.
The anti-mark will be stripped from the expansion when the transformer
that calle
Mark
[... skipped the first patch, which looks very well implemented, though
I'm still not sure that we should be exposing this in our API ...]
> From 2c3da44320019453115811af386febaa7eb241c3 Mon Sep 17 00:00:00 2001
> From: Andy Wingo
> Date: Sun, 15 Jan 2012 18:39:44 +0100
isplaced-lexical #f
+
(set! generate-temporaries
(lambda (ls)
(arg-check list? ls 'generate-temporaries)
--
1.7.8.3
>From 2c3da44320019453115811af386febaa7eb241c3 Mon Sep 17 00:00:00 2001
From: Andy Wingo
Date: Sun, 15 Jan 2012 18:39:44 +0100
Subject: [PA
23 matches
Mail list logo