On Wed, Apr 6, 2016 at 9:54 PM, Daniel Dunbar <daniel_dun...@apple.com> wrote:
> Could we get a method that takes a [UInt8] directly and performs the same 
> basic function?

I think the root of the surprise here is that the compiler converts
[UInt8] into an unsafe pointer.  This is appropriate when the callee
is a C API, but usually not appropriate when it is a Swift API.  This
is not the first time when this implicit conversion causes surprise.
I think we should discuss scoping that conversion to only C and
Objective-C callees.

But I agree with you, we should have a similar operation that works on
arbitrary collections.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <griboz...@gmail.com>*/
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to