sdeleuze
01/28/2017, 6:07 PMimport io.spring.demo.*
"""
${include("header")}
<h1>${i18n("title")}</h1>
<ul>
${users.joinToLine{ "<li>${i18n("user")} ${it.firstname} ${it.lastname}</li>" }}
</ul>
${include("footer")}
"""
And I would like to use infix
function to turn it into a more readable:
import io.spring.demo.*
"""
${include "header"}
<h1>${i18n "title"}</h1>
<ul>
${users.joinToLine{ "<li>${i18n "user"} ${it.firstname} ${it.lastname}</li>" }}
</ul>
${include "footer"}
"""
I am able to declare infix fun ScriptTemplateWithBindings.i18n(code: String) : String
for example, but on script side it seems impossible to use the infix notation. @ilya.chernikov said me that I probably cannot use infix
function without explicit first argument (receiver).
Do you confirm it is not possible with Kotlin 1.1?
Do you agree that would be useful for such use case?
Do you think this could be doable, ie. should I create and issue for such improvement request or not