-
-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Here is an example:
let $foo = {$count :number currency=$cur precision=2 rounding=up}
let $pers = {$foo :person level=formal}
let $bar = {$pers :date skeleton=yMMMdE}
match {$bar} ...
This would take $count, formats it as currency, then we try to format as person, then as date, and them make a decision on it.
Is there a good use case to do such chaining?
Or we are only struggling to support something that is useless, and potentially dangerous?
A more reasonable restriction would be that the "chained" variables use the same function:
let $fullDate = {$exp :date year=numeric month=full day=numeric}
let $shortDate = {$fullDate :date month=numeric}
In this case the reasonable behavior would be to merge the two maps of options and format with :date.
Although even that is a bit problematic: what if I want to remove a field from the first variable?
Are we making things complicated for little benefit? (saving a copy paste once in a blue moon)
It is a bit like C macros.
One level you can put up with.
Go macros defined on top of macros, and things get messier and messier.