Re: Is it possible to assign multiple macro calls into an array

Albert Kam <[email protected]> Sat, 14 Feb 2015 19:10:43 +0700
Newsgroups gmane.comp.web.freemarker.user
Message-ID <CAMT20g-quRma1zD_E+BgArSWKQ80F=NQDCvEZG1-To5thC=8uA@mail.gmail.com>
--===============6433764919862355836==
Content-Type: multipart/alternative; boundary=001a11376f4808ba95050f0b3ef9

--001a11376f4808ba95050f0b3ef9
Content-Type: text/plain; charset=UTF-8

Ah, great idea. I could pass hashes as the arguments for more complex
parameters.

Thanks !

On Sat, Feb 14, 2015 at 2:37 AM, Daniel Dekany <[email protected]> wrote:

> Friday, February 13, 2015, 10:44:25 AM, Albert Kam wrote:
>
> > Hello !
> >
> > I know this is absurd example, but instead of doing these
> > repetitive row macro calls on each comment :
> > <@commentbox>
> >     <@row>
> >         <@comment id=1 />
> >     </@row>
> >     <@row>
> >         <@comment id=2 />
> >     </@row>
> >     <@row>
> >         <@comment id=1 />
> >     </@row>
> > </@commentbox>
> >
> > It'll be simpler if i could do something like this :
> > <@commentbox>
> >   <#assign comments=[
> >         <@comment id=1 />,
> >         <@comment id=2 />,
> >         <@comment id=1 />
> >   ]>
> >   <@wrapInRow comments />
> > </@commentbox>
> >
> > I know we can nest macro result within the assign tag, but it
> > doesnt solve the repetitiveness of the assign tag calls.
> >
> > Is this supported or planned ? Or perhaps there's a pattern for this
> situation ?
>
> Not sure what input the @comment macros has in reality... it it were
> only an ID-s, then this comes to my mind:
>
>   <@wrapInRow comment 1 2 1 />
>
> So here the trick is that you pass in the macro itself, and then the
> argument for each macro call.
>
> As of collecting macro calls in a list (actually, in a tree), then
> calling them later... that's a tricky topic. Something similar is in
> fact planned (mostly focusing on layout problems though), after some
> other major developments, so it's very, very far away, given the pace
> of development here.
>
> > Thank you !
>
> --
> Thanks,
>  Daniel Dekany
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> FreeMarker-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-user
>



-- 
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

--001a11376f4808ba95050f0b3ef9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Ah, great idea. I could pass hashes as the arguments for m=
ore complex parameters.<div><br></div><div>Thanks !</div></div><div class=
=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sat, Feb 14, 2015 at 2:3=
7 AM, Daniel Dekany <span dir=3D"ltr">&lt;<a href=3D"mailto:ddekany@freemai=
l.hu" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5">Friday, Fe=
bruary 13, 2015, 10:44:25 AM, Albert Kam wrote:<br>
<br>
&gt; Hello !<br>
&gt;<br>
&gt; I know this is absurd example, but instead of doing these<br>
&gt; repetitive row macro calls on each comment :<br>
&gt; &lt;@commentbox&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;@row&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;@comment id=3D1 /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;/@row&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;@row&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;@comment id=3D2 /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;/@row&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;@row&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;@comment id=3D1 /&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;/@row&gt;<br>
&gt; &lt;/@commentbox&gt;<br>
&gt;<br>
&gt; It&#39;ll be simpler if i could do something like this :<br>
&gt; &lt;@commentbox&gt;<br>
&gt;=C2=A0 =C2=A0&lt;#assign comments=3D[<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;@comment id=3D1 /&gt;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;@comment id=3D2 /&gt;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;@comment id=3D1 /&gt;<br>
&gt;=C2=A0 =C2=A0]&gt;<br>
&gt;=C2=A0 =C2=A0&lt;@wrapInRow comments /&gt;<br>
&gt; &lt;/@commentbox&gt;<br>
&gt;<br>
&gt; I know we can nest macro result within the assign tag, but it<br>
&gt; doesnt solve the repetitiveness of the assign tag calls.<br>
&gt;<br>
&gt; Is this supported or planned ? Or perhaps there&#39;s a pattern for th=
is situation ?<br>
<br>
</div></div>Not sure what input the @comment macros has in reality... it it=
 were<br>
only an ID-s, then this comes to my mind:<br>
<br>
=C2=A0 &lt;@wrapInRow comment 1 2 1 /&gt;<br>
<br>
So here the trick is that you pass in the macro itself, and then the<br>
argument for each macro call.<br>
<br>
As of collecting macro calls in a list (actually, in a tree), then<br>
calling them later... that&#39;s a tricky topic. Something similar is in<br=
>
fact planned (mostly focusing on layout problems though), after some<br>
other major developments, so it&#39;s very, very far away, given the pace<b=
r>
of development here.<br>
<br>
&gt; Thank you !<br>
<br>
--<br>
Thanks,<br>
=C2=A0Daniel Dekany<br>
<br>
<br>
---------------------------------------------------------------------------=
---<br>
Dive into the World of Parallel Programming. The Go Parallel Website,<br>
sponsored by Intel and developed in partnership with Slashdot Media, is you=
r<br>
hub for all things parallel software development, from weekly thought<br>
leadership blogs to news, videos, case studies, tutorials and more. Take a<=
br>
look and join the conversation now. <a href=3D"http://goparallel.sourceforg=
e.net/" target=3D"_blank">http://goparallel.sourceforge.net/</a><br>
_______________________________________________<br>
FreeMarker-user mailing list<br>
<a href=3D"mailto:[email protected]">FreeMarker-user@li=
sts.sourceforge.net</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/freemarker-user" ta=
rget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/freemarker-use=
r</a><br>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature">Do not pursue the past. Do not lose yourself in the fu=
ture. <br>The past no longer is. The future has not yet come. <br>Looking d=
eeply at life as it is in the very here and now, <br>the practitioner dwell=
s in stability and freedom.<br>(Thich Nhat Hanh)</div>
</div>

--001a11376f4808ba95050f0b3ef9--


--===============6433764919862355836==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
--===============6433764919862355836==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user

--===============6433764919862355836==--