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 deadal...@gmail.com wrote: On Monday, 10 November 2014 at 10:21:34 UTC, Regan Heath wrote: On Fri, 31 Oct 2014 09:30:25 -, Dejan Lekic dejan.le...@gmail.com wrote: In D apps I work on I prefer all my classes in a single module, as is common

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 dejan.le...@gmail.com 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,

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 pj...@progtools.org 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

Re: D2 port of Sociomantic CDGC available for early experiments

2014-10-23 Thread Regan Heath via Digitalmars-d-announce
On Thu, 23 Oct 2014 15:27:50 +0100, Leandro Lucarella l...@llucax.com.ar wrote: Regan Heath, el 22 de October a las 10:41 me escribiste: NO, this is completely false, and why I think you are not entirely familiar with env vars in posix. LD_PRELOAD and LD_LIBRARY_PATH affects ALL, EACH and

Re: D2 port of Sociomantic CDGC available for early experiments

2014-10-22 Thread Regan Heath via Digitalmars-d-announce
On Tue, 21 Oct 2014 23:52:22 +0100, Leandro Lucarella l...@llucax.com.ar wrote: The runtime is not platform independent AT ALL. ^ implementation Why should you provide a platform agnostic way to configure it? Because it makes life easier for developers and cross platform

Re: Destructor order

2014-10-22 Thread Regan Heath via Digitalmars-d-learn
On Wed, 22 Oct 2014 16:49:20 +0100, eles e...@eles.com wrote: On Wednesday, 22 October 2014 at 15:45:02 UTC, eles wrote: D version with structs: { //display ~C~B~A A foo; B bar; C *caz = new C(); delete caz; } as expected.

Re: D2 port of Sociomantic CDGC available for early experiments

2014-10-21 Thread Regan Heath via Digitalmars-d-announce
On Mon, 20 Oct 2014 18:19:33 +0100, Sean Kelly s...@invisibleduck.org wrote: On Monday, 20 October 2014 at 10:39:28 UTC, Regan Heath wrote: Sure, but past/current env vars being used are used *privately* to a single program. What you're suggesting here are env vars which will affect

Re: D2 port of Sociomantic CDGC available for early experiments

2014-10-20 Thread Regan Heath via Digitalmars-d-announce
On Fri, 17 Oct 2014 17:54:55 +0100, Leandro Lucarella l...@llucax.com.ar wrote: Regan Heath, el 17 de October a las 15:43 me escribiste: I think you've mistook my tone. I am not religious about this. I just think it's a bad idea for a program to alter behaviour based on a largely invisible

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 eles...@gzk.dot 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 c...@dawg.eu wrote: Would this affect your code? Probably, but I have no D code of any size to care about.

Re: D2 port of Sociomantic CDGC available for early experiments

2014-10-17 Thread Regan Heath via Digitalmars-d-announce
On Fri, 17 Oct 2014 00:01:39 +0100, Leandro Lucarella l...@llucax.com.ar wrote: Regan Heath, el 14 de October a las 11:11 me escribiste: I still don't understand why wouldn't we use environment variables for what they've been created for, it's foolish :-) As mentioned this is not a very

Re: D2 port of Sociomantic CDGC available for early experiments

2014-10-16 Thread Regan Heath via Digitalmars-d-announce
On Thu, 16 Oct 2014 09:10:38 +0100, Dylan Knutson tcdknut...@gmail.com wrote: Wouldn't it be more generally useful to have another function like main() called init() which if present (optional) is called before/during initialisation. It would be passed the command line arguments.

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 code+news.digitalm...@dawg.eu 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

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 c...@dawg.eu 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

Re: D2 port of Sociomantic CDGC available for early experiments

2014-10-14 Thread Regan Heath via Digitalmars-d-announce
On Sat, 11 Oct 2014 01:45:48 +0100, Leandro Lucarella l...@llucax.com.ar wrote: Walter Bright, el 9 de October a las 17:28 me escribiste: On 10/9/2014 7:25 AM, Dicebot wrote: At the same time I don't see what real benefit such runtime options brings to the table. This is why in my PR

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 seewebsiteforem...@erdani.org 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

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 d...@me.com 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

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 newshou...@digitalmars.com 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

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 newshou...@digitalmars.com 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

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 newshou...@digitalmars.com 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,

Re: File needs to be closed on Windows but not on Posix, bug?

2014-07-07 Thread Regan Heath via Digitalmars-d-learn
On Mon, 07 Jul 2014 12:17:34 +0100, Joakim dl...@joakim.airpost.net wrote: On Monday, 7 July 2014 at 10:19:01 UTC, Kagamin wrote: See if stdio allows you to specify delete sharing when opening the file. I don't know what delete sharing is exactly, but the File constructor simply calls

Re: File needs to be closed on Windows but not on Posix, bug?

2014-07-07 Thread Regan Heath via Digitalmars-d-learn
On Mon, 07 Jul 2014 15:18:51 +0100, Jesse Phillips jesse.k.phillip...@gmail.com wrote: On Monday, 7 July 2014 at 12:00:48 UTC, Regan Heath wrote: But! I agree with Adam, leave it as a thin wrapper. Being a windows programmer by trade I would expect the remove to fail, I would not expect

Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs

2014-05-30 Thread Regan Heath via Digitalmars-d-announce
On Tue, 27 May 2014 22:40:00 +0100, Walter Bright newshou...@digitalmars.com wrote: On 5/27/2014 2:22 PM, w0rp wrote: I'm actually a native speaker of 25 years and I didn't get it at first. Natural language communicates ideas approximately. What bugs me is when people say: I could

Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs

2014-05-30 Thread Regan Heath via Digitalmars-d-announce
On Thu, 29 May 2014 20:40:10 +0100, Walter Bright newshou...@digitalmars.com wrote: On 5/29/2014 11:25 AM, Dmitry Olshansky wrote: Agreed. The simple dream of automatically decoding UTF and staying Unicode correct is a failure. Yes. Attempting to hide the fact that strings are UTF-8 is

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 maximechevali...@gmail.com 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

Re: The writeln() function's args can't be [一 ,二]?

2014-05-06 Thread Regan Heath via Digitalmars-d-learn
On Tue, 06 May 2014 15:48:44 +0100, Marc Schütz schue...@gmx.net wrote: On Tuesday, 6 May 2014 at 13:35:57 UTC, FrankLike wrote: The problem is that you have a wide-character comma (,) there. This works: void main() { writeln([一, 二]); } No,I mean the execute result is

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 deadal...@gmail.com 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 timon.g...@gmx.ch wrote: If this is a problem, I guess the most obvious alternatives are to: 1. Get rid of

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 timon.g...@gmx.ch 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

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 re...@netmail.co.nz wrote: On Wed, 30 Apr 2014 20:56:15 +0100, Timon Gehr timon.g...@gmx.ch 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

Re: A lot of people want to use D,but they only know MS SQL Server,what will help them to Learn D?

2014-05-01 Thread Regan Heath via Digitalmars-d-learn
On Thu, 01 May 2014 09:56:49 +0100, FrankLike 1150015...@qq.com wrote: On Monday, 14 April 2014 at 17:13:56 UTC, FrankLike wrote: My advice - use ODBC, it is the fastest way you may connect to the SQL server, and you already have everything you need for that. :) Regards I have test the

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 ola.fosheim.grostad+dl...@gmail.com 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++

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 re...@netmail.co.nz 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

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 schvei...@yahoo.com wrote: On Thu, 17 Apr 2014 17:29:47 -0400, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: On 4/17/2014 8:51 AM, Steven Schveighoffer wrote: Every time I open one of these messages I get a huge

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 digitalmars-d@puremagic.com 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

Re: DIP60: @nogc attribute

2014-04-17 Thread Regan Heath via Digitalmars-d
On Wed, 16 Apr 2014 18:38:23 +0100, Walter Bright newshou...@digitalmars.com 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