Re: setting stringImportPaths in dub.json

2016-03-20 Thread cy via Digitalmars-d-learn
On Monday, 21 March 2016 at 04:58:37 UTC, cy wrote: I also tried symlinking ../sharedViews into views/shared and importing "shared/common.stuff" but that didn't work either. Oh. I was editing dub.selections.json. Never mind, I'm just an idiot.

Re: setting stringImportPaths in dub.json

2016-03-20 Thread cy via Digitalmars-d-learn
I also tried symlinking ../sharedViews into views/shared and importing "shared/common.stuff" but that didn't work either.

setting stringImportPaths in dub.json

2016-03-20 Thread cy via Digitalmars-d-learn
"stringImportPaths": ["../sharedViews/"] nope... "buildSettings": { "stringImportPaths": ["../sharedViews/"] } nope... "package": { "name": "myownfreakingpackage", "buildSettings": { "stringImportPaths": ["../sharedViews/"] } } nope...

Re: Linux blocked on file read on exit, need select

2016-03-20 Thread cy via Digitalmars-d-learn
I don't know, but you could always just use fcntl if you already can assume you're on Linux. extern (C) int fcntl(int, int, int); C keeps the constants under lock and key of course, so you have to specify them manually. But you could write a C program to print them out, or generate D code I

Linux blocked on file read on exit, need select

2016-03-20 Thread Darrell Gallion via Digitalmars-d-learn
Program is blocked on exit, because of a blocking file read. I'd be glad to just kill it and exit. In this case I'm using dinotify, I exposed the fd. This issue is it's not working or blocked on exit. Never mind the constant monitor.add static immutable string stdoutFn="passFiles/vAppStdout";

Re: Obtaining argument names in (variadic) functions

2016-03-20 Thread JR via Digitalmars-d-learn
On Thursday, 17 March 2016 at 14:12:38 UTC, Edwin van Leeuwen wrote: On Thursday, 17 March 2016 at 13:53:00 UTC, JR wrote: Interesting, any idea if it is possible to do assignment within template.. Either: printVars!(int abc=5,string def="58")(); or something like

Re: Destructor order

2016-03-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/18/16 11:07 AM, Andrea Fontana wrote: On Friday, 18 March 2016 at 15:03:14 UTC, Steven Schveighoffer wrote: Structs are contained completely within the class instance memory block (e.g. the OP's code). Classes are references. They are not destroyed when you destroy the holder, that is left

Solution to "statement is not reachable" depending on template variables?

2016-03-20 Thread Johan Engelen via Digitalmars-d-learn
Hi all, I've found discussions, but not an actual "recommended" solution for the problem of "statement is not reachable" warnings in templates with early returns, e.g.: ``` bool nobool(T...)() { foreach (i, U; T) { static if (is(U == bool)) { return false; }

Re: Class member always has the same address

2016-03-20 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 20 March 2016 at 09:53:07 UTC, szymski wrote: Ok, I understand now, thanks. I used C# a lot before and there default initialization worked like per instance initialization. Yes, I assumed you were thinking of C# or Java classes with this. When coming to a new language, it's

Re: Checking if a port is listening

2016-03-20 Thread Anonymouse via Digitalmars-d-learn
On Thursday, 17 March 2016 at 10:41:55 UTC, Marc Schütz wrote: On Wednesday, 16 March 2016 at 22:22:15 UTC, Anonymouse wrote: import core.thread; // for .seconds Nitpick: `seconds` is defined in `core.time`; `core.thread` just reexports it. s.setOption(SocketOptionLevel.SOCKET, SNDTIMEO,

Re: Need help with delegates and vibed

2016-03-20 Thread Suliman via Digitalmars-d-learn
The constructor for HTTPClientRequest is likely undocumented because you should not construct it yourself; vibe.d constructs it and passes it to the function you register with listenHTTP. How to understand looking at docs that it work as you saying?

Re: Class member always has the same address

2016-03-20 Thread szymski via Digitalmars-d-learn
On Sunday, 20 March 2016 at 02:21:51 UTC, Mike Parker wrote: On Saturday, 19 March 2016 at 20:24:15 UTC, szymski wrote: class A { B b = new B(); } This is *default* initialization, not per instance initialization. The compiler will create one instance of B and it will become the

Re: immutable array in constructor

2016-03-20 Thread tsbockman via Digitalmars-d-learn
On Thursday, 17 March 2016 at 10:11:43 UTC, Jeff Thompson wrote: This is a simplified example from a larger class I have where I need an immutable constructor. This is because I need to construct an object an pass it to other functions which take an immutable object. So, how to keep an

Something wrong with GC

2016-03-20 Thread stunaep via Digitalmars-d-learn
The gc throws invalid memory errors if I use Arrays from std.container. For example, this throws an InvalidMemoryOperationError: import std.stdio; import std.container; void main() { new Test(); } class Test { private Array!string test = Array!string();

Re: Solution to "statement is not reachable" depending on template variables?

2016-03-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/16/16 7:18 AM, Johan Engelen wrote: Hi all, I've found discussions, but not an actual "recommended" solution for the problem of "statement is not reachable" warnings in templates with early returns, e.g.: ``` bool nobool(T...)() { foreach (i, U; T) { static if (is(U ==

Need help with delegates and vibed

2016-03-20 Thread Suliman via Digitalmars-d-learn
I can't understand how to get works delegates works from this doc http://vibed.org/api/vibe.http.client/requestHTTP I see example, but when I am looking on Prototypes I really can't figure how to use them. For example what does this mean: scope void delegate(scope HTTPClientRequest)

Re: Need help with delegates and vibed

2016-03-20 Thread Mathias Lang via Digitalmars-d-learn
On Wednesday, 16 March 2016 at 20:08:40 UTC, Suliman wrote: I can't understand how to get works delegates works from this doc http://vibed.org/api/vibe.http.client/requestHTTP I see example, but when I am looking on Prototypes I really can't figure how to use them. For example what does