std.getopt and std.datetime

2017-05-12 Thread Russel Winder via Digitalmars-d-learn
Is there a canonical, idiomatic way of processing std.datetime objects using std.getopt? Currently, I am suffering: /usr/include/d/std/getopt.d(921): Error: static assert "Dunno how to deal with type SysTime*" which on the one hand is understandable, albeit dreadful English, but then I

Re: Access specifiers and visibility

2017-05-12 Thread Andrew Edwards via Digitalmars-d-learn
On Thursday, 11 May 2017 at 04:35:22 UTC, Jesse Phillips wrote: On Wednesday, 10 May 2017 at 13:29:40 UTC, Andrew Edwards wrote: On Wednesday, 10 May 2017 at 13:13:46 UTC, Jesse Phillips wrote: On Wednesday, 10 May 2017 at 01:42:47 UTC, Andrew Edwards wrote: Attempting to update a git repo to

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-12 Thread Mike B Johnson via Digitalmars-d-learn
On Thursday, 11 May 2017 at 16:07:22 UTC, k-five wrote: On Wednesday, 10 May 2017 at 21:19:21 UTC, Stanislav Blinov wrote: On Wednesday, 10 May 2017 at 15:35:24 UTC, k-five wrote: On Wednesday, 10 May 2017 at 14:27:46 UTC, Stanislav Blinov

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 12 May 2017 at 21:26:01 UTC, Bastiaan Veelo wrote: On Friday, 12 May 2017 at 15:24:52 UTC, k-five wrote: A full version that I just added to my gitgub: https://github.com/k-five/dren You may like getopt[1] for command line argument parsing. https://dlang.org/phobos/std_getopt.html

Re: Lookahead in unittest

2017-05-12 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, May 12, 2017 at 05:23:23PM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] > Note, you can achieve what you want with version(unittest): > > version(unittest) > { >class A { B b; } >class B { } > } > > unittest > { >// use A and B here > } [...] This

Re: Lookahead in unittest

2017-05-12 Thread pineapple via Digitalmars-d-learn
On Friday, 12 May 2017 at 21:23:23 UTC, Steven Schveighoffer wrote: Note, you can achieve what you want with version(unittest): Please prefer `private version(unittest){...}` if the module might be imported by someone else's code, as to not pollute it with unneeded symbols

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread Bastiaan Veelo via Digitalmars-d-learn
On Friday, 12 May 2017 at 15:24:52 UTC, k-five wrote: A full version that I just added to my gitgub: https://github.com/k-five/dren You may like getopt[1] for command line argument parsing. https://dlang.org/phobos/std_getopt.html

Re: Lookahead in unittest

2017-05-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/10/17 12:53 PM, Raiderium wrote: On Wednesday, 10 May 2017 at 16:32:11 UTC, Adam D. Ruppe wrote: On Wednesday, 10 May 2017 at 16:09:06 UTC, Raiderium wrote: I can't figure out if this is intended behaviour. It is. A unittest is a function, and in functions, all declarations must be

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread Bastiaan Veelo via Digitalmars-d-learn
On Friday, 12 May 2017 at 15:24:52 UTC, k-five wrote: On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote: I was waiting for a stable version of C++17 ( standard library ) to add some features of fileSystem in C++17 to my program that wants to iterate through all files in a directory

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-12 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, May 12, 2017 at 12:47:04PM +0200, ag0aep6g via Digitalmars-d-learn wrote: > On 05/12/2017 10:32 AM, k-five wrote: > > Interesting! I was worried about performance and for that I did not > > want to use try-catch. > > So (isNumberic) is a good solution. > >

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread k-five via Digitalmars-d-learn
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote: I was waiting for a stable version of C++17 ( standard library ) to add some features of fileSystem in C++17 to my program that wants to iterate through all files in a directory recursively. I was thinking how could I do for implementing

Re: Processing a gzipped csv-file by line-by-line

2017-05-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/11/17 8:18 PM, H. S. Teoh via Digitalmars-d-learn wrote: On Wed, May 10, 2017 at 11:40:08PM +, Jesse Phillips via Digitalmars-d-learn wrote: If you can get the zip to decompress into a range of dchar then std.csv will work with it. It is by far not the fastest, but much speed is

Re: Processing a gzipped csv-file by line-by-line

2017-05-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/10/17 7:17 PM, Nicholas Wilson wrote: On Wednesday, 10 May 2017 at 22:20:52 UTC, Nordlöw wrote: What's fastest way to on-the-fly-decompress and process a gzipped csv-fil line by line? Is it possible to combine http://dlang.org/phobos/std_zlib.html with some stream variant of

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread k-five via Digitalmars-d-learn
On Friday, 12 May 2017 at 12:56:50 UTC, drug wrote: 12.05.2017 14:58, k-five пишет: On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote: On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote: --- also .each!writeln should be possible

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread drug via Digitalmars-d-learn
12.05.2017 14:58, k-five пишет: On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote: On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote: --- Shorter: void main( string[] args ){ dirEntries( ".", SpanMode.depth, false )

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread Bastiaan Veelo via Digitalmars-d-learn
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote: I was waiting for a stable version of C++17 ( standard library ) to add some features of fileSystem in C++17 to my program that wants to iterate through all files in a directory recursively. I was thinking how could I do for implementing

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread cym13 via Digitalmars-d-learn
On Friday, 12 May 2017 at 11:58:23 UTC, k-five wrote: On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote: [...] --- [...] - Thanks and the correct syntax for each! is, passing a

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread k-five via Digitalmars-d-learn
On Friday, 12 May 2017 at 11:41:57 UTC, cym13 wrote: On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote: --- Shorter: void main( string[] args ){ dirEntries( ".", SpanMode.depth, false ) .filter!( file =>

Re: As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread cym13 via Digitalmars-d-learn
On Friday, 12 May 2017 at 11:10:01 UTC, k-five wrote: I was waiting for a stable version of C++17 ( standard library ) to add some features of fileSystem in C++17 to my program that wants to iterate through all files in a directory recursively. I was thinking how could I do for implementing

As many thanks As possible to who crates D and UFCS feature

2017-05-12 Thread k-five via Digitalmars-d-learn
I was waiting for a stable version of C++17 ( standard library ) to add some features of fileSystem in C++17 to my program that wants to iterate through all files in a directory recursively. I was thinking how could I do for implementing that and add it to my program. Now after starting to

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-12 Thread ag0aep6g via Digitalmars-d-learn
On 05/12/2017 10:32 AM, k-five wrote: Interesting! I was worried about performance and for that I did not want to use try-catch. So (isNumberic) is a good solution. http://dlang.org/phobos/std_traits.html#isNumeric If you're doing this for speed, you better be benchmarking. Exceptions are

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-12 Thread k-five via Digitalmars-d-learn
On Friday, 12 May 2017 at 09:03:39 UTC, Jonathan M Davis wrote: That's the wrong isNumeric. Unfortunately, both std.string and std.traits have an isNumeric. std.traits.isNumeric is an eponymous template that tests whether a type is an integral or floating point type, whereas

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 12, 2017 08:32:03 k-five via Digitalmars-d-learn wrote: > On Thursday, 11 May 2017 at 19:59:55 UTC, Jordan Wilson wrote: > > On Thursday, 11 May 2017 at 18:07:47 UTC, H. S. Teoh wrote: > >> On Thu, May 11, 2017 at 05:55:03PM +, k-five via > >> > >> Digitalmars-d-learn wrote: >

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-12 Thread k-five via Digitalmars-d-learn
On Friday, 12 May 2017 at 08:32:03 UTC, k-five wrote: On Thursday, 11 May 2017 at 19:59:55 UTC, Jordan Wilson wrote: On Thursday, 11 May 2017 at 18:07:47 UTC, H. S. Teoh wrote: On Thu, May 11, 2017 at 05:55:03PM +, k-five via Digitalmars-d-learn wrote: On Thursday, 11 May 2017 at 17:18:37

Re: How to avoid throwing an exceptions for a built-in function?

2017-05-12 Thread k-five via Digitalmars-d-learn
On Thursday, 11 May 2017 at 19:59:55 UTC, Jordan Wilson wrote: On Thursday, 11 May 2017 at 18:07:47 UTC, H. S. Teoh wrote: On Thu, May 11, 2017 at 05:55:03PM +, k-five via Digitalmars-d-learn wrote: On Thursday, 11 May 2017 at 17:18:37 UTC, crimaniak wrote: > On Wednesday, 10 May 2017 at