This is an automated email from the ASF dual-hosted git repository. ddekany pushed a commit to branch 2.3-gae in repository https://gitbox.apache.org/repos/asf/freemarker.git
commit 700e87ec201f5251ac4016371a4de3438d2e125e Author: ddekany <[email protected]> AuthorDate: Mon Apr 1 00:33:50 2019 +0200 (Added some version history entry for ?filter/?map and local lambdas... documentation is still missing) --- src/manual/en_US/book.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml index 24ceada..22ba798 100644 --- a/src/manual/en_US/book.xml +++ b/src/manual/en_US/book.xml @@ -27899,6 +27899,25 @@ TemplateModel x = env.getVariable("x"); // get variable x</programlisting> <itemizedlist> <listitem> + <para>Added new built-ins: + <literal>?filter(<replaceable>predicate</replaceable>)</literal> + and <literal>?map(<replaceable>mapper</replaceable>)</literal>. + These allow using lambda expression, like + <literal>users?filter(user -> user.superuser)</literal> or + <literal>users?map(user -> user.name)</literal>, or accept a + functions/method as parameter. (Lambda expressions are also new + in this release, but they can only be used in said built-ins, so + they aren't like in Java for example.) These built-ins are + generally eager, that is, they immediately build a new sequence. + However at selected places, most notably when used as + <literal><#list <replaceable>...</replaceable>></literal> + directive parameter, they are working in lazy mode instead, that + is, they won't built the a new sequence, just stream through the + existing one and apply the filter or mapping element by element. + [TODO: document and link documentation]</para> + </listitem> + + <listitem> <para>Added new built-ins for truncating text. <literal><replaceable>string</replaceable>?truncate(<replaceable>length</replaceable>)</literal> truncates the text to the given length, and by default adds
