Open
Description
I've seen there was another issue for this (#63) but it's closed and I think it's an important lack.
For now, if we need to declare some variables we have to to this:
@defining(
myObject.calcFoo,
myObject.calcBar
) { case (foo, bar) =>
@defining(myObject.calcResult(foo, bar)) { result =>
… the whole template …
}
}
And it's not handy. However, we can declare reusable blocks:
@foo = @{myObject.calcFoo}
@bar = @{myObject.calcBar}
@result = @{myObject.calcResult(foo, bar)}
But they are treated as functions, so foo
, bar
and result
will be recalculated every time. I think every time a reusable block is declared without parenthesis, its value should be calculated once and use it as a variable. So the previous example would define variables, and the following one would define functions.
@foo() = @{myObject.calcFoo}
@bar() = @{myObject.calcBar}
@result() = @{myObject.calcResult(foo, bar)}
Metadata
Assignees
Type
Projects
Status
🆕 New
Activity