> Ah ha! So that's where my mental model is diverging from reality.
> Thank you. For some reason, I had been thinking that the
> transformer-time expression in the syntax-parameterize was somehow
> impervious to the lexical enrichment process.
Here's the first draft of a small tutorial on the p
>
> At the time 'def' is expanded, the lexical context of 'function-stx' does
> not include the bindings of 'args'. But then the macro produces an
> expression with that term inside a 'quote-syntax' form that is inside the
> scope of the 'args'. So by the time the expander gets to the 'quote-syntax
On 04/06/2012 12:47 PM, Danny Yoo wrote:
I suspect that I should be using quote-syntax at this specific point,
but I am not completely sure.
Right. Try replacing ??? with (quote-syntax #,a-placeholder).
I have to admit that I'm still confused. Here's my example:
;;;
> (define-syntax (def stx)
> (syntax-case stx ()
> [(_ (name args ...) body ...)
> (with-syntax ([function-stx stx])
> (syntax/loc stx
> (define (name args ...)
> (splicing-syntax-parameterize ([current-def
> (quote-syntax fuunctio
On Fri, Apr 6, 2012 at 4:13 PM, Michael W wrote:
> This seems to work for me, printing 84, just like you expect:
>
> ;
>
> (define-syntax (def stx)
> (syntax-case stx ()
> [(_ (name args ...) body ...)
> (with-syntax ([function-
This seems to work for me, printing 84, just like you expect:
;
(define-syntax (def stx)
(syntax-case stx ()
[(_ (name args ...) body ...)
(with-syntax ([function-stx stx])
(syntax/loc stx
(define (name args ...
>> I suspect that I should be using quote-syntax at this specific point,
>> but I am not completely sure.
>
> Right. Try replacing ??? with (quote-syntax #,a-placeholder).
I have to admit that I'm still confused. Here's my example:
;;;
On 04/05/2012 08:31 PM, Danny Yoo wrote:
If that doesn't seem clear, can you explain more your line of reasoning
that they should be the same?
I guess I'm having a hard time with this: I want to get the value of
a-placeholder into the place marked ??? in the following:
;;;
> If that doesn't seem clear, can you explain more your line of reasoning
> that they should be the same?
I guess I'm having a hard time with this: I want to get the value of
a-placeholder into the place marked ??? in the following:
;;;
At Thu, 05 Apr 2012 17:34:54 -0600, Michael W wrote:
> Hey wow, maybe I might understand this. Or maybe I might be
> totally wrong. Here's a guess:
>
> In the first version, the (splicing-syntax-parameterize) takes
> effect *when f is defined*; [...]
>
> But in the second version, the splicing-sy
Hey wow, maybe I might understand this. Or maybe I might be
totally wrong. Here's a guess:
In the first version, the (splicing-syntax-parameterize) takes
effect *when f is defined*; then, after the definition, the
parameter is reset to #f (and presumably it's lexical binding)
because it's a parame
I'm hitting some behavior I don't understand: here's code to demonstrate:
;;
#lang racket
(require racket/stxparam racket/splicing)
(define-syntax-parameter current-def #f)
(define-syntax (def stx)
(syntax-case stx ()
12 matches
Mail list logo