On Sat, Dec 17, 2011 at 11:08 AM, Baishampayan Ghose wrote:
>> This may sound a bit weird, but can I "unquote-splice" something when
>> calling a macro. Here's an attempt to do this with hiccup:
>>
>> (defn get-header
>> [[:link {:type "text/css" ...}]
>> [:script {:type "text/javascript" ...
On Sat, Dec 17, 2011 at 06:06:50AM -0800, Razvan Rotaru wrote:
> Hi,
>
> This may sound a bit weird, but can I "unquote-splice" something when
> calling a macro. Here's an attempt to do this with hiccup:
>
> (defn get-header
>[[:link {:type "text/css" ...}]
> [:script {:type "text/javascr
I just found out that it also works like this:
(defn get-header
(list [:link {:type "text/css" ...}]
[:script {:type "text/javascript" ...}]])
(html [:head (get-header) ...] [:body ...])
They key here is not to return a vector. If the html macro encounters
another kind of sequence, it
Great. Thanks.
On Dec 17, 6:08 pm, Baishampayan Ghose wrote:
> > This may sound a bit weird, but can I "unquote-splice" something when
> > calling a macro. Here's an attempt to do this with hiccup:
>
> > (defn get-header
> > [[:link {:type "text/css" ...}]
> > [:script {:type "text/javascrip
> This may sound a bit weird, but can I "unquote-splice" something when
> calling a macro. Here's an attempt to do this with hiccup:
>
> (defn get-header
> [[:link {:type "text/css" ...}]
> [:script {:type "text/javascript" ...}]])
>
> (html [:head (get-header) ...] [:body ...])
>
>
> The resu
Hi,
This may sound a bit weird, but can I "unquote-splice" something when
calling a macro. Here's an attempt to do this with hiccup:
(defn get-header
[[:link {:type "text/css" ...}]
[:script {:type "text/javascript" ...}]])
(html [:head (get-header) ...] [:body ...])
The result of get-h