May 27, 2015
On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote:
> Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this:
>
>     char[] front() return {
>         // ...
>         return buffer;
>     }
>
> The `return` keyword here means the same thing as in DIP25,

Is this supportd in 2.067 with -dip25 flag?

If so shouldn't we qualify `File.byLine.front` with return when DIP-25 becomes stable?
May 27, 2015
On Wednesday, 27 May 2015 at 10:53:48 UTC, Per Nordlöw wrote:
> On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote:
>> Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this:
>>
>>    char[] front() return {
>>        // ...
>>        return buffer;
>>    }
>>
>> The `return` keyword here means the same thing as in DIP25,
>
> Is this supportd in 2.067 with -dip25 flag?
>
> If so shouldn't we qualify `File.byLine.front` with return when DIP-25 becomes stable?

I qualified `front` with `return` here

https://github.com/nordlow/justd/blob/master/bylinefast.d#L84

but compiling this with DMD 2.067 along with flag -dip25 doesn't complain about

https://github.com/nordlow/justd/blob/master/bylinefast.d#L188

Did you mean that this too is a planned feature?
May 27, 2015
On Wednesday, 27 May 2015 at 11:02:24 UTC, Per Nordlöw wrote:
> On Wednesday, 27 May 2015 at 10:53:48 UTC, Per Nordlöw wrote:
>> On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote:
>>> Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this:
>>>
>>>   char[] front() return {
>>>       // ...
>>>       return buffer;
>>>   }
>>>
>>> The `return` keyword here means the same thing as in DIP25,
>>
>> Is this supportd in 2.067 with -dip25 flag?
>>
>> If so shouldn't we qualify `File.byLine.front` with return when DIP-25 becomes stable?
>
> I qualified `front` with `return` here
>
> https://github.com/nordlow/justd/blob/master/bylinefast.d#L84
>
> but compiling this with DMD 2.067 along with flag -dip25 doesn't complain about
>
> https://github.com/nordlow/justd/blob/master/bylinefast.d#L188
>
> Did you mean that this too is a planned feature?

I general, `return` is supposed to work (with -dip25), but only in combination with `ref`, not slices or pointers. DMD probably ignores it here instead of printing an error message.
May 27, 2015
On Wednesday, 27 May 2015 at 14:13:03 UTC, Marc Schütz wrote:
> I general, `return` is supposed to work (with -dip25), but only in combination with `ref`, not slices or pointers. DMD probably ignores it here instead of printing an error message.

So, *should* it error for slices or not?
May 27, 2015
On Wednesday, 27 May 2015 at 11:02:24 UTC, Per Nordlöw wrote:
> On Wednesday, 27 May 2015 at 10:53:48 UTC, Per Nordlöw wrote:
>> On Wednesday, 27 May 2015 at 09:54:33 UTC, Marc Schütz wrote:
>>> Yes. First of all, `File.byLine.front` is the function that needs to get annotated, like this:
>>>
>>>   char[] front() return {
>>>       // ...
>>>       return buffer;
>>>   }
>>>
>>> The `return` keyword here means the same thing as in DIP25,
>>
>> Is this supportd in 2.067 with -dip25 flag?
>>
>> If so shouldn't we qualify `File.byLine.front` with return when DIP-25 becomes stable?
>
> I qualified `front` with `return` here
>
> https://github.com/nordlow/justd/blob/master/bylinefast.d#L84
>
> but compiling this with DMD 2.067 along with flag -dip25 doesn't complain about
>
> https://github.com/nordlow/justd/blob/master/bylinefast.d#L188
>
> Did you mean that this too is a planned feature?

I might be wrong, but I thought dip25 was only enabled in @safe annotated code?
May 27, 2015
On Wednesday, 27 May 2015 at 15:21:38 UTC, weaselcat wrote:
> I might be wrong, but I thought dip25 was only enabled in @safe annotated code?

Does this mean that I have to @safe-qualify `ByLineFast.front()` or the function iterating over it or both?

Or does it suffice to @trusted-qualify `ByLineFast.front()` and @safe-qualify the function doing the iteration?
May 28, 2015
On Wednesday, 27 May 2015 at 15:21:38 UTC, weaselcat wrote:
> I might be wrong, but I thought dip25 was only enabled in @safe annotated code?

I updated bylinefast at

https://github.com/nordlow/justd/blob/master/bylinefast.d#L188

to make the unittest @safe and members of @trusted.

DMD (2.067 and git master) with -dip25 still doesn't complain about

https://github.com/nordlow/justd/blob/master/bylinefast.d#L198

nor

https://github.com/nordlow/justd/blob/master/bylinefast.d#L203

...
May 28, 2015
On Thursday, 28 May 2015 at 11:38:25 UTC, Per Nordlöw wrote:
> DMD (2.067 and git master) with -dip25 still doesn't complain about
> ...

My guess is that this passes because the internal storage is GC-allocated. I'm sensing we need a new qualifier for this or that there is more logic to come in DMD regarding extensions to DIP-25...
May 28, 2015
On 5/28/15 5:38 AM, "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow@gmail.com>" wrote:
> On Wednesday, 27 May 2015 at 15:21:38 UTC, weaselcat wrote:
>> I might be wrong, but I thought dip25 was only enabled in @safe
>> annotated code?
>
> I updated bylinefast at
>
> https://github.com/nordlow/justd/blob/master/bylinefast.d#L188

How faster is bylinefast compared to byline (after the recent improvements)? -- Andrei

May 28, 2015
> How faster is bylinefast compared to byline (after the recent improvements)? -- Andrei

About 3 times in my measurements.