org.scalalang.macroparadise.quasiquotes.Reifiers
Reifies list filling all the valid holeMap.
Reifies list filling all the valid holeMap.
Reification of non-trivial list is done in two steps:
2. fold the groups into a sequence of lists added together with ++ using fill reification for holeMap and fallback reification for non-holeMap.
Example:
reifyMultiCardinalityList(lst) { // first we define patterns that extract high-cardinality holeMap (currently ..) case Placeholder(CorrespondsTo(tree, tpe)) if tpe <:< iterableTreeType => tree } { // in the end we define how single elements are reified, typically with default reify call reify(_) }
Sample execution of previous concrete list reifier:
> val lst = List(foo, bar, qq$f3948f9s$1) > reifyMultiCardinalityList(lst) { ... } { ... } q"List($foo, $bar) ++ ${holeMap(qq$f3948f9s$1).tree}"
Splits list into a list of groups where subsequent elements are considered similar by the corresponding function.
Splits list into a list of groups where subsequent elements are considered similar by the corresponding function.
Example:
> group(List(1, 1, 0, 0, 1, 0)) { _ == _ } List(List(1, 1), List(0, 0), List(1), List(0))
Reifies arbitrary list filling .
Reifies arbitrary list filling ..$x and ...$y holeMap when they are put in the correct position. Fallbacks to regular reification for non-high cardinality elements.