Posting here instead of learn because I think it uncovers a
design flaw
void main(string[] args)
{
import std.file : dirEntries, SpanMode;
import std.stdio : writeln;
foreach(file; dirEntries(args[1], SpanMode.depth))
writeln(file.name);
}
Modify this program such that it wi
On Friday, 18 September 2015 at 11:35:45 UTC, John Colvin wrote:
Posting here instead of learn because I think it uncovers a
design flaw
void main(string[] args)
{
import std.file : dirEntries, SpanMode;
import std.stdio : writeln;
foreach(file; dirEntries(args[1], SpanMode.depth))
On Friday, 18 September 2015 at 11:35:45 UTC, John Colvin wrote:
Posting here instead of learn because I think it uncovers a
design flaw
void main(string[] args)
{
import std.file : dirEntries, SpanMode;
import std.stdio : writeln;
foreach(file; dirEntries(args[1], SpanMode.depth))
On Friday, 18 September 2015 at 11:54:32 UTC, Robert burner
Schadek wrote:
http://dlang.org/phobos/std_exception.html#.handle
foreach(file; dirEntries(args[1], SpanMode.depth)
.handle!(Exception, RangePrimitive.front, (e, r) =>
DirEntry())) {
writeln(file.name);
}
change Exception
On Friday, 18 September 2015 at 11:54:32 UTC, Robert burner
Schadek wrote:
On Friday, 18 September 2015 at 11:35:45 UTC, John Colvin wrote:
Posting here instead of learn because I think it uncovers a
design flaw
void main(string[] args)
{
import std.file : dirEntries, SpanMode;
import
On Friday, 18 September 2015 at 12:17:25 UTC, John Colvin wrote:
That's neat, didn't know about std.exception.handle
It is at least a year old. I created it because I had a range
that threw, and there was nothing to keep a range going or
reenter it.
Unfortunately, I think there are two pr
On Friday, 18 September 2015 at 12:27:37 UTC, Robert burner
Schadek wrote:
On Friday, 18 September 2015 at 12:17:25 UTC, John Colvin wrote:
That's neat, didn't know about std.exception.handle
It is at least a year old. I created it because I had a range
that threw, and there was nothing to ke
On Friday, 18 September 2015 at 12:42:26 UTC, John Colvin wrote:
Yes, but implicit in this being an OK solution for people is
that no-one ever reorganises the internals of DirIteratorImpl.
I guess One could use handle to deal with *all* the range
primitives as a defensive countermeasure.
yes,
On Friday, 18 September 2015 at 12:42:26 UTC, John Colvin wrote:
well, creating a DirEntry is not a range operation. handle
can't help you there.
Yup :(
I think you could use std.exception.ifThrown in this case.
foreach(file; dirEntries(args[1], SpanMode.depth)
.ifThrown(Di
On 18-Sep-2015 15:03, Adrian Matoga wrote:
On Friday, 18 September 2015 at 11:35:45 UTC, John Colvin wrote:
Posting here instead of learn because I think it uncovers a design flaw
void main(string[] args)
{
import std.file : dirEntries, SpanMode;
import std.stdio : writeln;
foreach(
On Friday, 18 September 2015 at 14:35:39 UTC, Dmitry Olshansky
wrote:
On 18-Sep-2015 15:03, Adrian Matoga wrote:
On Friday, 18 September 2015 at 11:35:45 UTC, John Colvin
wrote:
Posting here instead of learn because I think it uncovers a
design flaw
void main(string[] args)
{
import std.f
11 matches
Mail list logo