Re: Struct inside a class: How to get outer?

2017-12-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, December 03, 2017 01:05:00 Nick Sabalausky via Digitalmars-d- learn wrote: > Is this even possible? My attempts: > > class Outer { > struct Inner { > void foo() { > // Error: no property 'outer' for type 'Inner' > Outer o = this.outer; > > //

Re: How to declare immutable struct outside of try catch and reference it later

2017-12-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, December 03, 2017 05:49:54 Fra Mecca via Digitalmars-d-learn wrote: > I have this code: > Configuration conf = void ; > try { > conf = parse_config("config.sdl"); > } catch (Exception e) { > std.stdio.stderr.writeln("Error reading configuration > file:

Struct inside a class: How to get outer?

2017-12-02 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
Is this even possible? My attempts: class Outer { struct Inner { void foo() { // Error: no property 'outer' for type 'Inner' Outer o = this.outer; // Error: cannot implicitly convert expression

How to declare immutable struct outside of try catch and reference it later

2017-12-02 Thread Fra Mecca via Digitalmars-d-learn
I have this code: Configuration conf = void ; try { conf = parse_config("config.sdl"); } catch (Exception e) { std.stdio.stderr.writeln("Error reading configuration file: ", e.msg); exit(1); } // other code function(value, conf); // end I get:

Re: std.range.interfaces : InputRange moveFront

2017-12-02 Thread Johan Engelen via Digitalmars-d-learn
On Friday, 1 December 2017 at 18:55:53 UTC, Steven Schveighoffer wrote: Once you popFront a byLine range, the element that was at front is now possibly invalid (the buffer may be reused). So in order to return the line from popFront, you have to store it somewhere. This means allocating

Re: std.range.interfaces : InputRange moveFront

2017-12-02 Thread Johan Engelen via Digitalmars-d-learn
On Friday, 1 December 2017 at 18:33:09 UTC, Ali Çehreli wrote: On 12/01/2017 07:21 AM, Steven Schveighoffer wrote: > On 12/1/17 4:29 AM, Johan Engelen wrote: >> (Also, I would expect "popFront" to return the element popped, but it >> doesn't, OK... > > pop removes the front element, but if

Re: scope(exit) and Ctrl-C

2017-12-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 3 December 2017 at 02:56:38 UTC, H. S. Teoh wrote: Ha! I've been using Linux for decades now and this is the first time I'm aware of this function. Should simplify my code when I'm not planning to be Posix-portable. Thanks! In the same vein, make sure you read about timerfd and

Re: scope(exit) and Ctrl-C

2017-12-02 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Dec 02, 2017 at 11:32:17AM +, Patrick Schluter via Digitalmars-d-learn wrote: > On Saturday, 2 December 2017 at 04:49:26 UTC, H. S. Teoh wrote: > > On Sat, Dec 02, 2017 at 04:38:29AM +, Adam D. Ruppe via > > Digitalmars-d-learn wrote: > > > [...] > > > > Signal handlers can

Re: Ddoc - No Documentation

2017-12-02 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 3 December 2017 at 00:25:34 UTC, Jonathan M Davis wrote: Presumably, because they are not things that you would ever explicitly use. The whole point of the documentation is to document what the types and functions being documented do and how to use them. If they're not something

Re: Windows Share Path

2017-12-02 Thread codephantom via Digitalmars-d-learn
On Saturday, 2 December 2017 at 14:23:48 UTC, Vino wrote: Hi, Even tried the Option "Run with Highest Privilege" but no luck. and also tried with option "Configure for : Windows Vista , Windows Server 2008" From, Vino.B You haven't accidently ticked the 'Do not store password' option?

Re: Ddoc - No Documentation

2017-12-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, December 03, 2017 00:14:10 Tony via Digitalmars-d-learn wrote: > Wondering what the rationale is for this: > > https://dlang.org/spec/ddoc.html#no_documentation > > No Documentation > > No documentation is generated for the following constructs, even > if they have a documentation

Ddoc - No Documentation

2017-12-02 Thread Tony via Digitalmars-d-learn
Wondering what the rationale is for this: https://dlang.org/spec/ddoc.html#no_documentation No Documentation No documentation is generated for the following constructs, even if they have a documentation comment: Invariants Postblits Destructors Static constructors and static destructors

Re: Instructions to build DMD from source don't work (anymore) here

2017-12-02 Thread Joakim via Digitalmars-d-learn
On Thursday, 30 November 2017 at 08:38:15 UTC, Basile B. wrote: Hi, I've recently switched from a linux distribution to another (F27). During the last 2 years i used a script to build DMD, unfortunately i forgot to include it in my backup. Initially i thought "No problem, there's the

Re: Windows Share Path

2017-12-02 Thread rjframe via Digitalmars-d-learn
On Sat, 02 Dec 2017 14:16:17 +, Vino wrote: > Hi, > >The script is schedule using a domain user id(domain\user id), > and the windows share are mapped using the same user id /password and > ran the scheduled task by login with the same domain user(Not > Administrator) , the script

Re: Windows Share Path

2017-12-02 Thread Vino via Digitalmars-d-learn
On Saturday, 2 December 2017 at 14:16:17 UTC, Vino wrote: On Saturday, 2 December 2017 at 13:05:37 UTC, rjframe wrote: [...] Hi, The script is schedule using a domain user id(domain\user id), and the windows share are mapped using the same user id /password and ran the scheduled task by

Re: Windows Share Path

2017-12-02 Thread Vino via Digitalmars-d-learn
On Saturday, 2 December 2017 at 13:05:37 UTC, rjframe wrote: On Sat, 02 Dec 2017 07:48:14 +, Vino wrote: On Saturday, 2 December 2017 at 05:08:27 UTC, Vino wrote: [...] Even tried with the below code, it works manually but not via Windows scheduler with option "Run whether user is

Re: Windows Share Path

2017-12-02 Thread rjframe via Digitalmars-d-learn
On Sat, 02 Dec 2017 07:48:14 +, Vino wrote: > On Saturday, 2 December 2017 at 05:08:27 UTC, Vino wrote: >> Hi All, >> >> Request your help, I have samll program which validates the >> file path, the script run perfectly when i run it manually, but if i >> run it via windows task scheduler i

Re: Windows Share Path

2017-12-02 Thread codephantom via Digitalmars-d-learn
On Saturday, 2 December 2017 at 07:48:14 UTC, Vino wrote: Even tried with the below code, it works manually but not via Windows scheduler with option "Run whether user is logged on or not" Are you using appropriate credentials in the scheduled task?

Re: scope(exit) and Ctrl-C

2017-12-02 Thread Patrick Schluter via Digitalmars-d-learn
On Saturday, 2 December 2017 at 04:49:26 UTC, H. S. Teoh wrote: On Sat, Dec 02, 2017 at 04:38:29AM +, Adam D. Ruppe via Digitalmars-d-learn wrote: [...] Signal handlers can potentially be invoked while inside a non-reentrant libc or OS function, so trying to do anything that (indirectly

Re: scope(exit) and Ctrl-C

2017-12-02 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-12-02 02:26, Adam D. Ruppe wrote: But this is intentional - there is no generic, reliable, cross-platform way of handling it natively. So you need to know the system and code it yourself. Not super hard but does take a bit of effort in your code. Since the "scope" block is not