// meta-transform function that understands Transformable and List // if f returns null, go through structure sO lambdaMapLike transform_understandsTransformableAndList(IF1 f, O o) { if (o == null) null; ping(); try object f.get(o); IF1 myself = x -> transform_understandsTransformableAndList(f, x); if (o cast Transformable) ret o.transformUsing(myself); if (o cast L) ret map(myself, o); fail("Don't know how to transform: " + className(o)); }