> A simple example might be:   for (altitude = 0.1; altitude < 10e6; altitude 
> =* 10.0) { . . . }

Conceptually, this could be represented as a variant of `stride` which took a 
unary function for its `by` parameter:

        for altitude in stride(from: 0.1, to: 10e6, by: { $0 * 10 }) {
                ...
        }

There are a couple of features which could in theory clean this syntax up a 
bit, but they have limitations that prevent it:

* You can't use trailing closure syntax in a statement like `for` or `if`; the 
trailing closure is treated as the body of the statement.
* You can't use @autoclosure for an expression which has a parameter.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to