On Tuesday, February 19, 2019 at 4:03:02 PM UTC-5, Brian Adkins wrote:
>
> On Tuesday, February 19, 2019 at 1:45:43 PM UTC-5, Matthew Butterick wrote:
>>
>>
>> On Feb 19, 2019, at 8:25 AM, Brian Adkins <[email protected]> wrote:
>>
>> But, I'm guessing that the include-template macro is unable to consume 
>> the output of my view macro. Is there anything I can do to get (view login) 
>> to be expanded prior to when include-template needs it?
>>
>>
>> Wrap `include-template` with your own macro that generates the string you 
>> want?
>>
>> #lang racket
>> (require web-server/templates)
>>
>> (define-syntax (include-template/named stx)
>>   (syntax-case stx ()
>>     [(_ NAME)
>>      (with-syntax ([STR (string-append "../views/authentication/" 
>> (symbol->string (syntax-e #'NAME)) ".html")]) 
>>        #'(include-template STR))]))
>>
>> (define (login request)
>>   (include-template/named login))
>>
>>
> That's perfect Matthew - thanks! 
>

Oops - I spoke too soon. It appears the lexical context is unavailable to 
the template when include-template is used in this manner. 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to