Re: Coverage (-cov)

2017-09-23 Thread Tony via Digitalmars-d-learn
On Sunday, 24 September 2017 at 05:48:32 UTC, Tony wrote: I am compiling a module (utils) with one function in it with the -cov compiler option on Ubuntu 14.04 with DMD v2.073.2. I then compile a "main module" with -cov that imports the "utils module" and calls the one function. The *.lst outpu

Coverage (-cov)

2017-09-23 Thread Tony via Digitalmars-d-learn
I am compiling a module (utils) with one function in it with the -cov compiler option on Ubuntu 14.04 with DMD v2.073.2. I then compile a "main module" with -cov that imports the "utils module" and calls the one function. The *.lst output file shows lines that executed in the "main module". I w

Re: Connecting python to D on socket of localhost : target machine actively refuses connection

2017-09-23 Thread Sergei Degtiarev via Digitalmars-d-learn
On Saturday, 23 September 2017 at 02:50:25 UTC, rikki cattermole wrote: On 23/09/2017 3:26 AM, Sergei Degtiarev wrote: On Friday, 22 September 2017 at 04:06:08 UTC, Enjoys Math wrote: Here's my minimal D code (server.d): public: this(ushort port, string address="") {     super(& run);

Re: Why isn't there more if( ctfe) in std.math ?

2017-09-23 Thread ketmar via Digitalmars-d-learn
user1234 wrote: "if (__ctfe) {}" is a test happening at runtime. Both the if and the else branches got compiled nope. compiler knows about this special pseudovariable, and will not generate code neither for condition, nor for ctfe branch.

Re: Why isn't there more if(__ctfe) in std.math ?

2017-09-23 Thread ag0aep6g via Digitalmars-d-learn
On 09/23/2017 11:46 PM, user1234 wrote: "if (__ctfe) {}" is a test happening at runtime. Both the if and the else branches got compiled, this implies: - more code to cache - slower code just to allow CTFE. __ctfe is a constant, though. Any half-decent optimizer will throw away the path that's

Re: Why isn't there more if(__ctfe) in std.math ?

2017-09-23 Thread user1234 via Digitalmars-d-learn
On Saturday, 23 September 2017 at 18:23:12 UTC, Juraj Mojzis wrote: Hi, browsing trough phobos bugzilla I found a couple of open issues regarding CTFE and basic math functions ( Issue 4177, 5227). It looks to me that at least floor/ceil could by fixed by a simple: if (__ctfe) return simple_flo

Re: What the hell is wrong with D?

2017-09-23 Thread Patrick Schluter via Digitalmars-d-learn
On Tuesday, 19 September 2017 at 18:34:13 UTC, Brad Anderson wrote: On Tuesday, 19 September 2017 at 18:17:47 UTC, jmh530 wrote: On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta wrote: Thanks for wasting some of my life... Just curious about who will justify the behavior and wha

Why isn't there more if(__ctfe) in std.math ?

2017-09-23 Thread Juraj Mojzis via Digitalmars-d-learn
Hi, browsing trough phobos bugzilla I found a couple of open issues regarding CTFE and basic math functions ( Issue 4177, 5227). It looks to me that at least floor/ceil could by fixed by a simple: if (__ctfe) return simple_floor_impl(x); But that looks too easy and would surely be implemented

detect implicitly convertible typeid's?

2017-09-23 Thread bitwise via Digitalmars-d-learn
Is it possible to tell if two objects represented by TypeInfo's are convertible to each other? Basically, is there a built in way to do this? int x; long y; assert(typeid(x).isImplicitlyConvertibleTo(typeid(y)); Thanks

Re: Cannot make LDC use LTO when called via DUB

2017-09-23 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 23 September 2017 at 15:19:09 UTC, Nordlöw wrote: I've added buildType "release" { buildOptions "releaseMode" "optimize" "inline" dflags-posix-ldc "-flto=thin" "-Xcc=-fuse-ld=gold" } to my dub.sdl and built (on Linux) as /usr/bin/dub -v run --compiler=ldc2 --

Cannot make LDC use LTO when called via DUB

2017-09-23 Thread Nordlöw via Digitalmars-d-learn
I've added buildType "release" { buildOptions "releaseMode" "optimize" "inline" dflags-posix-ldc "-flto=thin" "-Xcc=-fuse-ld=gold" } to my dub.sdl and built (on Linux) as /usr/bin/dub -v run --compiler=ldc2 --build=release but neither the flag "-flto=thin" nor "-Xcc=-fuse

Re: how to build project with locally compiled phobos

2017-09-23 Thread Mike Wey via Digitalmars-d-learn
On 23-09-17 13:58, Mengu wrote: hi all i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) how do i compile my project now against my local phobos with dub? with plain dmd? i tried (in dub.sdl): - full path to new libphobos.so with -d

Re: how to build project with locally compiled phobos

2017-09-23 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 23 September 2017 at 11:58:40 UTC, Mengu wrote: hi all i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) how do i compile my project now against my local phobos with dub? with plain dmd? i tried (in dub.sdl): - full pat

Re: how to build project with locally compiled phobos

2017-09-23 Thread B4s1L3 via Digitalmars-d-learn
On Saturday, 23 September 2017 at 11:58:40 UTC, Mengu wrote: hi all i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) how do i compile my project now against my local phobos with dub? with plain dmd? i tried (in dub.sdl): - full pat

how to build project with locally compiled phobos

2017-09-23 Thread Mengu via Digitalmars-d-learn
hi all i've successfully compiled phobos master with gmake on freebsd. (make fails, i've no clue at all as to why) how do i compile my project now against my local phobos with dub? with plain dmd? i tried (in dub.sdl): - full path to new libphobos.so with -defaultlib to dflags - full path t

Re: [FreeBSD] 0x000000000061d8cd in rt.aaA.Impl.findSlotLookup(ulong, const(void*), const(TypeInfo)) inout ()

2017-09-23 Thread Mengu via Digitalmars-d-learn
On Saturday, 23 September 2017 at 11:23:26 UTC, Nicholas Wilson wrote: On Saturday, 23 September 2017 at 08:45:00 UTC, Mengu wrote: [...] So it fails: trying to find if an element exists in an AA in a regex invoked as a callback from curl inside a parallel foreach. Interesting that it just st

Re: [FreeBSD] 0x000000000061d8cd in rt.aaA.Impl.findSlotLookup(ulong, const(void*), const(TypeInfo)) inout ()

2017-09-23 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 23 September 2017 at 11:23:26 UTC, Nicholas Wilson wrote: Only other thing I can suggest is try linking against a debug phobos to see if you can get some more diagnostics. You might also try LDC's -fsanitize=address option for catching memory bugs.

Re: [FreeBSD] 0x000000000061d8cd in rt.aaA.Impl.findSlotLookup(ulong, const(void*), const(TypeInfo)) inout ()

2017-09-23 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 23 September 2017 at 08:45:00 UTC, Mengu wrote: hello everyone i have a small program that parses an xml file, holding a list with 13610 elements. after making the list, it iterates over the list (paralele), goes to a web site and grabs the related data for that element. it wor

Re: Dub use local fork

2017-09-23 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 23 September 2017 at 09:37:54 UTC, rikki cattermole wrote: On 23/09/2017 10:34 AM, Guillaume Piolat wrote: On Saturday, 23 September 2017 at 03:16:30 UTC, rikki cattermole wrote: Alternatively you can alter the package that dub already knows about. Does the trick more easily ;)

Re: Dub use local fork

2017-09-23 Thread rikki cattermole via Digitalmars-d-learn
On 23/09/2017 10:34 AM, Guillaume Piolat wrote: On Saturday, 23 September 2017 at 03:16:30 UTC, rikki cattermole wrote: Alternatively you can alter the package that dub already knows about. Does the trick more easily ;) +1 That's the dirty trick I'm using too You can also do the same for Ph

Re: Dub use local fork

2017-09-23 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 23 September 2017 at 03:16:30 UTC, rikki cattermole wrote: Alternatively you can alter the package that dub already knows about. Does the trick more easily ;) +1 That's the dirty trick I'm using too

[FreeBSD] 0x000000000061d8cd in rt.aaA.Impl.findSlotLookup(ulong, const(void*), const(TypeInfo)) inout ()

2017-09-23 Thread Mengu via Digitalmars-d-learn
hello everyone i have a small program that parses an xml file, holding a list with 13610 elements. after making the list, it iterates over the list (paralele), goes to a web site and grabs the related data for that element. it works perfect for the first 1K element in the list. after that i

Re: CTFE static array error: cannot modify read-only constant

2017-09-23 Thread Petar via Digitalmars-d-learn
On Friday, 22 September 2017 at 14:43:28 UTC, Johan wrote: Hi all, ``` auto foo(const int[3] x) { int[3] y = x; y[0] = 1; // line 4 return y; } immutable int[3] a = [0,1,2]; immutable int[3] b = foo(a); // line 8 ``` compiles with an error: ``` 4: Error: cannot modify