htp #19678 add variadic concat route combinator

* add variadic route concatenation function

* add `concat` to `~` warning bubble in docs

* fix grammar of warning bubble, and clarify
This commit is contained in:
Alan Johnson 2016-04-05 09:36:46 -04:00 committed by Konrad Malawski
parent 09d5072f2c
commit b3c85512a3
4 changed files with 51 additions and 4 deletions

View file

@ -138,8 +138,8 @@ transformations, both (or either) on the request and on the response side.
Composing Directives
--------------------
.. note:: Gotcha: forgetting the ``~`` (tilde) character in between directives can often result in perfectly valid
Scala code that compiles but lead to your composed directive only containing the up to where ``~`` is missing.
.. note:: Gotcha: forgetting the ``~`` (tilde) character in between directives can result in perfectly valid
Scala code that compiles but does not work as expected. What would be intended as a single expression would actually be multiple expressions, and only the final one would be used as the result of the parent directive. Alternatively, you might choose to use the ``concat`` combinator. ``concat(a, b, c)`` is the same as ``a ~ b ~ c``.
As you have seen from the examples presented so far the "normal" way of composing directives is nesting.
Let's take a look at this concrete example: