> On Jul 6, 2016, at 9:54 AM, Alexey Komnin via swift-users
> wrote:
>
> Here is the code:
>
>let a: String = "abc"
>let b: NSString = "abc"
>
>assert(a == b)
>assert(a.hashValue == b.hashValue, "a.hashValue(\(a.hashValue)) !=
>
on Wed Jul 06 2016, Austin Zheng wrote:
> Would this require a swift-evolution review, since it's technically an API
> change? (removing the initializer requirement is something I am also
> interested in seeing...)
Yes.
--
Dave
___
swift-users
on Wed Jul 06 2016, Tim Vermeulen wrote:
> RangeReplaceableCollection has three initialisers: init(), init(_:)
> and init(repeating:count:). The latter two are implemented using the
> empty initialiser. But why are these initialisers part of this
> particular protocol? As far as I can tell, no
The same is true for protocols such as `RandomAccessCollection` and
`MutableCollection`.
> On 6 Jul 2016, at 22:07, Tino Heth <2...@gmx.de> wrote:
>
>
>> I thought this was it, but none of the default implementations of
>> RangeReplaceableCollection seem to use this empty initialiser
> I
The best way I know of is the swift-ide-test tool, and you’ll see it being
invoked by many of the ClangImporter tests.
> On Jul 6, 2016, at 10:45 AM, Ryan Wilson via swift-users
> wrote:
>
> Hi everyone,
>
> In Xcode, I can generate a Swift interface for an Objective-C
Hi everyone,
In Xcode, I can generate a Swift interface for an Objective-C file by using
the assistant editor and selecting "Generated Interface" from the menu of
what to display. How would I go about generating this using the tools in
the Swift repo from GitHub? I've been digging around the
I thought this was it, but none of the default implementations of
RangeReplaceableCollection seem to use this empty initialiser (except for the
two other initialisers and `removeAll(keepingCapacity:)`, the latter of which
can be implemented using `removeSubrange(_:)` instead). This makes me
> On Jul 6, 2016, at 9:54 AM, Alexey Komnin via swift-users
> wrote:
>
> Here is the code:
>
>let a: String = "abc"
>let b: NSString = "abc"
>
>assert(a == b)
>assert(a.hashValue == b.hashValue, "a.hashValue(\(a.hashValue)) !=
>
Yes, that is what I thought too. But when I try to do it, I get this error:
Error:(57, 23) 'Self' is only available in a protocol or as the result of
a method in a class; did you mean 'AppEvent’?
Thanks,
Jon
On 7/5/16, 12:15, "swift-users-boun...@swift.org on behalf of Kenny Leung
via
> On Jul 6, 2016, at 8:55, Neil Faiman wrote:
>
> It’s actually more complicated than that.
>
> case (0, 0): is a tuple-pattern, so its interpretation is well defined. case
> int_1_1: must be an expression-pattern, since it does’t match any of the
> other pattern
I am not a software scientist. I have to explain things with examples. For
example, in Framework headers.
extension Array : RangeReplaceableCollection {
> /// Creates a new, empty array.
> ///
> /// This is equivalent to initializing with an empty array literal.
> /// For example:
I wouldn’t expect String and NSString to have identical implementations of
hashValue(). Is there a problem you’re having that this example is meant to
illustrate? I can see this being an issue if you’re building your own
collection type for strings.
Jeff Kelley
slauncha...@gmail.com |
I never said a RangeReplaceableCollection shouldn’t be empty. I just think it’s
strange that it requires an empty initialiser (while the Collection protocol
doesn’t).
> On 6 Jul 2016, at 16:33, Zhao Xin wrote:
>
> No. You didn't catch what I meant. I meant it should be like
It’s actually more complicated than that.
case (0, 0): is a tuple-pattern, so its interpretation is well defined. case
int_1_1: must be an expression-pattern, since it does’t match any of the other
pattern kinds. So it should compare the value of the pattern expression
case_1_1 against the
Another option is to rename them manually:
typedef NS_OPTIONS(NSInteger, FoodType)
{
dairyFood NS_SWIFT_NAME(dairy) = 1 << 0 ,
meatFood NS_SWIFT_NAME(meat) = 1 << 1 ,
mushroomFood NS_SWIFT_NAME(mushroomMushroom) = 1 << 2
};
On Wed, Jul 6, 2016 at 6:03 AM, Matteo via swift-users
It'd be nice if there was a predefined macro to let you know if you're
inside of the header generation machinery. Last time I grazed the compiler
it didn't set up any custom symbols in the preprocessor it uses for the
first stage of processing the generated header. (rdar://27195567 - would
like
The section you are referencing is regarding ‘assignment’; however, in the
example below we aren’t talking about assignment, this is
'constant-declaration', which is different than a ‘parenthesized expression’.
But overall I get it, and I think I’m trending toward the same conclusion you
The language reference says that “Assignment is performed from each part of the
value to the corresponding part of the expression. A String value can be
assigned to a String, and a () -> Int value can be assigned to a () throws ->
Int, so one would reasonably expect that both tuple assignments
You wouldn’t need an empty initialiser to remove all elements from a
collection, right? You could just use `replaceRange` instead.
> Now I understood you concerns. Have you ever thought of if a non-empty
> RangeReplaceableCollection being removed all of its elements, which makes the
>
I’m not convinced that I see this as a bug, maybe more of a feature request?
The test given seems to be conflating a tuple-type with tuple-pattern…
Shane
> On Jul 5, 2016, at 6:16 PM, Neil Faiman via swift-users
> wrote:
>
> SR-1993.
>
>> On Jul 5, 2016, at 4:15 PM,
Aaron this works for me in both Swift 2.2 and Swift 3 provided that you remove
the ‘throws’ keyword.
What seems odd to me is not the first assignment, but rather the second that
_allows_ the use of ‘throws’ when t.1 (i.e. f) does not throw - is your concern
the same?
Shane
On Jul 5, 2016,
Now I understood you concerns. Have you ever thought of if a non-empty
RangeReplaceableCollection being removed all of its elements, which makes
the collection to be an empty collection. That shouldn't change the
RangeReplaceableCollection
to be a non-RangeReplaceableCollection. So the empty
I’m not allowing generic subscripts. The collection is declared as
`AnyIndexArray` and it
can be subscripted with type `Index`.
Either way, it’s not really important. I’m mostly wondering why
RangeReplaceableCollection needs an empty initialiser.
> Then how you defined the index to conform
Then how you defined the index to conform to Strideable? Below code does
work as it seams that you can't use generics in subscripts.
subscript(index:T) -> Element
Zhaoxin
On Wed, Jul 6, 2016 at 8:32 PM, Tim Vermeulen wrote:
>
> On 6 Jul 2016, at 14:03, Zhao Xin
> On 6 Jul 2016, at 14:03, Zhao Xin wrote:
>
> According to the document of Swift 3, Array has already conformed protocol
> RangeReplaceableCollection.
That’s exactly why I also want to conform my wrapper to that protocol? I think
there’s a misunderstanding. I’m making a
It seems like Swift has broken a lot of the export functionality. Some of
the exporting system was actually a bug but resulting in useful
functionality (i.e like importing C Macros as enums). But once fixed we
lost a lot of it.
*___*
*James⎥Head of Trolls*
According to the document of Swift 3, Array has already conformed
protocol RangeReplaceableCollection.
Zhaoxin
On Wed, Jul 6, 2016 at 7:09 PM, Tim Vermeulen via swift-users <
swift-users@swift.org> wrote:
> RangeReplaceableCollection has three initialisers: init(), init(_:) and
>
> On 5 Jul 2016, at 18:21, Jordan Rose wrote:
>
> Longstanding bug, rdar://problem/17277899 .
> Surprisingly few people have asked for it.
>
> Jordan
>
Good to know, thanks.
Maybe not enough people know/care about the overheads of weak references?
Since the WWDC
Suppose I have an existing enum in Obj-C such as:
typedef NS_OPTIONS(NSInteger, FoodType)
{
dairyFood = 1 << 0,
meatFood= 1 << 1,
mushroomFood = 1 << 2
};
I want to rename all the values so that swift code can use the shorter names.
i.e
typedef NS_OPTIONS(NSInteger, FoodType)
Tuple is not designed to be used as commonly as classes and structs.
NOTE
> Tuples are useful for temporary groups of related values. They are not
> suited to the creation of complex data structures. If your data structure
> is likely to persist beyond a temporary scope, model it as a class or
>
30 matches
Mail list logo