[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mon, 5 Mar 2007 20:54:36 +0100
thanks for your hart html generation library!
i've recently started using it in a project and i really like it.
it's easy to use, and also the implementation looks nice and is
easy to understand.
and have a few notes/suggestions:
- when using the compiler, (use hart) is not enough to make the
extension available because most of the functions in
hart-support are needed at macro-expansion time.
(actually it seems only html-escape and vector-for-each* are
needed at runtime, the rest at compile-time)
i'm using (eval-when (compile load eval) (use hart)) now.
i don't know what the best solution for this is, perhaps
just to put (eval-when (compile load eval) (require 'hart-support))
or something inside hart.scm?
- i'm a little concerned about possible name-clashes because
you are using short names like parse, emit and for.
perhaps you could do something like:
(declare (export hart-parse hart-html-escape hart-vector-for-each*))
(define hart-parse parse)
use hart-parse instead of parse in hart.scm
and rename html-escape to hart-html-escape and
vector-for-each* to hart-vector-for-each*
also, i'd probably consider defining for as a function and
calling it in parse-keyword-form instead of expanding to
the (for ...) form, but then you'd have to use some other
looping construct in emit-tag. at least i'd call it e.g. hart-for
to avoid defining a name like for in an extension whose primary
purpose is not to provide looping constructs
- i'd like hart (and therefore probably parse / hart-parse) to take multiple
hart forms so i can do this:
(raw: "<!DOCTYPE html PUBLIC .....\n")
- imho a (scheme: ...) hart-form would be nice, that causes the
given scheme form to be evaluated and the result discarded,
so i can do this:
(for: (contact contacts)
(scheme: (print-contact-as-html contact))))
(define (print-contact-as-html contact)
... contact html ...))
- the documentation on
is incorrectly formatted, the <enscript> tags in the examples do not
work correctly, they seem to be outputted as-is.
i think that's all for now :)
i hope some of my suggestions sound reasonable for you. :)
- [Chicken-users] hart.egg,
Hans Bulfone <=