Am 24.03.2015 um 21:19 schrieb Steven Schveighoffer:
On 3/24/15 4:11 PM, Andrei Alexandrescu wrote:
On 3/24/15 11:56 AM, "Jacques =?UTF-8?B?TcO8bGxlciI=?=
" wrote:
On Tuesday, 24 March 2015 at 13:09:21 UTC, Steven Schveighoffer wrote:
New code:
immutable nfields = header.count('\t');
...
outp
On 3/24/15 4:38 PM, Dylan Knutson wrote:
immutable nfields = header.count('\t');
...
output.writeln(cycle("\t-").take(2 * nfields));
Super-win, now I only ever have to update the original column list.
Little things like this are what make me love D.
-Steve
I see that `take` returns a lazy ra
On Tuesday, 24 March 2015 at 13:09:21 UTC, Steven Schveighoffer
wrote:
Recently, while updating a D utility I wrote to process a
binary log file into a tab-separated text file, I found a nice
use for ranges.
So I have N columns, separated by tabs. The header looks like
this:
"TIME\tCOL1\tCO
immutable nfields = header.count('\t');
...
output.writeln(cycle("\t-").take(2 * nfields));
Super-win, now I only ever have to update the original column
list.
Little things like this are what make me love D.
-Steve
I see that `take` returns a lazy range. That's really neat! How
does write
On 3/24/15 4:11 PM, Andrei Alexandrescu wrote:
On 3/24/15 11:56 AM, "Jacques =?UTF-8?B?TcO8bGxlciI=?=
" wrote:
On Tuesday, 24 March 2015 at 13:09:21 UTC, Steven Schveighoffer wrote:
New code:
immutable nfields = header.count('\t');
...
output.writeln(cycle("\t-").take(2 * nfields));
output.w
On 3/24/15 11:56 AM, "Jacques =?UTF-8?B?TcO8bGxlciI=?=
" wrote:
On Tuesday, 24 March 2015 at 13:09:21 UTC, Steven Schveighoffer wrote:
New code:
immutable nfields = header.count('\t');
...
output.writeln(cycle("\t-").take(2 * nfields));
output.writeln("\t-".repeat(nfields).join);
output.wri
On 3/24/2015 11:35 AM, Adam D. Ruppe wrote:
On Tuesday, 24 March 2015 at 18:16:08 UTC, Dicebot wrote:
Can be nice entry for weekly D newsletter tips & tricks.
Aye, write it up!
Also, as a Phobos example for take or cycle.
On Tuesday, 24 March 2015 at 13:09:21 UTC, Steven Schveighoffer
wrote:
New code:
immutable nfields = header.count('\t');
...
output.writeln(cycle("\t-").take(2 * nfields));
output.writeln("\t-".repeat(nfields).join);
On Tuesday, 24 March 2015 at 18:16:08 UTC, Dicebot wrote:
Can be nice entry for weekly D newsletter tips & tricks.
Aye, write it up!
On Tuesday, 24 March 2015 at 13:09:21 UTC, Steven Schveighoffer
wrote:
Recently, while updating a D utility I wrote to process a
binary log file into a tab-separated text file, I found a nice
use for ranges.
So I have N columns, separated by tabs. The header looks like
this:
"TIME\tCOL1\tCO
Recently, while updating a D utility I wrote to process a binary log
file into a tab-separated text file, I found a nice use for ranges.
So I have N columns, separated by tabs. The header looks like this:
"TIME\tCOL1\tCOL2\t..."
With about 30 or 40 columns.
The first output is a line like thi
"bearophile" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nick Sabalausky:
>> bearophile:
>> > But the dynamic languages allow you to save time in other ways.
>>
>> I'd argue that most of those time-saving things are things that have
>> absolutely nothing to do with dynamic typing
Nick Sabalausky:
> bearophile:
> > But the dynamic languages allow you to save time in other ways.
>
> I'd argue that most of those time-saving things are things that have
> absolutely nothing to do with dynamic typing and are perfectly possible with
> static typing.
I mostly agree, what I want
"bearophile" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> But the dynamic languages allow you to save time in other ways.
I'd argue that most of those time-saving things are things that have
absolutely nothing to do with dynamic typing and are perfectly possible with
static t
"Robert Fraser" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Nick Sabalausky Wrote:
>> That's the reason I refuse to use dynamic languages and
>> indentation-syntax
>> languages whenever I have a choice. They're nothing but a giant step
>> backwards, constantly replacing the most
Don:
> I think for dynamic languages, test-driven development is mandatory.
I generally write tests after the code in all languages I use :-) Maybe I'll
learn to use TDD in the future, who knows.
> But you have to write zillions of tests because the compiler accepts all
> kinds of garbage. [..
bearophile wrote:
Bill Baxter:
You never mistype the name of a variable?
Probably I do such mistakes often or very often, but I test every little piece
of code I write, so such bugs are fixed seconds or minutes after I have put
them in, so even not using an IDE I have never felt it as proble
Nick Sabalausky Wrote:
> That's the reason I refuse to use dynamic languages and indentation-syntax
> languages whenever I have a choice. They're nothing but a giant step
> backwards, constantly replacing the most basic and standard compiler
> diagnostics with the world's most unnecessary runtim
On Thu, 04 Dec 2008 17:44:34 -0500, Nick Sabalausky wrote:
> "bearophile" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Bill Baxter:
>>>And I also got increasingly annoyed by the silly runtime errors that
>>>any decent compiler would tell me about.<
>>
>> Generally I don't have
On Fri, 5 Dec 2008 07:45:27 +0900, Bill Baxter wrote:
> On Fri, Dec 5, 2008 at 6:07 AM, bearophile <[EMAIL PROTECTED]> wrote:
>> Generally I don't have such problems, but maybe my style of coding is quite
>> "careful" anyway.
> You never mistype the name of a variable?
"careful" != "perfect"
Bill Baxter:
> You never mistype the name of a variable?
Probably I do such mistakes often or very often, but I test every little piece
of code I write, so such bugs are fixed seconds or minutes after I have put
them in, so even not using an IDE I have never felt it as problem :-)
There are far
On Fri, Dec 5, 2008 at 6:07 AM, bearophile <[EMAIL PROTECTED]> wrote:
> Bill Baxter:
>
>>It was sitting down and realizing that with OCaml I was basically going to
>>have to re-learn how to do everything I already knew how to do, but using
>>Monads or whatever.<
>
> A little learning pain may be
"bearophile" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Bill Baxter:
>>And I also got increasingly annoyed by the silly runtime errors that any
>>decent compiler would tell me about.<
>
> Generally I don't have such problems, but maybe my style of coding is
> quite "careful" a
Bill Baxter:
>It was sitting down and realizing that with OCaml I was basically going to
>have to re-learn how to do everything I already knew how to do, but using
>Monads or whatever.<
A little learning pain may be useful to grow. So learning some functional
programming may be positive.
It ma
ownership and total control.
Now I just wish the BigMegaCorps of the world would take notice and
write us some nice VisualStudio-caliber integrated gui IDE/debuggers.
--bb
On Fri, Dec 5, 2008 at 4:20 AM, bearophile <[EMAIL PROTECTED]> wrote:
> Few moths ago someone here has implicitaly
Few moths ago someone here has implicitaly asked why I like D, now I can
answer. Feel free to skip this boring wall of text.
I don't like the syntax and rules of C++, to me they look ugly, confusing and
too much complex, and when I can I avoid this language. It makes me waste too
much
26 matches
Mail list logo