Re: How to break gdb on D exception ?

2015-10-01 Thread BBasile via Digitalmars-d-learn
On Friday, 2 October 2015 at 04:46:51 UTC, BBasile wrote: On Friday, 2 October 2015 at 04:24:11 UTC, Adam D. Ruppe wrote: On Friday, 2 October 2015 at 03:58:45 UTC, BBasile wrote: none of the following GB commands work: give break d_throw or maybe `break d_throwc` a try unfortunately it d

Re: How to break gdb on D exception ?

2015-10-01 Thread BBasile via Digitalmars-d-learn
On Friday, 2 October 2015 at 04:24:11 UTC, Adam D. Ruppe wrote: On Friday, 2 October 2015 at 03:58:45 UTC, BBasile wrote: none of the following GB commands work: give break d_throw or maybe `break d_throwc` a try unfortunately it doesn't work, i get --- (gdb) Function "d_throw"/"d_throwc"

Re: How to break gdb on D exception ?

2015-10-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 2 October 2015 at 03:58:45 UTC, BBasile wrote: none of the following GB commands work: give break d_throw or maybe `break d_throwc` a try

Re: How to break gdb on D exception ?

2015-10-01 Thread BBasile via Digitalmars-d-learn
On Friday, 2 October 2015 at 03:58:45 UTC, BBasile wrote: Does anyone manage this ? I meant: Does anyone master this ?

How to break gdb on D exception ?

2015-10-01 Thread BBasile via Digitalmars-d-learn
Currently it works fine when throwing with core.exception functions 'on', like explained in the wiki, for example: --- break onFinalizeError --- But I can't manage to break when a new Exception instance is thrown in the code: --- throw new Exception("ouch"); --- none of the following GB

Re: Checking that a template parameter is an enum

2015-10-01 Thread Meta via Digitalmars-d-learn
On Thursday, 1 October 2015 at 22:41:21 UTC, Nordlöw wrote: Will this spare memory in DMD? If so there are a few traits that should be update accordingly, for instance `allSatisfy` and `anySatisfy`. Thanks! Highly doubtful as CTFE already allocates like there's no tomorrow.

Re: help me learn to read documentation

2015-10-01 Thread Robin via Digitalmars-d-learn
On Friday, 2 October 2015 at 01:20:50 UTC, Adam D. Ruppe wrote: On Thursday, 1 October 2015 at 19:15:39 UTC, Robin wrote: [...] Those describe simple class members, so you can set them through assignment: Text CurrentFps = new Text(dejavu); // change to white on black Current

Re: help me learn to read documentation

2015-10-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 1 October 2015 at 19:15:39 UTC, Robin wrote: The documentation here (http://dgame-dev.de/index.php?controller=learn&mode=package&package=graphic&module=Text&version=0.6)... gives me the Text() class but i dont know how to use "foreground, background, and Font mode" or at least turn

Re: an example of parallel calculation of metrics

2015-10-01 Thread Jay Norwood via Digitalmars-d-learn
This is another attempt with the metric parallel processing. This uses the results only to return an int value, which could be used later as an error return value. The metric value locations are now allocated as a part of the input measurement values tuple. The Tuple vs struct definitions see

Re: Checking that a template parameter is an enum

2015-10-01 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 1 October 2015 at 22:37:57 UTC, Ali Çehreli wrote: Very quickly: import std.traits; template allSame(V...) if (isExpressions!(V)) { bool impl_(V...)() { static if (V.length > 1) { foreach (i, _; V[0 .. $ - 1]) { if (V[i] != V[i + 1]) {

Re: Checking that a template parameter is an enum

2015-10-01 Thread Ali Çehreli via Digitalmars-d-learn
On 10/01/2015 03:26 PM, Nordlöw wrote: On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote: /** Returns: true iff all values $(D V) are the same. */ template allSame(V...) // TODO restrict to values only { static if (V.length <= 1) enum bool allSame = true; el

Re: Checking that a template parameter is an enum

2015-10-01 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote: /** Returns: true iff all values $(D V) are the same. */ template allSame(V...) // TODO restrict to values only { static if (V.length <= 1) enum bool allSame = true; else enum bool allSame = V[0] == V

Re: Checking that a template parameter is an enum

2015-10-01 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 1 October 2015 at 02:06:48 UTC, Fusxfaranto wrote: /** Returns: true iff all values $(D V) are the same. */ template allSame(V...) // TODO restrict to values only { static if (V.length <= 1) enum bool allSame = true; else enum bool allSame = V[0] == V

Re: Interval Arithmetic

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 01 Oct 2015 12:03:10 + schrieb ponce : > I have a RAII struct to save/restore the FP control word. > It also handle the SSE control word which unfortunately exist. > > https://github.com/p0nce/dplug/blob/master/plugin/dplug/plugin/fpcontrol.d Nice to have in Phobos. I assume you have

Re: an example of parallel calculation of metrics

2015-10-01 Thread Jay Norwood via Digitalmars-d-learn
I re-submitted this as: https://issues.dlang.org/show_bug.cgi?id=15135

Re: an example of parallel calculation of metrics

2015-10-01 Thread Jay Norwood via Digitalmars-d-learn
So, this is a condensed version of the original problem. It looks like the problem is that the return value for taskPool.amap can't be a tuple of tuples or a tuple of struct. Either way, it fails with the Wrong buffer type error message if I uncomment the taskPool line import std.algorithm,

help me learn to read documentation

2015-10-01 Thread Robin via Digitalmars-d-learn
Hi. I like to learn programming by examples but I need help learning how to read documentation. I have some idea of how it works in some aspects but in others i get completely stuck because there are no examples or code snippets. I am using dgame (dgame-dev.de) and im reading the documentation

Re: an example of parallel calculation of metrics

2015-10-01 Thread Jay Norwood via Digitalmars-d-learn
On Thursday, 1 October 2015 at 18:08:31 UTC, Ali Çehreli wrote: However, if you prove to yourself that the result tuple and your struct have the same memory layout, you can cast the tuple slice to struct slice after calling amap: After re-reading your explanation, I see that the problem is onl

Re: an example of parallel calculation of metrics

2015-10-01 Thread Jay Norwood via Digitalmars-d-learn
On Thursday, 1 October 2015 at 18:08:31 UTC, Ali Çehreli wrote: Makes sense. Please open a bug at least for investigation why tuples with named members don't work with amap. ok, thanks. I opened the issue. https://issues.dlang.org/show_bug.cgi?id=15134

Re: WTF does "Enforcement failed" actually mean?

2015-10-01 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2015-10-01 at 08:52 +, John Colvin via Digitalmars-d-learn wrote: > […] > > Bug report? Then it'll get fixed. https://issues.dlang.org/show_bug.cgi?id=15133 Timer running… ;-) -- Russel. = Dr Russel Winder

Re: an example of parallel calculation of metrics

2015-10-01 Thread Ali Çehreli via Digitalmars-d-learn
On 10/01/2015 08:56 AM, Jay Norwood wrote: > Thanks. My particular use case, working with metric expressions, is > easier to understand if I use the names. Makes sense. Please open a bug at least for investigation why tuples with named members don't work with amap. > I converted the use of T

Re: Regex start/end position of match?

2015-10-01 Thread Gerald via Digitalmars-d-learn
Thanks Adam, that was the hint I needed. For a given RegexMatch the pre().length() is essentially equivalent to the start position and taking pre().length + hit.length() gives the end position so I think this should be OK for my needs.

Re: Which GDC to download?

2015-10-01 Thread NX via Digitalmars-d-learn
Thanks both to you for answers... On Thursday, 1 October 2015 at 14:07:02 UTC, Johannes Pfau wrote: Unfortunately Windows GDC builds are very unstable right now. I'd recommend using DMD or LDC for Windows. Well... To me it's surprising GDC is not usable on windows but I doubt LDC is more stab

Re: an example of parallel calculation of metrics

2015-10-01 Thread Jay Norwood via Digitalmars-d-learn
On Thursday, 1 October 2015 at 07:03:40 UTC, Ali Çehreli wrote: Looks like a bug. Workaround: Get rid of member names Thanks. My particular use case, working with metric expressions, is easier to understand if I use the names. I converted the use of Tuple to struct to see if I could get an

Re: Which GDC to download?

2015-10-01 Thread Johannes Pfau via Digitalmars-d-learn
Am Thu, 01 Oct 2015 12:04:38 + schrieb NX : > Windows X86 64bit (x86_64-w64-mingw32) > > Standard builds > TargetDMDFE Runtime > GCC GDC revisionBuild Date arm-linux-gnueabi > 2.066.1 yes 5.2.0 dadb5a3784 > 2015-08-30 arm-linux-gnuea

Re: Regex start/end position of match?

2015-10-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 1 October 2015 at 03:29:29 UTC, Gerald wrote: I'm stuck though on how to get the start/end index of a match? I couldn't find one either so I did the pre/post/hit things broken up. Take a look at this little program I wrote: http://arsdnet.net/dcode/replacer/ All the files it n

Re: How to use std.experimental.logger?

2015-10-01 Thread Panke via Digitalmars-d-learn
Ah, I tried to format a custom struct that has a non-pure toString, because std.conv.to isn't pure either, sigh :(

Re: Which GDC to download?

2015-10-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 1 October 2015 at 12:04:40 UTC, NX wrote: 1) Why there is a download targeting arm-linux-gnueabi(hf) and what exactly it means? Is this a cross-compiler which will produce obj files containing ARM instructions or what? If so, will linking just work? and how? Yes, that's a cross c

Re: Interval Arithmetic

2015-10-01 Thread ponce via Digitalmars-d-learn
On Thursday, 1 October 2015 at 11:40:28 UTC, Marco Leise wrote: Note that the FP control word is per thread and any external code you call or even buggy interrupt handlers could change or reset it to defaults. Known cases include a faulty printer driver and Delphi's runtime, which enables FP

Which GDC to download?

2015-10-01 Thread NX via Digitalmars-d-learn
Windows X86 64bit (x86_64-w64-mingw32) Standard builds Target DMDFE Runtime GCC GDC revisionBuild Date arm-linux-gnueabi 2.066.1 yes 5.2.0 dadb5a3784 2015-08-30 arm-linux-gnueabihf 2.066.1 yes 5.2.0 dadb5a3784 2

Re: Interval Arithmetic

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 29 Sep 2015 21:04:00 + schrieb Wulfrick : > Is there an interval arithmetic library in D? I couldn’t find one. > > In case I had to write my own, I understand that the IEEE > standard floating point arithmetic provides operations for > rounding up or down certain operations like sum

Re: Mac IDE with Intellisense

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 26 Sep 2015 10:38:25 + schrieb Gary Willoughby : > Auto-complete in D is tricky because of this feature and no-one > has invested any time to figure out a nice way to provide > auto-complete for this. Mono-D does have UFCS auto-complete. The plugin is going to bit-rot though, since

Re: WTF does "Enforcement failed" actually mean?

2015-10-01 Thread Marco Leise via Digitalmars-d-learn
Am Thu, 01 Oct 2015 08:52:43 + schrieb John Colvin : > On Thursday, 1 October 2015 at 07:08:00 UTC, Russel Winder wrote: > > On Wed, 2015-09-30 at 23:35 -0700, Ali Çehreli via > > Digitalmars-d-learn wrote: > >> On 09/30/2015 10:46 PM, Russel Winder via Digitalmars-d-learn > >> wrote: > >> >

Re: How to use std.experimental.logger?

2015-10-01 Thread Adrian Matoga via Digitalmars-d-learn
On Thursday, 1 October 2015 at 08:21:35 UTC, Panke wrote: I tried it on Windows today using the latest DMD installer, all default logger and settings. I get: safe function [...].logImplf cannot call system function 'std.format.formattedWrite!(MsgRange, char, Result!()).formattedWrite' How d

Re: Range of variables

2015-10-01 Thread Atila Neves via Digitalmars-d-learn
On Wednesday, 30 September 2015 at 20:11:56 UTC, Freddy wrote: Is there a way to make a range of a variables lazily? --- int var1; int var2; void func() { int var3; auto range = /*range of var1,var2,var3*/ ; } --- std.range.iota Atila

Re: WTF does "Enforcement failed" actually mean?

2015-10-01 Thread John Colvin via Digitalmars-d-learn
On Thursday, 1 October 2015 at 07:08:00 UTC, Russel Winder wrote: On Wed, 2015-09-30 at 23:35 -0700, Ali Çehreli via Digitalmars-d-learn wrote: On 09/30/2015 10:46 PM, Russel Winder via Digitalmars-d-learn wrote: > [...] It's coming from the following no-message enforce(): enforc

How to use std.experimental.logger?

2015-10-01 Thread Panke via Digitalmars-d-learn
I tried it on Windows today using the latest DMD installer, all default logger and settings. I get: safe function [...].logImplf cannot call system function 'std.format.formattedWrite!(MsgRange, char, Result!()).formattedWrite' How do I make formatted logging work?

Re: Threading Questions

2015-10-01 Thread Kagamin via Digitalmars-d-learn
On Friday, 25 September 2015 at 15:19:27 UTC, bitwise wrote: I know that all global variables are TLS unless explicitly marked as 'shared', but someone once told me something about 'shared' affecting member variables in that accessing them from a separate thread would return T.init instead of t

Re: address of overloaded function

2015-10-01 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-10-01 00:48, Freddy wrote: How do you take the address of a specific overloaded function. This won't compile --- import std.range; void main() { ForwardAssignable!int range; int delegate() @property get = &range.front; void delegate(int) @property set = &range.front; } ---

Re: WTF does "Enforcement failed" actually mean?

2015-10-01 Thread Russel Winder via Digitalmars-d-learn
On Wed, 2015-09-30 at 23:35 -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 09/30/2015 10:46 PM, Russel Winder via Digitalmars-d-learn wrote: > > I have the code: > > > > reduce!"a+b"(x) > > > > where x is a int[] and I get an exception "Enforcement failed" at > > run > > time. This gi

Re: an example of parallel calculation of metrics

2015-10-01 Thread Ali Çehreli via Digitalmars-d-learn
On 09/30/2015 09:15 PM, Jay Norwood wrote: > alias TO = Tuple!(TR,"L1_MISS", TR, "L1_HIT", TR,"DATA_ACC", TR,"ALL_ACC"); Looks like a bug. Workaround: Get rid of member names there: alias TO = Tuple!(TR, TR, TR, TR); > //taskPool.amap!(Metrics)(std.algorithm.map!getTerm(samples),results);