Phil Hagelberg a écrit :
> >From what I can tell the difference seems to be that it goes inside the
> node if it's a string, and it replaces the node if it's a function call,
> even if the function call results in a string.
>
> This behaviour seems really strange. I feel like maybe there's some
> logic I'm missing and that it's not the string/function call difference
> that determines replacement vs insertion, but I can't figure out why
> it's behaving this way. Would appreciate any explanation
I'm not quite happy with this behavior: I wanted to preserve the brevity of
setting content from a parameter without resorting to (text my-parameter) but
it makes things too irregular.
This "feature" will certainly go away as I'm planning a redesign.
Right now there are several cases:
1/ If the right hand side of a rule is a list and expands to a
template-macro, it is applied without needing to unquote it. The matched
element is replaced by the result of the template-macro.
2/ If the right hand side of a rule is a list and does not expand to a
template-macro, it's random clojure code (which can apply
template-macros on the matched element using unquote). The matched
element is replaced.
3/ Otherwise the right hand side form is implicitly surrounded by the
'text template-macro and go to 1/ ('text replaces the content).
Phil, what's your usecase for inserting raw html, where does it come from?
Thanks,
Christophe
--
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---