[swift-evolution] << Operator to append to array

James Campbell james at supmenow.com
Mon Dec 21 11:22:05 CST 2015


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
james at supmenow.com
+44 7523 279 698
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151221/1da20452/attachment.html>


More information about the swift-evolution mailing list