Yep. With my proposed renaming this would work:
[["hey"], ["what"]].joined().joined(separator: “”)
But so would this, if you prefer it:
[["hey"], ["what"]].joined().joined()
On Sun, Jul 24, 2016 at 6:06 PM, Jose Cheyo Jimenez
wrote:
> [["hey"], ["what"]].joined().joined() // proposed
>
> vs
>
[["hey"], ["what"]].joined().joined() // proposed
vs
[["hey"], ["what"]].flatten().joined(separator: “”) // now
I do agree that having two way of doing it now seems odd.
[["hey"], ["what"]].joined(separator: []).joined(separator: “”) // now
> On Jul 24, 2016, at 5:47 PM, Jacob Bandes-Stor
The thing is, joined also works on arrays-of-arrays today. The only
difference is that flatten doesn't have a separator.
We wouldn't lose what your example shows — you could do this:
[["hey"], ["what"]].joined().joined(separator: “")
On Sun, Jul 24, 2016 at 5:45 PM Jose Cheyo Jimenez
wrote:
> H
Here is a quick example that we would loose.
[["hey"], ["what"]].flatten().joined(separator: “")
[["hey"], ["what"]].flatten() // ["hey", "what”]
The way I think of it is flatten works on array of arrays while joined works on
arrays of strings.
I guess we could do this too
[["hey"], ["what"
-1 for this. To me there needs to be a difference between String (which is not
a normal collection) and other regular collections.
In addition, I really don’t think this proposal has the needed strong support
for the change.
> On Jul 22, 2016, at 3:41 PM, Jacob Bandes-Storch via swift-evol
Here's a proposal draft. Comments welcome:
https://gist.github.com/jtbandes/7978dc1848f7c37eeaa8e9aba27c7325
On Fri, Jul 22, 2016 at 2:51 PM, Ben Rimmington
wrote:
>
> > On 22 Jul 2016, at 20:43, Jacob Bandes-Storch
> wrote:
> >
> >> On Fri, Jul 22, 2016 at 8:35 AM, Ben Rimmington
> wrote:
>
> On 22 Jul 2016, at 20:43, Jacob Bandes-Storch wrote:
>
>> On Fri, Jul 22, 2016 at 8:35 AM, Ben Rimmington
>> wrote:
>>
>>> On 22 Jul 2016, at 02:46, Jacob Bandes-Storch wrote:
>>>
>>> In the swift-lang Slack channel, a few of us were discussing
>>> joined(separator:) and realized that fla
On Fri, Jul 22, 2016 at 8:35 AM, Ben Rimmington
wrote:
>
> > On 22 Jul 2016, at 02:46, Jacob Bandes-Storch wrote:
> >
> > In the swift-lang Slack channel, a few of us were discussing
> joined(separator:) and realized that flatten() does almost exactly the same
> thing.
> >
> > Is there interest i
> On 22 Jul 2016, at 02:46, Jacob Bandes-Storch wrote:
>
> In the swift-lang Slack channel, a few of us were discussing
> joined(separator:) and realized that flatten() does almost exactly the same
> thing.
>
> Is there interest in renaming flatten() to joined()? Since joined takes a
> separ
In the swift-lang Slack channel, a few of us were discussing
joined(separator:) and realized that flatten() does almost exactly the same
thing.
Is there interest in renaming flatten() to joined()? Since joined takes a
separator that's any Sequence, we can't have a default value for the
separator
10 matches
Mail list logo