You can do this already

left += [right]

> On Dec 21, 2015, at 9:22 AM, James Campbell via swift-evolution 
> <[email protected]> wrote:
> 
> I already have an implementation:
> 
> func <<<T>(var left: Array<T>, right:T)
> 
> {
> 
>     left.append(right)
> 
> }
> 
> 
> 
> It makes
> 
> myArray.append(myArrayItem)
> 
> become:
> 
> myArray << myArrayItem
> 
> 
> 
> Which is shorter and a lot of languages such as Ruby already use this.
> 
> 
> -- 
>  Wizard
> [email protected] <mailto:[email protected]>
> +44 7523 279 698
>  _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

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

Reply via email to