I agree with karl. there is nothing really mathematical with min/max
e.g. find the longest sequence of characters in a string or the smallest array
or the minimal x coordinate of view objects…
min/max/clamp are needed everywhere.
LG
Dominik
Web: https://pich.info
Twitter: @DaijDjan
Facebook: Do
> On 31 Aug 2016, at 06:10, Sitton, Yogev via swift-evolution
> wrote:
>
> That’s was my point.
> Two sets of rules for the same case in two different places.
> These should be unified.
>
> I’ll write the proposal and create a pull request.
>
>> On Aug 17, 2016, at 11:24 PM, Slava Pestov >
> On Aug 30, 2016, at 3:54 PM, Mark Robinson via swift-evolution
> wrote:
>
> Hello,
>
> Consider the scenario of the vending machine example in the Swift Book:
Please catch up on the thread earlier this week on this exact topic.
-Chris
___
swift-e
Right… Good catch!
> On Aug 31, 2016, at 9:45 AM, Pyry Jahkola wrote:
>
>
>> Max Moiseev wrote:
>>
>> FWIW, the ‘classical’ way of doing what I think you’re trying to do is:
>>
>> extension Sequence {
>> var pairs: AnySequence<(Iterator.Element, Iterator.Element)> {
>> return AnySequence(zi
That’s was my point.
Two sets of rules for the same case in two different places.
These should be unified.
I’ll write the proposal and create a pull request.
On Aug 17, 2016, at 11:24 PM, Slava Pestov
mailto:spes...@apple.com>> wrote:
On Aug 17, 2016, at 10:18 AM, Vladimir.S via swift-evolutio
Comparable makes semantic guarantees about how values of conforming types
might be ordered. You don't need `min` or `max` for that to be useful,
since it's trivial to implement using comparison operators.
Basic numeric types require compiler magic and thus belong in the standard
library. Likewise,
That works, though it calls `next()` on an iterator twice as often as is
necessary… Either way, it’s not that important. There are ways around not
having an optional `first` parameter. When I brought it up I thought it was
just an oversight, but now that it turns out it isn’t (and there are reas
> On 30 Aug 2016, at 10:18, Xiaodi Wu via swift-evolution
> wrote:
>
> As an additive proposal, I don't think this would be in scope for the current
> phase of Swift 4.
>
> Looking forward, though, I'm not sure this belongs in the standard library.
> In general, my understanding is that Swif
> On Aug 28, 2016, at 12:54 PM, Nicholas Exner via swift-evolution
> wrote:
>
> Dear Swift Evolution Group Members,
> Recently, as I was reviewing some code that I wrote, I was wondering
> what the community’s thoughts are on the possible value of having a special
> “if let” self-ass
> Max Moiseev wrote:
>
> FWIW, the ‘classical’ way of doing what I think you’re trying to do is:
>
> extension Sequence {
> var pairs: AnySequence<(Iterator.Element, Iterator.Element)> {
>return AnySequence(zip(self, self.dropFirst()))
> }
> }
>
> Does it have the right behavior?
It does
FWIW, the ‘classical’ way of doing what I think you’re trying to do is:
extension Sequence {
var pairs: AnySequence<(Iterator.Element, Iterator.Element)> {
return AnySequence(zip(self, self.dropFirst()))
}
}
Does it have the right behavior?
Max
> On Aug 29, 2016, at 9:45 AM, Tim Vermeul
Hello,
Consider the scenario of the vending machine example in the Swift Book:
We have a function that throws errors from a single given ErrorType
1. func vend(itemNamed name: String) throws {
2. guard let item = inventory[name] else {
3. throw VendingMachineError.InvalidSelection
4
12 matches
Mail list logo