> On Feb 19, 2019, at 1:28 PM, Brian Adkins <lojicdot...@gmail.com> wrote:
> 
> Oops - I spoke too soon. It appears the lexical context is unavailable to the 
> template when include-template is used in this manner. 


Ah right, one has to inject STR into the same lexical context, like so:


#lang racket
(require web-server/templates)

(define-syntax (include-template/named stx)
  (syntax-case stx ()
    [(_ NAME)
     (with-syntax ([STR (datum->syntax #'NAME (string-append 
"../views/authentication/" (symbol->string (syntax-e #'NAME)) ".html"))]) 
       #'(include-template STR))]))

(define (login request)
  (include-template/named login))

-- 
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 racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to