Re: Namespace for a module defined by its import path

2016-11-08 Thread ZombineDev via Digitalmars-d
On Tuesday, 8 November 2016 at 18:33:13 UTC, Jeff Thompson wrote: On Tuesday, 8 November 2016 at 17:00:44 UTC, Jeff Thompson wrote: On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler wrote: On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: [...] I've thought

Re: Array operation with overlapping

2016-11-08 Thread Oleg Gorbunov via Digitalmars-d
On Tuesday, 8 November 2016 at 14:52:41 UTC, Steven Schveighoffer wrote: On 11/8/16 3:29 AM, Oleg Gorbunov wrote: I am new in D, but saw some strage behavour. Overlapping is detected for + and * array operation, but not for - and /. I would say this is a bug. The behavior should be

Re: Question on syntax

2016-11-08 Thread ketmar via Digitalmars-d-learn
On Wednesday, 9 November 2016 at 06:28:31 UTC, Jim wrote: What does it mean when a variable name starts with a '.' `.a` --> `::a`.

[Issue 16675] New: Overlapping is detected at runtime for + and * array operation, but not for - and /.

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16675 Issue ID: 16675 Summary: Overlapping is detected at runtime for + and * array operation, but not for - and /. Product: D Version: D2 Hardware: x86 OS: Windows

Re: Question on syntax

2016-11-08 Thread rikki cattermole via Digitalmars-d-learn
On 09/11/2016 7:28 PM, Jim wrote: Hi, I'm a very experienced C++ programmer, looking at a program written in D. D is similar enough to C++ and Java that I have no problem understanding it - except for one thing. I think I may have figured it out, but I want to confirm my understanding. What

Question on syntax

2016-11-08 Thread Jim via Digitalmars-d-learn
Hi, I'm a very experienced C++ programmer, looking at a program written in D. D is similar enough to C++ and Java that I have no problem understanding it - except for one thing. I think I may have figured it out, but I want to confirm my understanding. What does it mean when a variable name

Re: Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
On 09/11/16 07:02, Stefan Koch wrote: On Wednesday, 9 November 2016 at 05:00:28 UTC, Shachar Shemesh wrote: On 08/11/16 17:41, Kagamin wrote: no Is this officially declared in the policy? Should I open an issue? Shachar Please open an issue. Ask and thy shall receive.

[Issue 16674] New: Clarify lifetime of pointer to AA entry

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16674 Issue ID: 16674 Summary: Clarify lifetime of pointer to AA entry Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority:

Re: Is the following code legal?

2016-11-08 Thread Stefan Koch via Digitalmars-d
On Wednesday, 9 November 2016 at 05:00:28 UTC, Shachar Shemesh wrote: On 08/11/16 17:41, Kagamin wrote: no Is this officially declared in the policy? Should I open an issue? Shachar Please open an issue.

Re: Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
On 08/11/16 17:41, Kagamin wrote: no Is this officially declared in the policy? Should I open an issue? Shachar

[Issue 16488] [spec][optimization] broadcast scalar to simd vector

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16488 --- Comment #2 from Walter Bright --- https://github.com/dlang/dmd/pull/6248 --

Re: [OT] Re: CTFE Status

2016-11-08 Thread Chris Wright via Digitalmars-d
On Tue, 08 Nov 2016 11:44:50 -0500, Nick Sabalausky wrote: > I really wish Google would take that to heart. They seem to make a habit > of ripping things out *before* having replacements in place. > > I think they just simply love deleting code. I've seen this more internally than externally.

Re: CTFE Status

2016-11-08 Thread deadalnix via Digitalmars-d
On Tuesday, 8 November 2016 at 21:56:32 UTC, Stefan Koch wrote: Back to CTFE. The 64Bit bug is fixed. And now there is one bailout-line less. I am onto the next bug. Let's hunt them all down! https://media.giphy.com/media/FmNXeuoadNTpe/giphy.gif

Re: Question about dsfml.system.err

2016-11-08 Thread Konstantin Kutsevalov via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 19:00:15 UTC, Steven Schveighoffer wrote: On 11/8/16 11:48 AM, Konstantin Kutsevalov wrote: On Tuesday, 8 November 2016 at 16:34:04 UTC, Konstantin Kutsevalov wrote: ADD: I tried to open other stream in main() ``` ... import dsfml.system.err; int main(string[]

[Issue 11961] Can't select CRT to link against

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11961 --- Comment #4 from Manu --- Hooray!! --

[Issue 16673] New: improve cyclic module imports checker

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16673 Issue ID: 16673 Summary: improve cyclic module imports checker Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority:

[Issue 11961] Can't select CRT to link against

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11961 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 11961] Can't select CRT to link against

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11961 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/19b02322007c88a79648cc46f5732f50d42c77fd fix issue 11961: allow selecting the MS C runtime to link

Re: CTFE Status

2016-11-08 Thread Nordlöw via Digitalmars-d
On Tuesday, 8 November 2016 at 21:56:32 UTC, Stefan Koch wrote: I am onto the next bug. Let's hunt them all down! Marvellous!

Re: typeof(SortedRange) and is operator

2016-11-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, November 08, 2016 22:33:08 Era Scarecrow via Digitalmars-d-learn wrote: > On Tuesday, 8 November 2016 at 21:14:41 UTC, Jonathan M Davis > > wrote: > > No, as the others have point out, it's not a bug. If anything > > it's a language design flaw that no one has figured out how to > >

Re: CTFE Status

2016-11-08 Thread Nick Sabalausky via Digitalmars-d
On 11/08/2016 05:54 PM, Nick Sabalausky wrote: On 11/08/2016 02:30 PM, Patrick Schluter wrote: I describe git not as a vcs but as exacly what Linus Torvalds described it when he first presented it the Kernel mailing list: a directory content state recorder optimized for text files. ...that's

Re: CTFE Status

2016-11-08 Thread Nick Sabalausky via Digitalmars-d
On 11/08/2016 02:30 PM, Patrick Schluter wrote: I describe git not as a vcs but as exacly what Linus Torvalds described it when he first presented it the Kernel mailing list: a directory content state recorder optimized for text files. ...that's incapable of comprehending the concept of empty

Re: typeof(SortedRange) and is operator

2016-11-08 Thread Era Scarecrow via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 21:14:41 UTC, Jonathan M Davis wrote: No, as the others have point out, it's not a bug. If anything it's a language design flaw that no one has figured out how to resolve yet. The idea of a special struct for code that strips whitespace out, or a function that

Re: CTFE Status

2016-11-08 Thread Stefan Koch via Digitalmars-d
Back to CTFE. The 64Bit bug is fixed. And now there is one bailout-line less. I am onto the next bug. Let's hunt them all down!

Re: CTFE Status

2016-11-08 Thread Iakh via Digitalmars-d
On Tuesday, 8 November 2016 at 16:40:31 UTC, Nick Sabalausky wrote: On 11/05/2016 11:48 AM, Marc Schütz wrote: On Saturday, 5 November 2016 at 01:21:48 UTC, Stefan Koch wrote: I recently lost 3 days of work because of my git-skills. Unless you haven't committed your work yet, almost

Re: typeof(SortedRange) and is operator

2016-11-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, November 08, 2016 13:22:35 RazvanN via Digitalmars-d-learn wrote: > Sorry, I accidentally posted the above message and I don't know > how to erase it. > The following post is the complete one: > > Given the following code: > > int[] arr = [1, 2, 9, 4, 10, 6]; > auto r= sort(arr);

Re: ModuleInfo linker error when importing std.stdio and using package.d

2016-11-08 Thread Daniel Kozak via Digitalmars-d-learn
Dne 8.11.2016 v 21:16 Bryce Kellogg via Digitalmars-d-learn napsal(a): ... Finally, a one line package.d: public import my_package.my_module; Change it to: module my_package; public import my_package.my_module; Btw, having class name same as module name is not best way, there could be

ModuleInfo linker error when importing std.stdio and using package.d

2016-11-08 Thread Bryce Kellogg via Digitalmars-d-learn
Hi everyone, I'm new to D, and I'm trying to get a handle on the correct way to use packages, modules, and importing things. I created a simple example, but I'm getting linker errors in weird situations. I'm hoping to get some insight into why the error is happening and best practices in these

Re: CTFE Status

2016-11-08 Thread H. S. Teoh via Digitalmars-d
On Tue, Nov 08, 2016 at 12:12:34PM -0500, Nick Sabalausky via Digitalmars-d wrote: > On 11/08/2016 11:57 AM, H. S. Teoh via Digitalmars-d wrote: > > > > The thing about git is that at its core, it's really very simple. > > Dumb, even. It's basically a program for managing a directed > > acyclic

Re: CTFE Status

2016-11-08 Thread Patrick Schluter via Digitalmars-d
On Tuesday, 8 November 2016 at 16:57:27 UTC, H. S. Teoh wrote: On Tue, Nov 08, 2016 at 11:40:31AM -0500, Nick Sabalausky via Digitalmars-d wrote: On 11/05/2016 11:48 AM, Marc Schütz wrote: > On Saturday, 5 November 2016 at 01:21:48 UTC, Stefan Koch > wrote: > > > > I recently lost 3 days of

Re: CTFE Status

2016-11-08 Thread Antonio Corbi via Digitalmars-d
On Tuesday, 8 November 2016 at 17:12:34 UTC, Nick Sabalausky wrote: On 11/08/2016 11:57 AM, H. S. Teoh via Digitalmars-d wrote: [...] I don't suppose you have a handy link to an "Understanding Git as a DAG manager instead of VCS" document? Hi Nick, Maybe this one is useful for you:

Re: Question about dsfml.system.err

2016-11-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/8/16 11:48 AM, Konstantin Kutsevalov wrote: On Tuesday, 8 November 2016 at 16:34:04 UTC, Konstantin Kutsevalov wrote: ADD: I tried to open other stream in main() ``` ... import dsfml.system.err; int main(string[] args) { err.open("errors.log", "a"); err.write("test\n");

Re: Why doesn't std.variant.visit automatically call the provided delegates?

2016-11-08 Thread Steven Schveighoffer via Digitalmars-d
On 11/5/16 4:22 PM, Adam D. Ruppe wrote: On Saturday, 5 November 2016 at 20:15:14 UTC, Kapps wrote: That feels like it should be a compiler warning. I'm now of the opinion that the {} delegates should be deprecated (instead use () {} delegates)... this comes up a lot and there's a few other

[Issue 16670] std.variant visiting allows type parameters not held by variant

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16670 --- Comment #1 from Nick Treleaven --- I have a fix working locally, will submit a PR soon. --

Re: Namespace for a module defined by its import path

2016-11-08 Thread Jeff Thompson via Digitalmars-d
On Tuesday, 8 November 2016 at 17:00:44 UTC, Jeff Thompson wrote: On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler wrote: On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: [...] I've thought about this and have concluded that you can't replicate these

[Issue 16670] std.variant visiting allows type parameters not held by variant

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16670 Nick Treleaven changed: What|Removed |Added Assignee|nob...@puremagic.com|n...@geany.org --

Re: CTFE Status

2016-11-08 Thread Nick Sabalausky via Digitalmars-d
On 11/08/2016 11:57 AM, H. S. Teoh via Digitalmars-d wrote: The thing about git is that at its core, it's really very simple. Dumb, even. It's basically a program for managing a directed acyclic graph (DAG). That's all there is to it. The rest is just frills. Trying to rationalize git in

Re: What is the right level of abstractions for D?

2016-11-08 Thread Nick Sabalausky via Digitalmars-d
On 11/07/2016 02:00 AM, Danni Coy via Digitalmars-d wrote: When I mean high quality I mean competitive with Qt (the current least bad cross platform toolkit), DLangUI gets compared to the Java UI offerings which leaves me somewhat cold. I have never met a java program with a UI I liked. Yea.

Re: CTFE Status

2016-11-08 Thread H. S. Teoh via Digitalmars-d
On Tue, Nov 08, 2016 at 11:40:31AM -0500, Nick Sabalausky via Digitalmars-d wrote: > On 11/05/2016 11:48 AM, Marc Schütz wrote: > > On Saturday, 5 November 2016 at 01:21:48 UTC, Stefan Koch wrote: > > > > > > I recently lost 3 days of work because of my git-skills. > > > > Unless you haven't

[Issue 16672] New: Deprecate "block only" delegate syntax

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16672 Issue ID: 16672 Summary: Deprecate "block only" delegate syntax Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: Namespace for a module defined by its import path

2016-11-08 Thread Jeff Thompson via Digitalmars-d
On Wednesday, 26 October 2016 at 17:12:30 UTC, Jonathan Marler wrote: On Wednesday, 26 October 2016 at 09:53:35 UTC, Jeff Thompson wrote: [...] I've thought about this and have concluded that you can't replicate these semantics in D. Here's 2 solutions though: [...] Right now, if a

Re: Optimizing std.regex

2016-11-08 Thread Dmitry Olshansky via Digitalmars-d-announce
On 11/8/16 12:23 PM, Chris wrote: On Monday, 7 November 2016 at 13:13:24 UTC, Mike Parker wrote: Dmitry mentioned here in the forums not long ago that he had squeezed some big performance improvements out of std.regex. His post on the D Blog describes how he managed to do it through an

Re: Why doesn't std.variant.visit automatically call the provided delegates?

2016-11-08 Thread Steven Schveighoffer via Digitalmars-d
On 11/8/16 11:31 AM, Nick Sabalausky wrote: On 11/05/2016 04:22 PM, Adam D. Ruppe wrote: On Saturday, 5 November 2016 at 20:15:14 UTC, Kapps wrote: That feels like it should be a compiler warning. I'm now of the opinion that the {} delegates should be deprecated (instead use () {}

Re: Question about dsfml.system.err

2016-11-08 Thread Konstantin Kutsevalov via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 16:34:04 UTC, Konstantin Kutsevalov wrote: ADD: I tried to open other stream in main() ``` ... import dsfml.system.err; int main(string[] args) { err.open("errors.log", "a"); err.write("test\n"); } ... ``` but as can I see, that hasn't

[OT] Re: CTFE Status

2016-11-08 Thread Nick Sabalausky via Digitalmars-d
On 11/05/2016 04:57 PM, Andrei Alexandrescu wrote: That's good thinking - leave short term to the short term and long term to the long term. As the Romanian proverb goes: "Don't sell the skin of the bear before you shoot it." -- Andrei I really wish Google would take that to heart. They seem

Re: CTFE Status

2016-11-08 Thread Nick Sabalausky via Digitalmars-d
On 11/05/2016 11:48 AM, Marc Schütz wrote: On Saturday, 5 November 2016 at 01:21:48 UTC, Stefan Koch wrote: I recently lost 3 days of work because of my git-skills. Unless you haven't committed your work yet, almost everything in Git can be undone. Make a copy of your entire project

Re: Question about dsfml.system.err

2016-11-08 Thread Konstantin Kutsevalov via Digitalmars-d-learn
ADD: I tried to open other stream in main() ``` ... import dsfml.system.err; int main(string[] args) { err.open("errors.log", "a"); err.write("test\n"); } ... ``` but as can I see, that hasn't any effect for tcplistener module...

Re: Why doesn't std.variant.visit automatically call the provided delegates?

2016-11-08 Thread Nick Sabalausky via Digitalmars-d
On 11/05/2016 04:22 PM, Adam D. Ruppe wrote: On Saturday, 5 November 2016 at 20:15:14 UTC, Kapps wrote: That feels like it should be a compiler warning. I'm now of the opinion that the {} delegates should be deprecated (instead use () {} delegates)... this comes up a lot and there's a few

Question about dsfml.system.err

2016-11-08 Thread Konstantin Kutsevalov via Digitalmars-d-learn
I need to see errors from dsfml.system.err, but it doesn't write to terminal as I expected. The general problem is that I cannot listen any port by tcplistener. And listen method is: Status accept(TcpSocket socket) { import dsfml.system.string;

Re: typeof(SortedRange) and is operator

2016-11-08 Thread Ali Çehreli via Digitalmars-d-learn
On 11/08/2016 07:06 AM, RazvanN wrote: >> `SortedRange!(int[], "a> because the arguments to the templates differ i.e. "a> >> Is this a bug? no. is it weird, confusing and unintuitive? yes. > > I think that lambda comparison should

Re: Trailing catch on function?

2016-11-08 Thread Manu via Digitalmars-d
On 8 November 2016 at 12:50, Mike Parker via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Tuesday, 8 November 2016 at 01:50:26 UTC, Walter Bright wrote: > >> On 11/7/2016 4:12 PM, Robert burner Schadek wrote: >> >>> On Monday, 7 November 2016 at 23:37:18 UTC, Walter Bright wrote: >>>

Re: Trailing catch on function?

2016-11-08 Thread Manu via Digitalmars-d
On 8 November 2016 at 09:37, Walter Bright via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On 11/6/2016 8:30 PM, Manu via Digitalmars-d wrote: > >> Hey people, I'm passing lots of D function pointers to C, and naturally, >> the C >> api expects the fp signatures are all nothrow. >> >>

Re: Thread (spawn) for object's method

2016-11-08 Thread Konstantin Kutsevalov via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 06:40:32 UTC, Basile B. wrote: On Monday, 7 November 2016 at 16:15:44 UTC, Konstantin Kutsevalov wrote: Is there a way to make new thread for class method? E.g. I have some class and I need to run one of them method in new thread. I found wxamples only with

Re: Is the following code legal?

2016-11-08 Thread Kagamin via Digitalmars-d
no

Re: how to debug memory errors

2016-11-08 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 14:55:53 UTC, Steven Schveighoffer wrote: Indeed, you should not. I'm saying this type of error can explain the observed behavior. The original post I responded to said "I don't know if the double free problem is related to this." -Steve Okay. I thought

Re: typeof(SortedRange) and is operator

2016-11-08 Thread RazvanN via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 13:59:19 UTC, Nicholas Wilson wrote: On Tuesday, 8 November 2016 at 13:22:35 UTC, RazvanN wrote: Sorry, I accidentally posted the above message and I don't know how to erase it. You can't, this is a mailing list not a forum. The following post is the complete

Re: how to debug memory errors

2016-11-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/8/16 6:26 AM, bachmeier wrote: On Monday, 7 November 2016 at 02:22:35 UTC, Steven Schveighoffer wrote: Imagine a resource wrapper like so: class Foo { int *mem; this() { mem = cast(int *)malloc(int.sizeof); } ~this() { .free(mem); } } Now, you have a problem if you do something

Re: Array operation with overlapping

2016-11-08 Thread Steven Schveighoffer via Digitalmars-d
On 11/8/16 3:29 AM, Oleg Gorbunov wrote: I am new in D, but saw some strage behavour. Overlapping is detected for + and * array operation, but not for - and /. I would say this is a bug. The behavior should be consistent. -Steve

Re: Is the following code legal?

2016-11-08 Thread Steven Schveighoffer via Digitalmars-d
On 11/8/16 7:58 AM, Shachar Shemesh wrote: SomeStruct[int] aa; SomeStruct* aap = v in aa; aa.remove(v); writeln(aap); It currently will work. At some point in the past, this did NOT work, as we were proactively freeing the data. I don't know if the policy is that this is officially

Re: typeof(SortedRange) and is operator

2016-11-08 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 13:59:19 UTC, Nicholas Wilson wrote: You can't, this is a mailing list not a forum. > forum.dlang.org

Re: typeof(SortedRange) and is operator

2016-11-08 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 13:22:35 UTC, RazvanN wrote: Sorry, I accidentally posted the above message and I don't know how to erase it. You can't, this is a mailing list not a forum. The following post is the complete one: Given the following code: int[] arr = [1, 2, 9, 4, 10, 6];

Re: calling convention optimisation & const/immutable ref

2016-11-08 Thread Matthias Bentrup via Digitalmars-d
On Tuesday, 8 November 2016 at 12:56:10 UTC, Johan Engelen wrote: On Monday, 7 November 2016 at 16:48:55 UTC, John Colvin wrote: [...] This reminds me of an LLVM presentation by Chandler, mentioning that passing by reference may hamper the optimization of code (because memory becomes

Re: typeof(SortedRange) and is operator

2016-11-08 Thread RazvanN via Digitalmars-d-learn
Sorry, I accidentally posted the above message and I don't know how to erase it. The following post is the complete one: Given the following code: int[] arr = [1, 2, 9, 4, 10, 6]; auto r= sort(arr); if(is(typeof(r) == SortedRange!(int[], "a

typeof(SortedRange) and is operator

2016-11-08 Thread RazvanN via Digitalmars-d-learn
Given the following code: int[] arr = [1, 2, 9, 4, 10, 6]; auto r= sort(arr); if(is(typeof(r) == SortedRange!(int[], "a

Re: Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
On 08/11/16 14:58, Shachar Shemesh wrote: SomeStruct[int] aa; ... SomeStruct* aap = v in aa; aa.remove(v); writeln(aap); That last line is, of course: "writeln(*aap);" Shachar

Is the following code legal?

2016-11-08 Thread Shachar Shemesh via Digitalmars-d
SomeStruct[int] aa; ... SomeStruct* aap = v in aa; aa.remove(v); writeln(aap);

Re: calling convention optimisation & const/immutable ref

2016-11-08 Thread Johan Engelen via Digitalmars-d
On Monday, 7 November 2016 at 16:48:55 UTC, John Colvin wrote: Some people use ref for performance to prevent the copying that must occur when passing by value. This reminds me of an LLVM presentation by Chandler, mentioning that passing by reference may hamper the optimization of code

[Issue 14511] Profiler does not work with multithreaded programs

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14511 Alex changed: What|Removed |Added CC||sascha.or...@gmail.com ---

Re: how to debug memory errors

2016-11-08 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 11:53:37 UTC, Era Scarecrow wrote: On Tuesday, 8 November 2016 at 11:26:55 UTC, bachmeier wrote: Is there a valid use case for something like this? Why would you want to do anything inside ~this with GC memory? If we assume it's a C++

[Issue 16671] std.variant visiting functions should pass file, line to VariantException

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16671 Nick Treleaven changed: What|Removed |Added Keywords||pull URL|

[Issue 16671] New: std.variant visiting functions should pass file, line to VariantException

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16671 Issue ID: 16671 Summary: std.variant visiting functions should pass file, line to VariantException Product: D Version: D2 Hardware: x86 OS: Windows

Re: how to debug memory errors

2016-11-08 Thread Era Scarecrow via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 11:26:55 UTC, bachmeier wrote: Is there a valid use case for something like this? Why would you want to do anything inside ~this with GC memory? If we assume it's a C++ attachment/library/object using different memory allocation?

[Issue 16670] New: std.variant visiting allows type parameters not held by variant

2016-11-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16670 Issue ID: 16670 Summary: std.variant visiting allows type parameters not held by variant Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW

Re: Trailing catch on function?

2016-11-08 Thread Daniel N via Digitalmars-d
On Tuesday, 8 November 2016 at 11:24:59 UTC, Anonymouse wrote: You can eat the exception by returning in the scope guard. Since it seems to trigger on Throwables it also eats Errors, sadly. Interesting! Considering this works: scope(failure) { abort(); return; } I had expected this to

RCString Time frame

2016-11-08 Thread Chris via Digitalmars-d
I'm planning to rewrite / improve some of my text handling modules. Before I do so, however, I'd like to know when RCString will be introduced (roughly)? And how will it handle Unicode, or auto-decode to be precise. As far as I remember, RCString wants to get rid of it.

Re: "Multiple alias this" status?

2016-11-08 Thread Picaud Vincent via Digitalmars-d
Thank you for your answer, that is a sad news.

Re: how to debug memory errors

2016-11-08 Thread bachmeier via Digitalmars-d-learn
On Monday, 7 November 2016 at 02:22:35 UTC, Steven Schveighoffer wrote: Imagine a resource wrapper like so: class Foo { int *mem; this() { mem = cast(int *)malloc(int.sizeof); } ~this() { .free(mem); } } Now, you have a problem if you do something like this: class Bar { Foo foo;

Re: Optimizing std.regex

2016-11-08 Thread Chris via Digitalmars-d-announce
On Monday, 7 November 2016 at 13:13:24 UTC, Mike Parker wrote: Dmitry mentioned here in the forums not long ago that he had squeezed some big performance improvements out of std.regex. His post on the D Blog describes how he managed to do it through an algorithmic optimization. The post:

Re: Trailing catch on function?

2016-11-08 Thread Anonymouse via Digitalmars-d
On Tuesday, 8 November 2016 at 01:50:26 UTC, Walter Bright wrote: Who to get the Exception thrown in the scope(failure) You don't. The exception is also rethrown, so it isn't an exact replacement. (The 'nothrow' is a mistake on my part.) You can eat the exception by returning in the scope

Re: calling convention optimisation & const/immutable ref

2016-11-08 Thread Marc Schütz via Digitalmars-d
On Monday, 7 November 2016 at 16:48:55 UTC, John Colvin wrote: Some people use ref for performance to prevent the copying that must occur when passing by value. I propose a small optimisation to make this unnecessary in a bunch of cases. At the ABI level (no change in language semantics), if

Re: "Multiple alias this" status?

2016-11-08 Thread Daniel Kozak via Digitalmars-d
Dne 8.11.2016 v 11:37 Picaud Vincent via Digitalmars-d napsal(a): Hi All, I just started to learn a little bit of D. I read this thread https://github.com/dlang/dmd/pull/3998 about "Multiple alias this". I think this feature is very handy, but dmd and gcd compilers complain that "there

Re: New to D and mimicking C++ : how to implement std::integral_constant<>?

2016-11-08 Thread Picaud Vincent via Digitalmars-d-learn
Hi Basile, Thank you for your code, it allowed me to grasp a little bit more about how to do things in D. Vincent

"Multiple alias this" status?

2016-11-08 Thread Picaud Vincent via Digitalmars-d
Hi All, I just started to learn a little bit of D. I read this thread https://github.com/dlang/dmd/pull/3998 about "Multiple alias this". I think this feature is very handy, but dmd and gcd compilers complain that "there must be only one" alias this. It is not clear to me if this feature

Re: Trailing catch on function?

2016-11-08 Thread Robert burner Schadek via Digitalmars-d
On Tuesday, 8 November 2016 at 01:50:26 UTC, Walter Bright wrote: You don't. The exception is also rethrown, so it isn't an exact replacement. (The 'nothrow' is a mistake on my part.) this: scope(failure, Exception e) { // Do something with e } would be nice

Re: how to debug memory errors

2016-11-08 Thread Lodovico Giaretta via Digitalmars-d-learn
On Tuesday, 8 November 2016 at 07:39:12 UTC, Era Scarecrow wrote: On Tuesday, 8 November 2016 at 06:04:59 UTC, thedeemon wrote: On Tuesday, 8 November 2016 at 05:36:22 UTC, Era Scarecrow wrote: Hmmm.. I had the impression that if something was referenced by another object, then it couldn't

Array operation with overlapping

2016-11-08 Thread Oleg Gorbunov via Digitalmars-d
I am new in D, but saw some strage behavour. Overlapping is detected for + and * array operation, but not for - and /. import std.stdio; void main() { int[] slice = [2, 2, 2, 2]; int[] slice2 = slice[0 .. $ - 1]; int[] slice3 = slice[1 .. $]; writeln("slice