Order objects during execution
plepe opened this issue · 2 comments
plepe commented
Execution order of objects should be influenced by special pseudo tags. The order applies only for the given rule - subsequent rules may have different order.
The following pseudo classes will be implemented:
:order-numerical()
:order-alphabetical()
:order-natural()
The pseudo classes will take at least one, but up to three parameters:
- First parameter: the value by which will be ordered. Can be either a tag key or an eval expression.
- Second argument (optional): specify order direction, e.g. 'asc' or 'desc'. ->
:order-numerical(ele, desc)
. - An optional third parameter defines the default value (if the first parameter evaluates to none) ->
:order-numerical(ele, desc, 0)
.
The idea for :order-*
was first born in #77 .
plepe commented
Alternative:
:order-numerical-asc()
and:order-numerical-desc()
<- would be simpler to handle, as every parameter can be an eval function. Or, we rather need a single parameter, the "default value" can be emulated by using:order-numerical-asc(any(tag("ele"), 0))
.