That's really cool, I'm wondering me how much that would impose to compile time in large projects with many of these operations in place.
We won't know until we implement it fully. I've started an implementation already to experiment with this.
Doug
11 Likes
I’ve seen this PR today, and my head is like
. Amazing job!
3 Likes
This would deserve a standing ovation at WWDC in a normal year where people could gather together.
5 Likes
I'm wondering if it would be possible to serialize the entire if-then-else flow. For example, the user writes:
if foo > bar {
// ifTrue content
} else {
// ifFalse content
}
And I want to serialize the if statement into something like:
buildIf(lhs: foo, operand: .isGreaterThan, rhs: bar, ifTrue: ..., ifFalse: ...)
In my case, I've overloaded the > operator to return a Condition (similar to NSPredicate) so I can serialize both trees.
1 Like