Advent of Code

2015-12-01 Thread Regan Heath via Digitalmars-d
Hi all, Long time since I read/posted here but I saw this and thought it might be good PR for D: http://adventofcode.com/ Should also be fun. Ciao, Regan

Re: 'partial' keyword in C# is very good for project , what's the same thing in D?

2014-11-12 Thread Regan Heath via Digitalmars-d
On Mon, 10 Nov 2014 18:09:12 -, deadalnix wrote: On Monday, 10 November 2014 at 10:21:34 UTC, Regan Heath wrote: On Fri, 31 Oct 2014 09:30:25 -, Dejan Lekic wrote: In D apps I work on I prefer all my classes in a single module, as is common "D way", or shall I call it "modular way"

Re: 'partial' keyword in C# is very good for project , what's the same thing in D?

2014-11-10 Thread Regan Heath via Digitalmars-d
On Fri, 31 Oct 2014 09:30:25 -, Dejan Lekic wrote: In D apps I work on I prefer all my classes in a single module, as is common "D way", or shall I call it "modular way"? Sure, but that's not the point of partial. It's almost never used by the programmer directly, and when it is used

Re: 'partial' keyword in C# is very good for project , what's the same thing in D?

2014-10-29 Thread Regan Heath via Digitalmars-d
On Wed, 29 Oct 2014 07:54:39 -, Paulo Pinto wrote: On Wednesday, 29 October 2014 at 07:41:41 UTC, FrankLike wrote: Hello,everyone, I've written some projects in C#,find the 'partial' keyword is very userful,which lets the auto codes in another single file,my codes are very easy to

Re: Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

2014-10-20 Thread Regan Heath via Digitalmars-d
On Sun, 19 Oct 2014 10:06:31 +0100, eles wrote: On Wednesday, 15 October 2014 at 14:42:30 UTC, Regan Heath wrote: On Thu, 09 Oct 2014 09:50:44 +0100, Martin Nowak wrote: Would this affect your code? Probably, but I have no D code of any size to care about. Would this change make you to w

Re: Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

2014-10-15 Thread Regan Heath via Digitalmars-d
On Thu, 09 Oct 2014 09:50:44 +0100, Martin Nowak wrote: Would this affect your code? Probably, but I have no D code of any size to care about. Do you think it makes your code better or worse? Better. Is this just a pointless style change? Nope. Anything else? Only what you said in

Re: Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

2014-10-15 Thread Regan Heath via Digitalmars-d
On Sat, 11 Oct 2014 13:47:55 +0100, Martin Nowak wrote: https://github.com/D-Programming-Language/dmd/pull/4043#issuecomment-58748353 There has been a broad support for this on the newsgroup discussion because this regularly confuses beginners. There are also some arguments against it (par

Re: scope() statements and return

2014-10-08 Thread Regan Heath via Digitalmars-d
On Tue, 07 Oct 2014 14:39:06 +0100, Andrei Alexandrescu wrote: On 10/7/14, 12:36 AM, monarch_dodra wrote: Hum... But arguably, that's just exception chaining "happening". Do you have any examples of someone actually "dealing" with all the exceptions in a chain in a catch, or actually using t

Re: Program logic bugs vs input/environmental errors (checked exceptions)

2014-10-06 Thread Regan Heath via Digitalmars-d
On Mon, 06 Oct 2014 15:48:31 +0100, Jacob Carlborg wrote: On 06/10/14 15:45, Andrei Alexandrescu wrote: Knowledge doesn't have to be by type; just place data inside the exception. About the only place where multiple "catch" statements are used to make fine distinctions between exception types

Re: WAT: opCmp and opEquals woes

2014-07-28 Thread Regan Heath via Digitalmars-d
On Fri, 25 Jul 2014 21:38:33 +0100, Walter Bright wrote: On 7/25/2014 4:10 AM, Regan Heath wrote: Sure, Andrei makes a valid point .. for a minority of cases. The majority case will be that opEquals and opCmp==0 will agree. In those minority cases where they are intended to disagree the

Re: WAT: opCmp and opEquals woes

2014-07-28 Thread Regan Heath via Digitalmars-d
On Sat, 26 Jul 2014 05:22:26 +0100, Walter Bright wrote: If you don't want to accept that equality and comparison are fundamentally different operations, I can only repeat saying the same things. For the majority of use cases they are *not* in fact fundamentally different. You're corre

Re: WAT: opCmp and opEquals woes

2014-07-25 Thread Regan Heath via Digitalmars-d
On Fri, 25 Jul 2014 09:39:11 +0100, Walter Bright wrote: On 7/25/2014 1:02 AM, Jacob Carlborg wrote: 3. If opCmp is defined but no opEquals, lhs == rhs will be lowered to lhs.opCmp(rhs) == 0 This is the sticking point. opCmp and opEquals are separate on purpose, see Andrei's posts. Sur

Re: D Users Survey: Primary OS?

2014-05-30 Thread Regan Heath via Digitalmars-d
Windows 7 x64

Re: Allocating a wstring on the stack (no GC)?

2014-05-09 Thread Regan Heath via Digitalmars-d
On Wed, 07 May 2014 19:41:16 +0100, Maxime Chevalier-Boisvert wrote: Unless I'm misunderstanding it should be as simple as: wchar[100] stackws; // alloca() if you need it to be dynamically sized. A slice of this static array behaves just like a slice of a dynamic array. I do need it to

Re: DIP61: redone to do extern(C++,N) syntax

2014-05-02 Thread Regan Heath via Digitalmars-d
On Fri, 02 May 2014 01:22:12 +0100, deadalnix wrote: On Thursday, 1 May 2014 at 10:03:21 UTC, Regan Heath wrote: On Wed, 30 Apr 2014 20:56:15 +0100, Timon Gehr wrote: If this is a problem, I guess the most obvious alternatives are to: 1. Get rid of namespace scopes. Require workarounds in

Re: DIP61: redone to do extern(C++,N) syntax

2014-05-01 Thread Regan Heath via Digitalmars-d
On Thu, 01 May 2014 11:03:21 +0100, Regan Heath wrote: On Wed, 30 Apr 2014 20:56:15 +0100, Timon Gehr wrote: If this is a problem, I guess the most obvious alternatives are to: 1. Get rid of namespace scopes. Require workarounds in the case of conflicting definitions in different namespa

Re: DIP61: redone to do extern(C++,N) syntax

2014-05-01 Thread Regan Heath via Digitalmars-d
On Wed, 30 Apr 2014 20:56:15 +0100, Timon Gehr wrote: If this is a problem, I guess the most obvious alternatives are to: 1. Get rid of namespace scopes. Require workarounds in the case of conflicting definitions in different namespaces in the same file. (Eg. use a mixin template.) I'd pres

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-30 Thread Regan Heath via Digitalmars-d
On Wed, 30 Apr 2014 10:20:22 +0100, Regan Heath wrote: Something else to think about. C# has the same problem and has solved it the following way.. [main.cs] using .. using CSTest_Test1; using CSTest_Test2; namespace CSTest { class Program { static void Main(string[] args)

Re: DIP61: redone to do extern(C++,N) syntax

2014-04-30 Thread Regan Heath via Digitalmars-d
On Wed, 30 Apr 2014 05:03:58 +0100, Ola Fosheim Grøstad wrote: Wrong KISS: compiler internals over specification Indeed. I've been a C/C++ developer for ~16 years and I was confused several times reading this thread. The mix of D modules and C++ namespaces is the thing what needs to be k

Re: [OT] from YourNameHere via Digitalmars-d

2014-04-22 Thread Regan Heath via Digitalmars-d
On Thu, 17 Apr 2014 22:32:31 +0100, Steven Schveighoffer wrote: On Thu, 17 Apr 2014 17:29:47 -0400, Nick Sabalausky wrote: On 4/17/2014 8:51 AM, Steven Schveighoffer wrote: Every time I open one of these messages I get a huge pregnant 5-second pause, along with the Mac Beach Ball (hourg

Re: DIP60: @nogc attribute

2014-04-17 Thread Regan Heath via Digitalmars-d
On Wed, 16 Apr 2014 18:38:23 +0100, Walter Bright wrote: On 4/16/2014 8:01 AM, qznc wrote: However, what is still an open issue is that @nogc can be stopped by allocations in another thread. We need threads which are not affected by stop-the-world. As far as I know, creating threads via p

Re: DIP60: @nogc attribute

2014-04-17 Thread Regan Heath via Digitalmars-d
On Thu, 17 Apr 2014 14:08:29 +0100, Orvid King via Digitalmars-d wrote: I'm just going to put my 2-cents into this discussion, it's my personal opinion that while _allocations_ should be removed from phobos wherever possible, replacing GC usage with manual calls to malloc/free has no place in