On Friday, 5 February 2016 at 12:35:14 UTC, Artur Skawina wrote:
D's std lib implementations are sometimes really awful, but in
this case it's not actually that bad:
print("hi","there");
->
fwrite("hi", 1, 2, 0x7ff68d0cb640) =
2
fwrite(" ", 1, 1,
On Friday, 5 February 2016 at 07:04:27 UTC, cy wrote:
Mind if I elaborate on this a bit? If that is unrolled, I
understand it will unroll into several calls to write, as in
print("1","2","3") => write("1"," ");write("2","
");write("3","\n");
Up to here, yes.
And presumably, write()
On Thursday, 4 February 2016 at 22:13:36 UTC, Ola Fosheim Grøstad
wrote:
Well, it is probably not the best point in time to have
absolute beginners use D anyway.
That is a ridiculous thing to say and a great way of ensuring a
language dies. Good starting resources help everyone.
On 02/05/16 08:04, cy via Digitalmars-d-learn wrote:
> On Thursday, 4 February 2016 at 15:32:48 UTC, Artur Skawina wrote:
>>void print(A...)(A a) {
>> foreach (N, ref e; a)
>> write(e, N==A.length-1?"\n":" ");
>>}
>
>>> will be unrolled at compile time
>
> Mind if I
On Friday, 5 February 2016 at 12:35:14 UTC, Artur Skawina wrote:
call used to print diagnostics. What I saw made me never use or
look at D's std lib again. Except for meta programing and
toy/example programs where it doesn't matter.
What do you use instead? A buffer and Posix write() and
On Friday, 5 February 2016 at 07:04:27 UTC, cy wrote:
tl;dr speed demons use std.stream.InputStream.read() whenever
you can, and std.stream.OutputStream.write() its result.
Isn't std.stream deprecated?
On 02/05/16 14:38, Ola Fosheim Grøstad via Digitalmars-d-learn wrote:
> On Friday, 5 February 2016 at 12:35:14 UTC, Artur Skawina wrote:
>> call used to print diagnostics. What I saw made me never use or look at D's
>> std lib again. Except for meta programing and toy/example programs where it
On Thursday, 4 February 2016 at 10:18:35 UTC, ixid wrote:
Do you think your knowledge and experience is a good model for
how a new user who hasn't done much if any programming before
would approach this?
A design choice had to be made and made it was. Adding another
function now (or worse,
On Thursday, 4 February 2016 at 10:59:50 UTC, Mike Parker wrote:
IMO, while giving beginner's a helping hand is a great thing, I
don't think it's a good basis to use as a design for a standard
library.
Yes, better to have a "beginners toolkit" starting-point-codebase
and build a tutorial
On Thursday, 4 February 2016 at 11:04:23 UTC, cym13 wrote:
On Thursday, 4 February 2016 at 10:18:35 UTC, ixid wrote:
Do you think your knowledge and experience is a good model for
how a new user who hasn't done much if any programming before
would approach this?
A design choice had to be
On Thursday, February 04, 2016 00:40:55 ixid via Digitalmars-d-learn wrote:
> On Thursday, 4 February 2016 at 00:30:03 UTC, cym13 wrote:
> > On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote:
> >> It would be nice to have a simple writeln that adds spaces
> >> automatically like Python's
On Thursday, 4 February 2016 at 10:18:35 UTC, ixid wrote:
On Thursday, 4 February 2016 at 10:05:15 UTC, Jonathan M Davis
wrote:
I would normally expect someone to do that with writefln,
which would be cleaner. e.g.
writefln("%s %s %s %s", a, b, c, d);
Personally, I've never felt the need for
On Thursday, 4 February 2016 at 10:05:15 UTC, Jonathan M Davis
wrote:
I would normally expect someone to do that with writefln, which
would be cleaner. e.g.
writefln("%s %s %s %s", a, b, c, d);
Personally, I've never felt the need for a function like you're
describing.
- Jonathan M Davis
On Thursday, 4 February 2016 at 14:25:21 UTC, bachmeier wrote:
Unfortunately there is no such thing and it is unlikely to
exist in the next decade.
Well, it is probably not the best point in time to have absolute
beginners use D anyway. But a well commented library, that don't
focus on
On Thursday, 4 February 2016 at 15:32:48 UTC, Artur Skawina wrote:
void print(A...)(A a) {
foreach (N, ref e; a)
write(e, N==A.length-1?"\n":" ");
}
will be unrolled at compile time
Mind if I elaborate on this a bit? If that is unrolled, I
understand it will unroll
On Thursday, 4 February 2016 at 11:04:15 UTC, Ola Fosheim Grøstad
wrote:
On Thursday, 4 February 2016 at 10:59:50 UTC, Mike Parker wrote:
IMO, while giving beginner's a helping hand is a great thing,
I don't think it's a good basis to use as a design for a
standard library.
Yes, better to
On Thursday, 4 February 2016 at 14:25:21 UTC, bachmeier wrote:
Unfortunately there is no such thing and it is unlikely to
exist in the next decade.
There is http://forum.dlang.org/post/mtsd38$16ub$1...@digitalmars.com
On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote:
It would be nice to have a simple writeln that adds spaces
automatically like Python's 'print' in std.stdio, perhaps
called print.
There are many implementations of string interpolation in D (that
is what you want, basically). One of
On Thursday, 4 February 2016 at 13:46:46 UTC, Dejan Lekic wrote:
On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote:
It would be nice to have a simple writeln that adds spaces
automatically like Python's 'print' in std.stdio, perhaps
called print.
There are many implementations of
On 02/04/16 15:02, ixid via Digitalmars-d-learn wrote:
> On Thursday, 4 February 2016 at 13:46:46 UTC, Dejan Lekic wrote:
>> On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote:
>>> It would be nice to have a simple writeln that adds spaces automatically
>>> like Python's 'print' in
On Thursday, 4 February 2016 at 15:10:18 UTC, Kagamin wrote:
On Thursday, 4 February 2016 at 14:25:21 UTC, bachmeier wrote:
Unfortunately there is no such thing and it is unlikely to
exist in the next decade.
There is
http://forum.dlang.org/post/mtsd38$16ub$1...@digitalmars.com
The
On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote:
It would be nice to have a simple writeln that adds spaces
automatically like Python's 'print' in std.stdio, perhaps
called print.
It seems Andrei decided to add such function:
On 02/04/16 16:32, Artur Skawina wrote:
>
>void print(A...)(A a) {
> foreach (N, ref e; a)
> write(e, N==A.length-1?"\n":" ");
>}
BTW, that was *deliberately* written that way as a compromise
between efficiency and template bloat. It can of course be
done like
void
On Thursday, 4 February 2016 at 17:34:33 UTC, Artur Skawina wrote:
On 02/04/16 16:32, Artur Skawina wrote:
but that seems too expensive, when the use is just in toy
programs and debugging.
I hadn't really considered the relative cost-benefit, it's just a
habit to try to hardcode things at
On 02/04/16 18:53, ixid via Digitalmars-d-learn wrote:
> On Thursday, 4 February 2016 at 17:34:33 UTC, Artur Skawina wrote:
>> On 02/04/16 16:32, Artur Skawina wrote:
>> but that seems too expensive, when the use is just in toy programs and
>> debugging.
>
> I hadn't really considered the
On Thursday, 4 February 2016 at 00:30:03 UTC, cym13 wrote:
On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote:
It would be nice to have a simple writeln that adds spaces
automatically like Python's 'print' in std.stdio, perhaps
called print.
Sounds way too redundant to me.
Normally
On Thursday, 4 February 2016 at 00:23:07 UTC, ixid wrote:
It would be nice to have a simple writeln that adds spaces
automatically like Python's 'print' in std.stdio, perhaps
called print.
Sounds way too redundant to me.
On Thursday, February 04, 2016 00:23:07 ixid via Digitalmars-d-learn wrote:
> It would be nice to have a simple writeln that adds spaces
> automatically like Python's 'print' in std.stdio, perhaps called
> print.
If that's what you're looking for, I expect that most of us would think that
it's
28 matches
Mail list logo