[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 ag0ae...@gmail.com changed: What|Removed |Added CC||ag0ae...@gmail.com --- Comment #5 from

[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 --- Comment #4 from uplink.co...@googlemail.com --- As far as I can see there is no special treatment. CTFE does only work on literals results of ctfe evaluations are always literals. --

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-28 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 04/28/2017 06:11 PM, H. S. Teoh via Digitalmars-d-announce wrote: That's the thing about C++: The right way is the obscure way, and the straightforward way is the wrong way. And yesterday's right way is today's wrong way. And apparently (it would seem), the only way NOT to completely fuck

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread Atila Neves via Digitalmars-d-learn
On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote: On Friday, 28 April 2017 at 18:07:49 UTC, ParticlePeter wrote: Interesting, your example corresponds to my third case, the linker error. I am on Window, building an x64 App, afaik in that case the MS Visual Studio linker is used instead of

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-28 Thread Ola Fosheim Grostad via Digitalmars-d-announce
On Friday, 28 April 2017 at 22:11:30 UTC, H. S. Teoh wrote: On Fri, Apr 28, 2017 at 05:11:29PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d-announce wrote: On 04/28/2017 04:26 PM, Atila Neves wrote: > The other day I was reminded that in C++ land one has to > manually write `operator<<`

Re: DConf Hackathon Ideas

2017-04-28 Thread Nicholas Wilson via Digitalmars-d
On Thursday, 27 April 2017 at 14:53:02 UTC, Mike Parker wrote: This year, DConf has an extra day tacked on for problem solving in the form of a hackathon. The intent is to work on issues people find frustrating in the D ecosystem. While there will be time given at the event for proposals, and

Re: OT: Re: DConf Hackathon Ideas

2017-04-28 Thread Nicholas Wilson via Digitalmars-d
On Friday, 28 April 2017 at 13:31:33 UTC, Petar Kirov [ZombineDev] wrote: Other applications include: * compiling/transpiling D functions to targets like JS, SPIR-V, I got you covered ;) (LDC not CTFE though. It would be fiendishly complicated to do at CTFE as a fair amount of compiler magic

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 28 April 2017 at 19:08:18 UTC, ParticlePeter wrote: On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote: On 04/28/2017 08:56 AM, ParticlePeter wrote: > C++ Function: > bool cppFunc( float[3] color ); > > D binding: > extern(C++) bool cppFunc( float[3] color ); > > Using with:

llvm-d 2.1 - Support for LLVM 4.0.0

2017-04-28 Thread Moritz Maxeiner via Digitalmars-d-announce
Thanks to foerdi as of the new release 2.1.0, llvm-d supports LLVM 4.0.0.

[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 Andrei Alexandrescu changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-28 Thread Ali Çehreli via Digitalmars-d-announce
On 04/28/2017 02:11 PM, Nick Sabalausky (Abscissa) wrote: > D takes all the current (and former!) application domains > of C/C++, and brings to it basic programmer sanity. When I had asked Luís Marques what the title of the talk should be, he had said import sanity; :) Ali

Re: COM Expertise needed: COM Callbacks

2017-04-28 Thread Nierjerson via Digitalmars-d-learn
On Friday, 28 April 2017 at 09:25:31 UTC, John Chapman wrote: On Thursday, 27 April 2017 at 20:20:23 UTC, Nierjerson wrote: QueryInterface is COM's version of opCast. It asks if you support the interface represented by an IID (riid). If you don't, then you return E_NOINTERFACE. If you do,

Re: Garbage Collector?

2017-04-28 Thread Ola Fosheim Grostad via Digitalmars-d
On Friday, 28 April 2017 at 21:21:13 UTC, jmh530 wrote: To be fair, C++ effectively has multiple pointer types too with raw pointers, unique_ptr, shared_ptr, and weak_ptr. However, each of the extra ones has a unique purpose and are opt-in. As a result, people happily use them when it makes

Re: Blog post on automem

2017-04-28 Thread Atila Neves via Digitalmars-d-announce
On Friday, 28 April 2017 at 22:06:57 UTC, Nordlöw wrote: On Friday, 28 April 2017 at 14:40:03 UTC, Mike Parker wrote: Blog: https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/ Nice. One thing, Atila; what about replacing typeof(u1) u2; move(u1, u2); with

Re: COM Expertise needed: COM Callbacks

2017-04-28 Thread Nierjerson via Digitalmars-d-learn
On Friday, 28 April 2017 at 09:25:31 UTC, John Chapman wrote: On Thursday, 27 April 2017 at 20:20:23 UTC, Nierjerson wrote: I think the main issue though, is that I really don't know what is going on when I invoke the PS function. It seems to call the server method that takes the interface

[Issue 17141] CommonType!(dchar, char) returns uint

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 Jack Stouffer changed: What|Removed |Added Severity|major |critical --- Comment

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-04-28 Thread Atila Neves via Digitalmars-d
On Friday, 28 April 2017 at 18:04:06 UTC, jmh530 wrote: On Friday, 28 April 2017 at 17:09:22 UTC, Atila Neves wrote: https://github.com/atilaneves/concepts import concepts; @models!(isForwardRange, MyType) struct MyType { } Atila I remember you had posted about this last year. It

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-28 Thread H. S. Teoh via Digitalmars-d-announce
On Fri, Apr 28, 2017 at 05:11:29PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d-announce wrote: > On 04/28/2017 04:26 PM, Atila Neves wrote: > > The other day I was reminded that in C++ land one has to manually > > write `operator<<` to print things out and `operator==` to compare > >

Re: automem v0.0.7 - C++ style smart pointers using std.experimental.allocator

2017-04-28 Thread Atila Neves via Digitalmars-d-announce
On Sunday, 9 April 2017 at 15:52:50 UTC, Basile B. wrote: On Sunday, 9 April 2017 at 08:56:52 UTC, Atila Neves wrote: Using std.experimental.allocator? Tired of writing `scope(exit) allocator.dispose(foo);` in a language with RAII? Me too: http://code.dlang.org/packages/automem I think

Re: Blog post on automem

2017-04-28 Thread Nordlöw via Digitalmars-d-announce
On Friday, 28 April 2017 at 14:40:03 UTC, Mike Parker wrote: Blog: https://dlang.org/blog/2017/04/28/automem-hands-free-raii-for-d/ Nice. One thing, Atila; what about replacing typeof(u1) u2; move(u1, u2); with typeof(u1) u2 = move(u1); or, alternatively, typeof(u1) u2 =

Re: Garbage Collector?

2017-04-28 Thread H. S. Teoh via Digitalmars-d
On Fri, Apr 28, 2017 at 09:50:49PM +, Atila Neves via Digitalmars-d wrote: > On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: > > On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: > > «Back in the old DOS days, there were multiple pointer types (near > >

Re: Garbage Collector?

2017-04-28 Thread Atila Neves via Digitalmars-d
On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: «Back in the old DOS days, there were multiple pointer types (near and far). Programmers put up with that because it was the only way, but they HATED HATED

[bug] error compiling dserver.d from sample

2017-04-28 Thread Yohan SEROT via Digitalmars-d-debugger
hello, i try to compile dserver.d but i got this error : C:\D\dmd2\samples\d>dmd dserver.d dserver.d(244): Deprecation: instead of C-style syntax, use D-style syntax 'char[128] szID' dserver.d(245): Deprecation: instead of C-style syntax, use D-style syntax 'char[128] szCLSID' dserver.d(246):

Re: Garbage Collector?

2017-04-28 Thread jmh530 via Digitalmars-d
On Friday, 28 April 2017 at 20:21:34 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 20:13:58 UTC, Moritz Maxeiner wrote: Both of these, however, show only that he doesn't seem to personally like multiple pointer types (and consequently doesn't seem to have any interest in working

[Issue 17355] Path to lib64 and $(DMDInstallDir) not correct

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17355 --- Comment #3 from Thomas --- After a lot of uninstalling/installing DMD/VisualD, my previous global settings for library path etc was still not "refreshed". I suspected some remains from older installations so resided to

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-28 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 04/28/2017 04:26 PM, Atila Neves wrote: The other day I was reminded that in C++ land one has to manually write `operator<<` to print things out and `operator==` to compare things. What, seriously?!? That's the thing about C++: The right way is the obscure way, and the straightforward way

Re: Garbage Collector?

2017-04-28 Thread Moritz Maxeiner via Digitalmars-d
On Friday, 28 April 2017 at 20:21:34 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 20:13:58 UTC, Moritz Maxeiner wrote: Both of these, however, show only that he doesn't seem to personally like multiple pointer types (and consequently doesn't seem to have any interest in working

get parameters of a function

2017-04-28 Thread Alex via Digitalmars-d-learn
Hi all, I have a question about the Parameters trait from https://dlang.org/phobos/std_traits.html#Parameters The following code does not compile. Why? import std.traits : Parameters; void main() { static assert(is(Parameters!S1 == Parameters!S2)); } struct S1 { auto opCall()

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-28 Thread Atila Neves via Digitalmars-d-announce
On Tuesday, 25 April 2017 at 13:57:53 UTC, XavierAP wrote: On Tuesday, 11 April 2017 at 06:08:16 UTC, Ali Çehreli wrote: I have to say it took me a very long time to come up with the title and the abstract. How could I sell D to C++ experts? Luckily, I asked Manu and among a long list of

Re: Garbage Collector?

2017-04-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 28 April 2017 at 20:13:58 UTC, Moritz Maxeiner wrote: Both of these, however, show only that he doesn't seem to personally like multiple pointer types (and consequently doesn't seem to have any interest in working on them himself); that's not the same as him claiming that it "is a

Re: Garbage Collector?

2017-04-28 Thread Moritz Maxeiner via Digitalmars-d
On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 15:43:22 UTC, Moritz Maxeiner wrote: On Friday, 28 April 2017 at 14:59:46 UTC, Ola Fosheim Grøstad wrote: Walter's position has always been that having more than a single pointer type is a

Re: Garbage Collector?

2017-04-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 28 April 2017 at 17:48:47 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 17:42:18 UTC, bachmeier wrote: I'm hoping to put all information in one place. Then when someone on Reddit or HN or here starts making claims about the GC, I can give them one link that shows all

[Issue 5659] Conditional operator, array literal, and std.traits.CommonType return a wrong common type

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5659 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx See

Re: Garbage Collector?

2017-04-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 28 April 2017 at 15:43:22 UTC, Moritz Maxeiner wrote: On Friday, 28 April 2017 at 14:59:46 UTC, Ola Fosheim Grøstad wrote: Walter's position has always been that having more than a single pointer type is a disaster. None of the threads I've read in the last couple of years

[Issue 17359] New: C++ Interfacing: function with 'static' array parameter cannot be linked (x64)

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17359 Issue ID: 17359 Summary: C++ Interfacing: function with 'static' array parameter cannot be linked (x64) Product: D Version: D2 Hardware: x86_64 OS: Windows

[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 uplink.co...@googlemail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 17141] CommonType!(dchar, char) returns uint

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 --- Comment #5 from hst...@quickfur.ath.cx --- Hmph. Looks like the problem is that the very first thing typeMerge() does is to do integer promotion on the incoming types. Thus, right from the start, we've already lost the original character types.

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote: On 04/28/2017 08:56 AM, ParticlePeter wrote: > C++ Function: > bool cppFunc( float[3] color ); > > D binding: > extern(C++) bool cppFunc( float[3] color ); > > Using with: > float[3] my_color; > cppFunc( my_color ); > > -> Error:

nogc v0.0.1: @nogc variants of `std.exception.enforce`, `std.conv.text` - Basically `@nogc` exceptions. Sorta.

2017-04-28 Thread Atila Neves via Digitalmars-d-announce
Writing `@nogc` code? Want to throw exceptions? Yeah, I know, painful. We can do this already: void foo() @nogc { static const exception = new Exception("message can't change"); if() throw exception; // no information about is possible } But, we get limited information and no

[Issue 17141] CommonType!(dchar, char) returns uint

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 --- Comment #4 from hst...@quickfur.ath.cx --- Looks like this is implemented in the hairball function typeMerge() in src/ddmd/dcast.d. I'll try to trace through and see if I can find an obvious problem, but I'm not sure if I'll be able to. --

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread kinke via Digitalmars-d-learn
On Friday, 28 April 2017 at 18:07:49 UTC, ParticlePeter wrote: Interesting, your example corresponds to my third case, the linker error. I am on Window, building an x64 App, afaik in that case the MS Visual Studio linker is used instead of optilink. Will add your findings to the bug report.

[Issue 17141] CommonType!(dchar, char) returns uint

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 hst...@quickfur.ath.cx changed: What|Removed |Added Component|phobos |dmd --

[Issue 17141] CommonType!(dchar, char) returns uint

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 --- Comment #3 from hst...@quickfur.ath.cx --- Unfortunately, it looks like CommonType is implemented using the ?: ternary operator, meaning that it's the *compiler* that's producing these crazy results. --

[Issue 17141] CommonType!(dchar, char) returns uint

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment

Re: CTFE Status 2

2017-04-28 Thread Stefan Koch via Digitalmars-d
On Friday, 28 April 2017 at 17:53:04 UTC, Stefan Koch wrote: On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] Hi Guys, I just implemented sliceAssigment. meaning the following code will now compile: uint[] assignSlice(uint from, uint to, uint[] stuff) { uint[]

Kafka site needs to be updated with D modules

2017-04-28 Thread Ali Çehreli via Digitalmars-d
There are three D modules that I could identify that provide Kafka bindings[1] by searching for "kafka" on the code registry: http://code.dlang.org/ Could people in the know please update the Kafka site with necessary information like what version of Kafka they support, etc. Thank you,

[Issue 17358] [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17358 --- Comment #3 from Jack Stouffer --- (In reply to hsteoh from comment #2) > `ElementType!(typeof(chain(s, "\n")))` returns `uint`. That's the problem. > Now, why ElementType should return `uint` is a different story... gonna

Re: Blog post on automem

2017-04-28 Thread Ali Çehreli via Digitalmars-d-announce
On 04/28/2017 11:26 AM, qznc wrote: There is a RefCounted in std.typecons as well. The article does not explain the differences though. The article gives a difference: D’s standard library has Unique and RefCounted in std.typecons but they predate std.experimental.allocator and so “bake

Re: Blog post on automem

2017-04-28 Thread qznc via Digitalmars-d-announce
On Friday, 28 April 2017 at 15:39:07 UTC, Swoorup Joshi wrote: On Friday, 28 April 2017 at 14:40:03 UTC, Mike Parker wrote: Atila was kind enough to do a write up on his automem library for the D Blog, talking about why he did it and showing some of the implementation details. This is

[Issue 17358] [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17358 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --- Comment

Re: Move construction from !is(T == typeof(this))

2017-04-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 28 April 2017 at 18:05:41 UTC, Steven Schveighoffer wrote: On 4/28/17 12:56 PM, Ola Fosheim Grøstad wrote: Isn't that an odd stance given that "struct" is supposed to be a value type? Not really, but thanks for asking. Well, it counters the very definition of a value... I guess

[Issue 17358] [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17358 --- Comment #1 from Jack Stouffer --- possibly introduced in https://github.com/dlang/phobos/pull/5229 --

[Issue 17358] [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17358 Jack Stouffer changed: What|Removed |Added Hardware|x86 |All

[Issue 17358] [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17358 Jack Stouffer changed: What|Removed |Added Severity|enhancement |regression --

[Issue 17358] New: [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17358 Issue ID: 17358 Summary: [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters Product: D Version: D2 Hardware: x86 OS: Mac

Re: problem with std.variant rounding

2017-04-28 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Apr 28, 2017 at 04:42:28PM +, via Digitalmars-d-learn wrote: [...] > writefln(text("%.", i, "f"), x); [...] There's no need to use text() here: writefln("%.*f", i, x); does what you want. T -- "You know, maybe we don't *need* enemies." "Yeah, best friends are

Re: Move construction from !is(T == typeof(this))

2017-04-28 Thread Steven Schveighoffer via Digitalmars-d
On 4/28/17 12:56 PM, Ola Fosheim Grøstad wrote: On Thursday, 27 April 2017 at 12:28:38 UTC, Steven Schveighoffer wrote: My solution would be to push the duplication onto the user. I'm not a fan of implicit copying. It's also wasteful in the case of immutable data. Isn't that an odd stance

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote: On 04/28/2017 08:56 AM, ParticlePeter wrote: > C++ Function: > bool cppFunc( float[3] color ); > > D binding: > extern(C++) bool cppFunc( float[3] color ); > > Using with: > float[3] my_color; > cppFunc( my_color ); > > -> Error:

Re: Garbage Collector?

2017-04-28 Thread H. S. Teoh via Digitalmars-d
On Fri, Apr 28, 2017 at 04:03:18PM +, bachmeier via Digitalmars-d wrote: > On Friday, 28 April 2017 at 15:23:18 UTC, H. S. Teoh wrote: > > > you could save yourself the bug by writing: > > > > auto x = malloc(...); > > scope(exit) free(x); > > // ... however many pages of stuff

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-04-28 Thread jmh530 via Digitalmars-d
On Friday, 28 April 2017 at 17:09:22 UTC, Atila Neves wrote: https://github.com/atilaneves/concepts import concepts; @models!(isForwardRange, MyType) struct MyType { } Atila I remember you had posted about this last year. It looks like you've added some stuff on ranges to it

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-04-28 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 04/28/2017 01:09 PM, Atila Neves wrote: https://github.com/atilaneves/concepts import concepts; @models!(isForwardRange, MyType) struct MyType { } Hmm, close, but if I'm reading the source right, it looks like a type doesn't have to use the UDA in order for isXXX or "static

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread Ali Çehreli via Digitalmars-d-learn
On 04/28/2017 08:56 AM, ParticlePeter wrote: > C++ Function: > bool cppFunc( float[3] color ); > > D binding: > extern(C++) bool cppFunc( float[3] color ); > > Using with: > float[3] my_color; > cppFunc( my_color ); > > -> Error: Internal Compiler Error: unable to pass static array to That part

Re: CTFE Status 2

2017-04-28 Thread Stefan Koch via Digitalmars-d
On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] Hi Guys, I just implemented sliceAssigment. meaning the following code will now compile: uint[] assignSlice(uint from, uint to, uint[] stuff) { uint[] slice; slice.length = to + 4; foreach (uint i; 0 .. to

Re: Garbage Collector?

2017-04-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 28 April 2017 at 17:42:18 UTC, bachmeier wrote: I'm hoping to put all information in one place. Then when someone on Reddit or HN or here starts making claims about the GC, I can give them one link that shows all of their options. That's nice. Just get your hopes up for it having

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
On Friday, 28 April 2017 at 17:15:54 UTC, kinke wrote: On Friday, 28 April 2017 at 15:56:17 UTC, ParticlePeter wrote: So what next? How can I interface to the cpp function? *** C++: bool cppFunc(float ()[3]) { color[0] = 1; color[1] = 2; color[2] = 3; return true; } *** D:

Re: Garbage Collector?

2017-04-28 Thread bachmeier via Digitalmars-d
On Friday, 28 April 2017 at 17:06:51 UTC, jmh530 wrote: On Friday, 28 April 2017 at 16:03:18 UTC, bachmeier wrote: I usually use the GC, so I have limited knowledge in this area. How common is this pattern in D code? Is it better than using reference counted structs? Is there any advantage

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread kinke via Digitalmars-d-learn
On Friday, 28 April 2017 at 15:56:17 UTC, ParticlePeter wrote: So what next? How can I interface to the cpp function? *** C++: bool cppFunc(float ()[3]) { color[0] = 1; color[1] = 2; color[2] = 3; return true; } *** D: extern(C++) bool cppFunc(ref float[3] color); void

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-04-28 Thread Atila Neves via Digitalmars-d
On Friday, 28 April 2017 at 01:12:39 UTC, Nick Sabalausky (Abscissa) wrote: On 04/27/2017 07:12 PM, Moritz Maxeiner wrote: Wasn't one major selling point of compile time introspection / duck typing that we could stop using interfaces such... naming schemes? Not that I speak for everyone,

Re: Garbage Collector?

2017-04-28 Thread jmh530 via Digitalmars-d
On Friday, 28 April 2017 at 16:03:18 UTC, bachmeier wrote: I usually use the GC, so I have limited knowledge in this area. How common is this pattern in D code? Is it better than using reference counted structs? Is there any advantage to using the GC in this scenario? I would like to add

Re: Move construction from !is(T == typeof(this))

2017-04-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 27 April 2017 at 12:28:38 UTC, Steven Schveighoffer wrote: My solution would be to push the duplication onto the user. I'm not a fan of implicit copying. It's also wasteful in the case of immutable data. Isn't that an odd stance given that "struct" is supposed to be a value

Re: problem with std.variant rounding

2017-04-28 Thread via Digitalmars-d-learn
On Friday, 28 April 2017 at 16:42:28 UTC, Petar Kirov [ZombineDev] wrote: On Friday, 28 April 2017 at 16:24:55 UTC, Suliman wrote: On Friday, 28 April 2017 at 15:45:25 UTC, Suliman wrote: I am using https://github.com/mysql-d/mysql-native It's return from DB variant data-type. My DB include

Re: problem with std.variant rounding

2017-04-28 Thread Suliman via Digitalmars-d-learn
On Friday, 28 April 2017 at 16:49:18 UTC, kinke wrote: On Friday, 28 April 2017 at 16:24:55 UTC, Suliman wrote: import std.stdio; import std.variant; void main() { Variant b = 56.051151; float x = b.coerce!float; writeln(x); } 56.0512 void main() { import

Re: problem with std.variant rounding

2017-04-28 Thread kinke via Digitalmars-d-learn
On Friday, 28 April 2017 at 16:24:55 UTC, Suliman wrote: import std.stdio; import std.variant; void main() { Variant b = 56.051151; float x = b.coerce!float; writeln(x); } 56.0512 void main() { import core.stdc.stdio; import std.stdio; double d =

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread Kagamin via Digitalmars-d-learn
Report a bug.

Re: problem with std.variant rounding

2017-04-28 Thread via Digitalmars-d-learn
On Friday, 28 April 2017 at 16:24:55 UTC, Suliman wrote: On Friday, 28 April 2017 at 15:45:25 UTC, Suliman wrote: I am using https://github.com/mysql-d/mysql-native It's return from DB variant data-type. My DB include value: 56.051151 (double type in DB) I need to extract it. I tried several

Re: problem with std.variant rounding

2017-04-28 Thread Suliman via Digitalmars-d-learn
On Friday, 28 April 2017 at 15:45:25 UTC, Suliman wrote: I am using https://github.com/mysql-d/mysql-native It's return from DB variant data-type. My DB include value: 56.051151 (double type in DB) I need to extract it. I tried several variants: writeln(point[3].coerce!float);

Re: Persistent key-value-store for D?

2017-04-28 Thread krylon via Digitalmars-d-learn
On Friday, 28 April 2017 at 16:01:58 UTC, yawniek wrote: On Wednesday, 26 April 2017 at 17:06:52 UTC, krylon wrote: I looked at the DUB package registry and asked Google quite a bit now, but I did not found such a package for D. So my first question is - did I not look hard enough? I found a

Re: Garbage Collector?

2017-04-28 Thread bachmeier via Digitalmars-d
On Friday, 28 April 2017 at 15:23:18 UTC, H. S. Teoh wrote: you could save yourself the bug by writing: auto x = malloc(...); scope(exit) free(x); // ... however many pages of stuff you want, you don't have to // remember to write free() afterwards! Yes, D

Re: Persistent key-value-store for D?

2017-04-28 Thread yawniek via Digitalmars-d-learn
On Wednesday, 26 April 2017 at 17:06:52 UTC, krylon wrote: I looked at the DUB package registry and asked Google quite a bit now, but I did not found such a package for D. So my first question is - did I not look hard enough? I found a reimplentation of QDBM [1] (the spiritual ancestor of

C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
C++ Function: bool cppFunc( float[3] color ); D binding: extern(C++) bool cppFunc( float[3] color ); Using with: float[3] my_color; cppFunc( my_color ); -> Error: Internal Compiler Error: unable to pass static array to extern(C++) function. Error: Use pointer instead. Using with: cppFunc(

Re: OT: Re: DConf Hackathon Ideas

2017-04-28 Thread Moritz Maxeiner via Digitalmars-d
On Friday, 28 April 2017 at 13:31:33 UTC, Petar Kirov [ZombineDev] wrote: [...] Other applications include: * compiling/transpiling D functions to targets like JS, SPIR-V, WebAssembly, etc. using CTFE. * CTFE-driven code diagnostics (linting) * Adding semantic to user defined attributes: E.g.

problem with std.variant rounding

2017-04-28 Thread Suliman via Digitalmars-d-learn
I am using https://github.com/mysql-d/mysql-native It's return from DB variant data-type. My DB include value: 56.051151 (double type in DB) I need to extract it. I tried several variants: writeln(point[3].coerce!float); writeln(point[3].coerce!string); writeln(point[3].coerce!double); but

Re: Garbage Collector?

2017-04-28 Thread Moritz Maxeiner via Digitalmars-d
On Friday, 28 April 2017 at 14:59:46 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 09:40:07 UTC, Moritz Maxeiner wrote: I'm sorry, but that's just plain wrong. D does not have ownership pointers because nobody that wants them has stepped up and 1) Done the work of drafting an

Re: Blog post on automem

2017-04-28 Thread Swoorup Joshi via Digitalmars-d-announce
On Friday, 28 April 2017 at 14:40:03 UTC, Mike Parker wrote: Atila was kind enough to do a write up on his automem library for the D Blog, talking about why he did it and showing some of the implementation details. This is officially part of the GC series. The next post in the series will be

Re: Garbage Collector?

2017-04-28 Thread H. S. Teoh via Digitalmars-d
On Fri, Apr 28, 2017 at 09:01:03AM +, Moritz Maxeiner via Digitalmars-d wrote: > On Friday, 28 April 2017 at 07:35:00 UTC, Ben wrote: [...] > > Is it so hard for developers when you declare a variable, to later > > also clean it up??? > > > > var x = 1; > > // Do work > > x.free; > > If you

Re: Blog post on automem

2017-04-28 Thread jmh530 via Digitalmars-d-announce
On Friday, 28 April 2017 at 14:40:03 UTC, Mike Parker wrote: Atila was kind enough to do a write up on his automem library for the D Blog, talking about why he did it and showing some of the implementation details. This is officially part of the GC series. The next post in the series will be

[Issue 17357] New: DMD wrongly considers template instance class as nested

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17357 Issue ID: 17357 Summary: DMD wrongly considers template instance class as nested Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Garbage Collector?

2017-04-28 Thread Ola Fosheim Grøstad via Digitalmars-d
On Friday, 28 April 2017 at 09:40:07 UTC, Moritz Maxeiner wrote: I'm sorry, but that's just plain wrong. D does not have ownership pointers because nobody that wants them has stepped up and 1) Done the work of drafting an informal proposal that *actually deals with _all_ of the issues

[Issue 7102] std.numeric.gcd with BigInts too

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7102 Jack Stouffer changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 7102] std.numeric.gcd with BigInts too

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7102 --- Comment #7 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/35bbd3611ee4a977f2bedf98e8b15160eb01fd11 Merge pull request #5350 from quickfur/issue7102a Fix

Blog post on automem

2017-04-28 Thread Mike Parker via Digitalmars-d-announce
Atila was kind enough to do a write up on his automem library for the D Blog, talking about why he did it and showing some of the implementation details. This is officially part of the GC series. The next post in the series will be my @nogc post (I've pushed it back to after DConf). When I

Re: CTFE Status 2

2017-04-28 Thread Nordlöw via Digitalmars-d
On Friday, 28 April 2017 at 13:13:16 UTC, Stefan Koch wrote: Do you mean no Jit? Of course there will be a JIT. Ah, I misunderstood you formulation. But currently I am fixing busy bugs in the generated IR. So the implementation of jit will have to wait a little. Ok. Thanks.

Re: Python : Pythonista / Ruby: Rubyist : / D : ?

2017-04-28 Thread Dominikus Dittes Scherkl via Digitalmars-d
On Friday, 28 April 2017 at 13:19:47 UTC, Chris wrote: On Thursday, 27 April 2017 at 12:29:48 UTC, Steven Schveighoffer wrote: On 4/24/17 1:43 AM, Nick Sabalausky (Abscissa) wrote: "Dashing, awesome, ultra-attractive programmer with an impeccably fine taste in languages." It's a bit long

Re: OT: Re: DConf Hackathon Ideas

2017-04-28 Thread via Digitalmars-d
On Friday, 28 April 2017 at 10:09:32 UTC, Moritz Maxeiner wrote: On Friday, 28 April 2017 at 09:52:29 UTC, Petar Kirov [ZombineDev] wrote: AST introspection - given a function definition (!= declaration, i.e. the body is available) f, the expression __traits(ast, f) should return an instance

Re: Python : Pythonista / Ruby: Rubyist : / D : ?

2017-04-28 Thread Chris via Digitalmars-d
On Thursday, 27 April 2017 at 12:29:48 UTC, Steven Schveighoffer wrote: On 4/24/17 1:43 AM, Nick Sabalausky (Abscissa) wrote: "Dashing, awesome, ultra-attractive programmer with an impeccably fine taste in languages." It's a bit long and doesn't include the letter D FIFY -Steve

Re: CTFE Status 2

2017-04-28 Thread Stefan Koch via Digitalmars-d
On Friday, 28 April 2017 at 13:03:42 UTC, Nordlöw wrote: On Friday, 28 April 2017 at 08:47:43 UTC, Stefan Koch wrote: After a little of exploration of the JIT, I have now determined that a simple risc architecture is still the best. (codegen for scaled loads is hard :p) Do you mean no Jit?

Re: CTFE Status 2

2017-04-28 Thread Nordlöw via Digitalmars-d
On Friday, 28 April 2017 at 08:47:43 UTC, Stefan Koch wrote: After a little of exploration of the JIT, I have now determined that a simple risc architecture is still the best. (codegen for scaled loads is hard :p) Do you mean no Jit?

Re: DConf Hackathon Ideas

2017-04-28 Thread Jacob Carlborg via Digitalmars-d
On 2017-04-27 19:06, Andre Pany wrote: Another big issue for me is using dub in a company. Big companies do not want to use the official dub repository due to security issues. That would be nice. -- /Jacob Carlborg

[Issue 17352] [REG 2.075a] Internal error: ddmd/backend/elfobj.c 1739 on duplicate definition

2017-04-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17352 --- Comment #4 from Ketmar Dark --- yeah. but the frontend will check for conflicting overloads only when `foo()` will be called. i guess this was done to gain some compilation speed by not checking each symbol against other

OT: Re: DConf Hackathon Ideas

2017-04-28 Thread Moritz Maxeiner via Digitalmars-d
On Friday, 28 April 2017 at 09:52:29 UTC, Petar Kirov [ZombineDev] wrote: AST introspection - given a function definition (!= declaration, i.e. the body is available) f, the expression __traits(ast, f) should return an instance of FuncDeclaration

  1   2   >