Re: [swift-dev] Make offset index available for String

2017-12-18 Thread Cao, Jiannan via swift-dev
I implemented the second approach: SuperIndexhttps://github.com/frogcjn/SuperStringIndex/SuperString is a special version of String. Its SuperIndex keeps a reference to the string, let the index calculate the offset.struct SuperIndex : Comparable, Strideable, CustomStringConvertible {        var ow

Re: [swift-dev] Make offset index available for String

2017-12-18 Thread Cao, Jiannan via swift-dev
I implemented the second approach: SuperIndex https://github.com/frogcjn/SuperStringIndex/ SuperString is a special version of String. Its SuperIndex keeps a reference to the string, let the index calculate the offset. struct SuperIndex : Compara

Re: [swift-dev] Conditional conformance: Removing the opt-in flag

2017-12-18 Thread Slava Pestov via swift-dev
> On Dec 18, 2017, at 6:27 PM, Dave Abrahams via swift-dev > wrote: > > > >> On Dec 18, 2017, at 4:52 PM, Douglas Gregor via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >> Hi all, >> >> A little while back, I added an error to the Swift 4.1 compiler that

Re: [swift-dev] Preserving and Applying CC in Imported Decls

2017-12-18 Thread John McCall via swift-dev
> On Dec 18, 2017, at 9:34 PM, Greg Parker wrote: > > >> On Dec 13, 2017, at 10:28 PM, John McCall via swift-dev > > wrote: >> >>> On Dec 13, 2017, at 8:35 PM, Saleem Abdulrasool >> > wrote: >>> On Wed, Dec 13, 2017 at 4:14 PM, Jo

Re: [swift-dev] Conditional conformance: Removing the opt-in flag

2017-12-18 Thread Douglas Gregor via swift-dev
Sent from my iPhone > On Dec 18, 2017, at 6:27 PM, Dave Abrahams wrote: > > > >> On Dec 18, 2017, at 4:52 PM, Douglas Gregor via swift-dev >> wrote: >> >> Hi all, >> >> A little while back, I added an error to the Swift 4.1 compiler that >> complains if one tries to use conditional conf

Re: [swift-dev] Preserving and Applying CC in Imported Decls

2017-12-18 Thread Greg Parker via swift-dev
> On Dec 13, 2017, at 10:28 PM, John McCall via swift-dev > wrote: > >> On Dec 13, 2017, at 8:35 PM, Saleem Abdulrasool > > wrote: >> >>> On Wed, Dec 13, 2017 at 4:14 PM, John McCall >> > wrote: > >>> >>> - SILGen may need to introdu

Re: [swift-dev] Conditional conformance: Removing the opt-in flag

2017-12-18 Thread Dave Abrahams via swift-dev
> On Dec 18, 2017, at 4:52 PM, Douglas Gregor via swift-dev > wrote: > > Hi all, > > A little while back, I added an error to the Swift 4.1 compiler that > complains if one tries to use conditional conformances, along with a flag > “-enable-experimental-conditional-conformances” to enable t

Re: [swift-dev] Adding a CHECK to test case.

2017-12-18 Thread Greg Parker via swift-dev
> On Dec 13, 2017, at 10:47 PM, Atul Sowani via swift-dev > wrote: > > Hi, > > clang_inline_opt.swift test case is failing on ppc64le with following error: > > /root/swift-source/swift/test/IRGen/clang_inline_opt.swift:10:11: error: > expected string not found in input > // CHECK: define int

[swift-dev] Conditional conformance: Removing the opt-in flag

2017-12-18 Thread Douglas Gregor via swift-dev
Hi all, A little while back, I added an error to the Swift 4.1 compiler that complains if one tries to use conditional conformances, along with a flag “-enable-experimental-conditional-conformances” to enable the feature. We did this because we haven’t implemented the complete proposal yet; spe

Re: [swift-dev] SIL's TrailingOperandsList versus llvm::TrailingObjects

2017-12-18 Thread Joe Groff via swift-dev
> On Dec 17, 2017, at 6:52 PM, David Zarzycki via swift-dev > wrote: > > Hello SIL exports, > > Why do some SILNodes use a custom TrailingOperandsList class and other > SILNodes use LLVM’s TrailingObjects class? Is this just historical? It seems > like the LLVM design is more flushed out an

Re: [swift-dev] Make offset index available for String

2017-12-18 Thread Michael Ilseman via swift-dev
An index that keeps a reference to the collection is an iterator, e.g. the IndexingIterator[1], which String already provides. [1] https://developer.apple.com/documentation/swift/indexingiterator > On Dec 18, 2017, at 12:53 AM, Cao, Jiannan wrote: > > Or we can copy the design of std::vector:

Re: [swift-dev] How to run Swift on Windows

2017-12-18 Thread Kazuki Ohara via swift-dev
There was small mistake. Wrong: set swift_source_dir=c:\swift Correct: set swift_source_dir=c:/swift Thanks, Kazuki 2017-12-19 2:00 GMT+09:00 Kazuki Ohara via swift-dev : > Hi Eric, > > > Do you mind elaborating on how you got it built with MSVC? > > Sure. I succeeded to build LLVM, clang and Sw

Re: [swift-dev] Foundation crashes on Android

2017-12-18 Thread Geordie Jay via swift-dev
Philippe Hausler schrieb am Mo. 18. Dez. 2017 um 18:44: > > On Dec 18, 2017, at 9:13 AM, Geordie J via swift-dev > wrote: > > Hello, > > I’m trying to get the latest version of Foundation working on Android. > Just looking to see if anyone has seen similar issues on other (esp. 32bit) > platform

Re: [swift-dev] Foundation crashes on Android

2017-12-18 Thread Philippe Hausler via swift-dev
> On Dec 18, 2017, at 9:13 AM, Geordie J via swift-dev > wrote: > > Hello, > > I’m trying to get the latest version of Foundation working on Android. Just > looking to see if anyone has seen similar issues on other (esp. 32bit) > platforms or on Android itself. > > I made some minor change

[swift-dev] Foundation crashes on Android

2017-12-18 Thread Geordie J via swift-dev
Hello, I’m trying to get the latest version of Foundation working on Android. Just looking to see if anyone has seen similar issues on other (esp. 32bit) platforms or on Android itself. I made some minor changes: – CoreFoundation/Base.subproj/CFSortFunctions.c to get e.g. __checkint_int32_mul

Re: [swift-dev] How to run Swift on Windows

2017-12-18 Thread Kazuki Ohara via swift-dev
Hi Sangjin, Thank you! I will check https://github.com/tinysun212/swift-windows/commits/swift- windows-4.0-branch 2017-12-18 14:18 GMT+09:00 Sangjin Han via swift-dev : > For the MinGW-w64 system, swift-4.0-branch (up to 4.0.3-RELEASE) is merged > into https://github.com/tinysun212/swift-windows

Re: [swift-dev] How to run Swift on Windows

2017-12-18 Thread Kazuki Ohara via swift-dev
Hi Eric, > Do you mind elaborating on how you got it built with MSVC? Sure. I succeeded to build LLVM, clang and Swift compiler with the tag of swift-4.0.2-RELEASE. LLVM and clang seem to work okay and Swift compiler can compile swift sources but the generated exectables crash. Here's my procedur

Re: [swift-dev] Make offset index available for String

2017-12-18 Thread Cao, Jiannan via swift-dev
Or we can copy the design of std::vector::iterator in C++.The index could keep a reference to the collection. When the index being offset by + operator, since it keeps a reference to the collection owner, it could call the owner to offset the index. let startIndex = s.startIndex s[startIndex+1]

Re: [swift-dev] Make offset index available for String

2017-12-18 Thread Cao, Jiannan via swift-dev
Or we can copy the design of std::vector::iterator in C++.The index could keep a reference to the collection. When the index being offset by + operator, it could call the owner to offset the index, since it keeps a reference to the collection owner. let startIndex = s.startIndex s[startIndex+1]

Re: [swift-dev] Make offset index available for String

2017-12-18 Thread Cao, Jiannan via swift-dev
Or we can copy the design of C++. the index keep a reference to the sequence. The index can be offset by + operator, since it keeps a reference to the sequence owner, it should call the owner to offset the index. let startIndex = s.startIndex s[startIndex+1] public struct MyIndex : Comparable wh