Hello group,

This is my first post here so please tell me if I’m doing something wrong.

The function name joinWithSeparator() sounds like an ObjectiveCism to me. Why 
not just name it join()? I is a common function found in many libraries of 
other programming languages and it is always simply called join(). I don’t 
think there is much room for misunderstanding what the parameter does.

Also, why is it limited to String only SequenceTypes? An implementation like

extension SequenceType {
    func join(separator: String) -> String {
        let arr = self.map({String($0)})
        return arr.joinWithSeparator(separator)
    }
}

would work fine with all classes that implement the CustomStringConvertible 
protocol and, for classes that don’t, the worst thing that would happen is that 
it would generate a string of repeating class names.

What do you think?

Thanks and regards,
Sebastian Mecklenburg

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

Reply via email to