Trying to provide a Selectable but for structs made out of vars, I find that Fields works really nice for applyDynamic, but I get nothing for selectDynamic. Given the existence of named tuples, it wouldn’t be hard to synthesize something like
// given
case class Point(x: Int, y: Int)
// produce
Selectable {
type Fields = (x: Int, y: Int)
type Methods = (x_= : (Int => Unit), y_= : (Int => Unit))
}
using the metaprogramming tools.
Alternatively, lacking this, I’m forced to, using just Fields, return some W[ActualType] for every field, and then provide an awkward := or similar operator to properly handle the operation.