Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Suliman via Digitalmars-d-learn
On Friday, 16 October 2015 at 12:43:59 UTC, Meta wrote: On Friday, 16 October 2015 at 10:38:52 UTC, Shriramana Sharma wrote: Is there a particular reason that File.byLine() returns char[] and not string i.e. immutable(char)[]? Is it just to avoid being overly restrictive? It seems that having

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread novice2 via Digitalmars-d-learn
what buffer you are talking. internal buffer. where result line resides. And what is "signal"? How it's working? just the fact for programmer, that result line can be changed by other code (by phobos library code in this case). no any special programming "signal".

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Daniel Kozak via Digitalmars-d-learn
V Sun, 18 Oct 2015 15:51:13 + Suliman via Digitalmars-d-learn napsáno: > On Sunday, 18 October 2015 at 15:40:09 UTC, novice2 wrote: > >> what buffer you are talking. > > > > internal buffer. where result line resides. > > > > > >> And what is "signal"?

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Suliman via Digitalmars-d-learn
On Sunday, 18 October 2015 at 15:40:09 UTC, novice2 wrote: what buffer you are talking. internal buffer. where result line resides. And what is "signal"? How it's working? just the fact for programmer, that result line can be changed by other code (by phobos library code in this case).

Re: Why does File.byLine() return char[] and not string

2015-10-18 Thread Meta via Digitalmars-d-learn
On Sunday, 18 October 2015 at 15:03:22 UTC, Suliman wrote: Sorry, but could you explain more simply? I reread all information, bit can't understand about what buffer you are talking. This is more or less how byLine works, simplified: struct ByLine { File file; char[] line; char[]

Why does File.byLine() return char[] and not string

2015-10-16 Thread Shriramana Sharma via Digitalmars-d-learn
Is there a particular reason that File.byLine() returns char[] and not string i.e. immutable(char)[]? Is it just to avoid being overly restrictive? It seems that having to .idup it is inefficient... -- Shriramana Sharma, Penguin #395953

Re: Why does File.byLine() return char[] and not string

2015-10-16 Thread Daniel Kozak via Digitalmars-d-learn
Shriramana Sharma píše v Pá 16. 10. 2015 v 16:08 +0530: > Is there a particular reason that File.byLine() returns char[] and > not > string i.e. immutable(char)[]? Is it just to avoid being overly > restrictive? > It seems that having to .idup it is inefficient... > You need to do dup or idup

Re: Why does File.byLine() return char[] and not string

2015-10-16 Thread Meta via Digitalmars-d-learn
On Friday, 16 October 2015 at 10:38:52 UTC, Shriramana Sharma wrote: Is there a particular reason that File.byLine() returns char[] and not string i.e. immutable(char)[]? Is it just to avoid being overly restrictive? It seems that having to .idup it is inefficient... byLine reuses an

Re: Why does File.byLine() return char[] and not string

2015-10-16 Thread Kagamin via Digitalmars-d-learn
http://dlang.org/phobos/std_stdio.html#.File.byLineCopy

Re: Why does File.byLine() return char[] and not string

2015-10-16 Thread Shriramana Sharma via Digitalmars-d-learn
Thanks people, for the replies. That's very clear now. -- Shriramana Sharma, Penguin #395953