Am 16.03.2011 11:09, schrieb spir:
This is a design bug. 99% of the time one does not want the newline,
which is not part of the string data, instead just a terminator. Even
more on stdin where it is used by the user to say "I"m done!".
If the text is written back to the output /and/ newline is n
Kai Meyer Wrote:
> Second, D doesn't seem to have a graceful way of reading an endless
> stream of delimited by delimiting character>. I think readf is rigid, and works great in some
> cases. I would greatly appreciate something more flexible like C++'s
> extraction operator (operator>>) thou
On 03/16/2011 07:54 AM, Ali Çehreli wrote:
On 03/16/2011 05:49 AM, Kagamin wrote:
Ali ǥhreli Wrote:
The following program may be surprising to the novice:
import std.stdio;
void main()
{
write("What is your name? ");
string name = readln();
writeln("Hi ", name, "!");
}
What if the user typ
Ali Ãehreli Wrote:
> I don't have a problem with whitespace being left in the line, I just
> want to know whether that's the intended or accepted behavior.
AFAIK, it is. It was intended to preserve eols while reading and writing lines.
spir Wrote:
> On 03/16/2011 06:41 AM, Jesse Phillips wrote:
> > Ali Ãehreli Wrote:
> >
> >> Right? Is there a better way that I am missing?
> >>
> >> Thank you,
> >> Ali
> >
> > No better way, the stated reason IIRC is that it is easier to remove the
> > new line then to append it back on.
>
>
On 03/16/2011 05:49 AM, Kagamin wrote:
Ali ǥhreli Wrote:
The following program may be surprising to the novice:
import std.stdio;
void main()
{
write("What is your name? ");
string name = readln();
writeln("Hi ", name, "!");
}
What if the user typed leading spaces? Will th
Ali ǥhreli Wrote:
> The following program may be surprising to the novice:
>
> import std.stdio;
>
> void main()
> {
> write("What is your name? ");
> string name = readln();
> writeln("Hi ", name, "!");
> }
What if the user typed leading spaces? Will the program operate as you
On Wed, 16 Mar 2011 11:20:43 +0100, spir wrote:
> On 03/16/2011 06:41 AM, Jesse Phillips wrote:
>> Ali Çehreli Wrote:
>>
>>> Right? Is there a better way that I am missing?
>>>
>>> Thank you,
>>> Ali
>>
>> No better way, the stated reason IIRC is that it is easier to remove
>> the new line then to
On 03/16/2011 06:41 AM, Jesse Phillips wrote:
Ali Çehreli Wrote:
Right? Is there a better way that I am missing?
Thank you,
Ali
No better way, the stated reason IIRC is that it is easier to remove the new
line then to append it back on.
May be stated, but it is very wrong! I guess:
s
On 03/16/2011 06:05 AM, Ali Çehreli wrote:
I am going over some sample programs in a text of mine and replacing
std.cstream references with std.stdio. There are non-trivial differences with
formatted input.
The following program may be surprising to the novice:
import std.stdio;
void main()
{
On Tuesday 15 March 2011 22:05:37 Ali Çehreli wrote:
> I am going over some sample programs in a text of mine and replacing
> std.cstream references with std.stdio. There are non-trivial differences
> with formatted input.
>
> The following program may be surprising to the novice:
>
> import std.
Ali Çehreli Wrote:
> Right? Is there a better way that I am missing?
>
> Thank you,
> Ali
No better way, the stated reason IIRC is that it is easier to remove the new
line then to append it back on.
I am going over some sample programs in a text of mine and replacing
std.cstream references with std.stdio. There are non-trivial differences
with formatted input.
The following program may be surprising to the novice:
import std.stdio;
void main()
{
write("What is your name? ");
stri
13 matches
Mail list logo