Re: It makes me sick!

2017-07-27 Thread FoxyBrown via Digitalmars-d-learn
On Friday, 28 July 2017 at 01:10:03 UTC, Mike Parker wrote: On Friday, 28 July 2017 at 00:28:52 UTC, FoxyBrown wrote: You are not being very logical. The zip file as N files in it. No matter what those files are, it should be a closed system. That is, if I insert or add(not replace) M file

Re: DDox and filters.

2017-07-27 Thread Danni Coy via Digitalmars-d-learn
yup figured it out - module documentation needs to go *above* the module declaration or you get nothing. On Fri, Jul 28, 2017 at 11:53 AM, Soulsbane via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Thursday, 27 July 2017 at 03:01:50 UTC, Danni Coy wrote: > >> I am trying

Re: DDox and filters.

2017-07-27 Thread Soulsbane via Digitalmars-d-learn
On Thursday, 27 July 2017 at 03:01:50 UTC, Danni Coy wrote: I am trying to build my projects documentation via the ddox system via dub. It seems that my modules are being documented and then filtered out. Ironically for a documentation system there isn't a lot of documentation. What is the

Re: using DCompute

2017-07-27 Thread jmh530 via Digitalmars-d-learn
On Friday, 28 July 2017 at 01:30:58 UTC, Nicholas Wilson wrote: Yes, although I'll have to add an attribute shim layer for the dcompute druntime symbols to be accessible for DMD. When you compile LDC will produce .ptx and .spv files in the object file directory which will be able to be used

Re: using DCompute

2017-07-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 28 July 2017 at 00:39:43 UTC, James Dean wrote: On Friday, 28 July 2017 at 00:23:35 UTC, Nicholas Wilson wrote: On Thursday, 27 July 2017 at 21:33:29 UTC, James Dean wrote: I'm interested in trying it out, says it's just for ldc. Can we simply compile it using ldc then import it and

Re: It makes me sick!

2017-07-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 28 July 2017 at 00:28:52 UTC, FoxyBrown wrote: You are not being very logical. The zip file as N files in it. No matter what those files are, it should be a closed system. That is, if I insert or add(not replace) M file to the directory structure it should not break D, period!

Re: using DCompute

2017-07-27 Thread James Dean via Digitalmars-d-learn
On Friday, 28 July 2017 at 00:23:35 UTC, Nicholas Wilson wrote: On Thursday, 27 July 2017 at 21:33:29 UTC, James Dean wrote: I'm interested in trying it out, says it's just for ldc. Can we simply compile it using ldc then import it and use dmd, ldc, or gdc afterwards? The ability to write

Re: It makes me sick!

2017-07-27 Thread FoxyBrown via Digitalmars-d-learn
On Thursday, 27 July 2017 at 23:37:41 UTC, Jonathan M Davis wrote: On Thursday, July 27, 2017 11:55:21 Ali Çehreli via Digitalmars-d-learn wrote: On 07/27/2017 11:47 AM, Adam D. Ruppe wrote: > On Thursday, 27 July 2017 at 18:35:02 UTC, FoxyBrown wrote: >> But the issue was about missing

Re: using DCompute

2017-07-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 27 July 2017 at 21:33:29 UTC, James Dean wrote: I'm interested in trying it out, says it's just for ldc. Can we simply compile it using ldc then import it and use dmd, ldc, or gdc afterwards? The ability to write kernels is limited to LDC, though there is no practical reason

Re: It makes me sick!

2017-07-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, July 27, 2017 11:55:21 Ali Çehreli via Digitalmars-d-learn wrote: > On 07/27/2017 11:47 AM, Adam D. Ruppe wrote: > > On Thursday, 27 July 2017 at 18:35:02 UTC, FoxyBrown wrote: > >> But the issue was about missing symbols, not anything "extra". If > >> datatime.d is there but nothing

Re: Pass range to a function

2017-07-27 Thread Ali Çehreli via Digitalmars-d-learn
On 07/27/2017 02:16 PM, Chris wrote: > What is the value of `???` in the following program: > void categorize(??? toks) { > foreach (t; toks) { > writeln(t); > } > } The easiest solution is to make it a template (R is a suitable template variable name for a range type): void

using DCompute

2017-07-27 Thread James Dean via Digitalmars-d-learn
I'm interested in trying it out, says it's just for ldc. Can we simply compile it using ldc then import it and use dmd, ldc, or gdc afterwards? --- a SPIRV capable LLVM (available here to build ldc to to support SPIRV (required for OpenCL)). or LDC built with any LLVM 3.9.1 or greater that

Pass range to a function

2017-07-27 Thread Chris via Digitalmars-d-learn
I'm using regex `matchAll`, and mapping it to get a sequence of strings. I then want to pass that sequence to a function. What is the general "sequence of strings" type declaration I'd need to use? In C#, it'd be `IEnumerable`. I'd rather not do a to-array on the sequence, if possible. (e.g.

Re: Problem with dtor behavior

2017-07-27 Thread Moritz Maxeiner via Digitalmars-d-learn
On Thursday, 27 July 2017 at 19:19:27 UTC, SrMordred wrote: //D-CODE struct MyStruct{ int id; this(int id){ writeln("ctor"); } ~this(){ writeln("dtor"); } } MyStruct* obj; void push(T)(auto ref T value){ obj[0] = value; } void main() { obj =

Randomed/encoded code

2017-07-27 Thread James Dean via Digitalmars-d-learn
I would like to encode code in such a way that each compilation produces "random" code as compared to what the previous compilation produced, but ultimately the same code is ran each time(same effect). Basically we can code a function that does a job X in many different ways. Each way looks

Re: It makes me sick!

2017-07-27 Thread Jesse Phillips via Digitalmars-d-learn
On Thursday, 27 July 2017 at 03:34:19 UTC, FoxyBrown wrote: Knowing that every time I upgrade to the latest "official" D compiler I run in to trouble: I recompiled gtkD with the new compiler, same result. My code was working before the upgrade just fine and I did not change anything. I've

Re: It makes me sick!

2017-07-27 Thread Ali Çehreli via Digitalmars-d-learn
On 07/27/2017 12:24 PM, Steven Schveighoffer wrote: On 7/27/17 3:00 PM, Ali Çehreli wrote: On 07/27/2017 11:54 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > You ended up with two versions of std.datetime. One was the module, and the > other was the package. I don't know how many

Re: It makes me sick!

2017-07-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/27/17 3:00 PM, Ali Çehreli wrote: On 07/27/2017 11:54 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > You ended up with two versions of std.datetime. One was the module, and the > other was the package. I don't know how many people install from the zip file but I think the zip

Problem with dtor behavior

2017-07-27 Thread SrMordred via Digitalmars-d-learn
//D-CODE struct MyStruct{ int id; this(int id){ writeln("ctor"); } ~this(){ writeln("dtor"); } } MyStruct* obj; void push(T)(auto ref T value){ obj[0] = value; } void main() { obj = cast(MyStruct*)malloc( MyStruct.sizeof ); push(MyStruct(1)); }

Re: It makes me sick!

2017-07-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/27/17 2:54 PM, Jonathan M Davis via Digitalmars-d-learn wrote: You ended up with two versions of std.datetime. One was the module, and the other was the package. importing std.datetime could have imported either of them. dmd _should_ generate an error in that case, but I don't know if it

Re: It makes me sick!

2017-07-27 Thread Ali Çehreli via Digitalmars-d-learn
On 07/27/2017 11:54 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > You ended up with two versions of std.datetime. One was the module, and the > other was the package. I don't know how many people install from the zip file but I think the zip file should include a datetime.d file with

Re: It makes me sick!

2017-07-27 Thread Ali Çehreli via Digitalmars-d-learn
On 07/27/2017 11:47 AM, Adam D. Ruppe wrote: On Thursday, 27 July 2017 at 18:35:02 UTC, FoxyBrown wrote: But the issue was about missing symbols, not anything "extra". If datatime.d is there but nothing is using it, why should it matter? YOU were using it with an `import std.datetime;` line.

Re: It makes me sick!

2017-07-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/27/17 2:35 PM, FoxyBrown wrote: On Thursday, 27 July 2017 at 18:14:52 UTC, Steven Schveighoffer wrote: On 7/27/17 1:58 PM, FoxyBrown wrote: On Thursday, 27 July 2017 at 12:23:52 UTC, Jonathan M Davis wrote: On Wednesday, July 26, 2017 22:29:00 Ali Çehreli via Digitalmars-d-learn wrote:

Re: It makes me sick!

2017-07-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, July 27, 2017 18:35:02 FoxyBrown via Digitalmars-d-learn wrote: > On Thursday, 27 July 2017 at 18:14:52 UTC, Steven Schveighoffer > > wrote: > > On 7/27/17 1:58 PM, FoxyBrown wrote: > >> On Thursday, 27 July 2017 at 12:23:52 UTC, Jonathan M Davis > >> > >> wrote: > >>> On Wednesday,

Re: It makes me sick!

2017-07-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 27 July 2017 at 18:47:57 UTC, Adam D. Ruppe wrote: YOU were using it with an `import std.datetime;` line Of course, it is also possible that import was through a dependency of something you used, possibly including the standard library.

Re: It makes me sick!

2017-07-27 Thread FoxyBrown via Digitalmars-d-learn
On Thursday, 27 July 2017 at 18:14:52 UTC, Steven Schveighoffer wrote: On 7/27/17 1:58 PM, FoxyBrown wrote: On Thursday, 27 July 2017 at 12:23:52 UTC, Jonathan M Davis wrote: On Wednesday, July 26, 2017 22:29:00 Ali Çehreli via Digitalmars-d-learn wrote: On 07/26/2017 09:20 PM, FoxyBrown

Re: It makes me sick!

2017-07-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, July 27, 2017 14:14:52 Steven Schveighoffer via Digitalmars-d- learn wrote: > On 7/27/17 1:58 PM, FoxyBrown wrote: > > I do not use the installer, I use the zip file. I assumed that > > everything would be overwritten and any old stuff would simply go > > unused.. but it seems it

Re: It makes me sick!

2017-07-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/27/17 1:58 PM, FoxyBrown wrote: On Thursday, 27 July 2017 at 12:23:52 UTC, Jonathan M Davis wrote: On Wednesday, July 26, 2017 22:29:00 Ali Çehreli via Digitalmars-d-learn wrote: On 07/26/2017 09:20 PM, FoxyBrown wrote: >> Somebody else had the same problem which they solved by removing

Re: It makes me sick!

2017-07-27 Thread FoxyBrown via Digitalmars-d-learn
On Thursday, 27 July 2017 at 12:23:52 UTC, Jonathan M Davis wrote: On Wednesday, July 26, 2017 22:29:00 Ali Çehreli via Digitalmars-d-learn wrote: On 07/26/2017 09:20 PM, FoxyBrown wrote: >> Somebody else had the same problem which they solved by removing >> >> "entire dmd": >>

Re: Hacking the compiler: Get Scope after some line of function

2017-07-27 Thread unDEFER via Digitalmars-d-learn
On Thursday, 27 July 2017 at 11:59:51 UTC, unDEFER wrote: So how to get scope e.g. after line "B b;"? I have found. That in scopes was found symbols from declarations, you must iterate by declarations (DeclarationExp) and add symbols by sc.insert(decexp.declaration);

Re: Profiling after exit()

2017-07-27 Thread Mario Kröplin via Digitalmars-d-learn
On Thursday, 27 July 2017 at 14:44:31 UTC, Temtaime wrote: Also there was an issue that profiling doesn't work with multi-threaded apps and leads to a crash. Don't know if it is fixed. Was fixed two years ago: http://forum.dlang.org/post/mia2kf$djb$1...@digitalmars.com

Re: Profiling after exit()

2017-07-27 Thread Eugene Wissner via Digitalmars-d-learn
On Thursday, 27 July 2017 at 14:52:18 UTC, Stefan Koch wrote: On Thursday, 27 July 2017 at 14:30:33 UTC, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the code with -profile, send a SIGTERM and

Re: Profiling after exit()

2017-07-27 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 27 July 2017 at 14:30:33 UTC, Eugene Wissner wrote: I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the code with -profile, send a SIGTERM and call exit(0) from my signal handler to exit the program. The

Re: Profiling after exit()

2017-07-27 Thread Temtaime via Digitalmars-d-learn
Also there was an issue that profiling doesn't work with multi-threaded apps and leads to a crash. Don't know if it is fixed.

Re: Profiling after exit()

2017-07-27 Thread Temtaime via Digitalmars-d-learn
Exit is not "normal exit" for D programs so, do not use it. Your threads should stop at some point to make able the app exit successfully. There's a "join" method. You can use it with your "done" variable.

Profiling after exit()

2017-07-27 Thread Eugene Wissner via Digitalmars-d-learn
I have a multi-threaded application, whose threads normally run forever. But I need to profile this program, so I compile the code with -profile, send a SIGTERM and call exit(0) from my signal handler to exit the program. The problem is that I get the profiling information only from the main

Re: It makes me sick!

2017-07-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, July 26, 2017 22:29:00 Ali Çehreli via Digitalmars-d-learn wrote: > On 07/26/2017 09:20 PM, FoxyBrown wrote: > >> Somebody else had the same problem which they solved by removing > >> > >> "entire dmd": > >> http://forum.dlang.org/thread/ejybuwermnentslcy...@forum.dlang.org >

Re: unittest blocks not being run inside of class and struct templates

2017-07-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 25, 2017 09:31:28 Steven Schveighoffer via Digitalmars-d- learn wrote: > The unfortunate thing is that if you want to have non-templated unit > tests, you have to put them outside the struct itself. This sucks for > documented unit tests, and for tests being close to the thing

Hacking the compiler: Get Scope after some line of function

2017-07-27 Thread unDEFER via Digitalmars-d-learn
Hello! I'm trying to do some strange thing: compile some Statement (do semantic3 phase) in the scope of other function. Other function is for example: auto megafunction() { B b; uint a = 25; return b; } AST of this code looks like: FuncDeclaration { fbody = CompoundStatement