Dunno about good form, but the std lib universally employs the _-less variant if that helps:
https://github.com/apple/swift/blob/master/stdlib/public/core/Character.swift#L404 The _ certainly seem like clutter to me. Same for subscripts, which have similar behavior. > On Jan 24, 2017, at 10:14 AM, Ray Fix via swift-users <[email protected]> > wrote: > > > When defining an operator such as == you can implicitly specify external > parameters: > > struct Path: Equatable { > var value: String > > static func ==(lhs: Path, rhs: Path) -> Bool { > return lhs.value == rhs.value > } > } > > Is this considered okay, or is it bad form and it should really be defined: > > > struct Path: Equatable { > var value: String > > static func ==(_ lhs: Path, _ rhs: Path) -> Bool { > return lhs.value == rhs.value > } > } > > Both seem to work fine in practice… 🤔 > > Thank you! > Ray > _______________________________________________ > swift-users mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________ swift-users mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-users
