Hello Racket-Users,

in trying to iterate a series of expressions and evaluating them differently on a case-by-case basis - specifically in the body of a (html-template) - Racket is throwing errors indicating that my expressions end up in the wrong places. In the code below, it appears that + is being interpreted as an HTML element name; am I messing up expansion time and run time?


#lang racket

(require (planet neil/html-template:2:2))

(define-syntax-rule (expr-iter form ...)
  (begin
    (case (car 'form)
      [(title) (display (cadr 'form))]
      [(math) (eval (cadr 'form))]
      [(html) (html-template
               (eval (cadr 'form)))]) ...))

(expr-iter (title "sometitle")
           (math (+ 1 2))
           (html (p "hello")))


Best regards,
Philipp

____________________
 Racket Users list:
 http://lists.racket-lang.org/users

Reply via email to