Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Monday, April 30, 2012 01:41:45 bearophile wrote: > Walter: > > What's your list? > > This thread now has something like 240 answers (and probably few > more will come), and despite some variability in the answers, we > have seen several recurring patterns too. So what are the > conclusions, ta

Re: Does D have too many features?

2012-04-29 Thread Jacob Carlborg
On 2012-04-29 20:08, Manu wrote: package confuses me, it's poorly documented. What are the protections between packages, sub-packages. Can parent packages see sub-package contents? vice-versa? As far as I know it works like this: pack |- pack1 |- foo.d |- bar.d |- pack2

Re: Does D have too many features?

2012-04-29 Thread jerro
Sorry, I managed to get myself confused here. What I meant to say was that I think >> should do an arithmetic shift if the operands are signed; unsigned shift otherwise. It does arithmetic shift if the left operand is signed, unsigned shift otherwise. This code: void main() { int a = 0xfff

Re: Does D have too many features?

2012-04-29 Thread Jacob Carlborg
On 2012-04-29 19:03, David Nadlinger wrote: Yes, but that requires the compiler to generate the return value »glue« code for continue/break inside an opApply foreach. If foreach is a library function and you pass an ordinary delegate, you have a problem in the current language since you can't kn

Re: Does D have too many features?

2012-04-29 Thread Jacob Carlborg
On 2012-04-29 18:28, Timon Gehr wrote: On 04/29/2012 04:53 PM, Jacob Carlborg wrote: On 2012-04-28 22:43, Timon Gehr wrote: On 04/28/2012 09:58 PM, foobar wrote: It should be replaced by a standard compilation API and the compiler should be able to use plugins/addons. Are you serious? Have

Re: Does D have too many features?

2012-04-29 Thread Andrej Mitrovic
On 4/30/12, Jesse Phillips wrote: > I believe DIP 4 is the proposal > > http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs > > But don't forget to check out DIP 5 too. Well it says they're both superseeded by DIP 6 but DIP6 didn't implement things DIP4 was talking about.DIP4 goes on to dis

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Monday, April 30, 2012 07:46:48 Andrej Mitrovic wrote: > On 4/30/12, Jonathan M Davis wrote: > > On Sunday, April 29, 2012 21:56:08 H. S. Teoh wrote: > >> I wonder if dmd (or rdmd) should have a mode where it *only* compiles > >> unittest code (i.e., no main() -- the resulting exe just runs uni

Re: Does D have too many features?

2012-04-29 Thread Andrej Mitrovic
On 4/30/12, H. S. Teoh wrote: > I think the correct solution here is to use alias. (If that doesn't > work, then it should be made to work..) It probably will. Quote Andrei: "Yah, we should add that at some point. Walter and I discussed about it and it's virtually approved. But to be on the conse

Re: Does D have too many features?

2012-04-29 Thread Andrej Mitrovic
On 4/30/12, Jonathan M Davis wrote: > On Sunday, April 29, 2012 21:56:08 H. S. Teoh wrote: >> I wonder if dmd (or rdmd) should have a mode where it *only* compiles >> unittest code (i.e., no main() -- the resulting exe just runs unittests >> and nothing else). For RDMD you can do: version(unittes

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Mon, Apr 30, 2012 at 07:07:53AM +0200, David Nadlinger wrote: > On Monday, 30 April 2012 at 03:16:09 UTC, H. S. Teoh wrote: > >On Sun, Apr 29, 2012 at 02:26:12PM +0200, David Nadlinger wrote: > >>[…] > >> - Built-in arrays and AAs: They are convenient to use, but as > >>far as I can see the sing

Re: Does D have too many features?

2012-04-29 Thread David Nadlinger
On Monday, 30 April 2012 at 03:16:09 UTC, H. S. Teoh wrote: On Sun, Apr 29, 2012 at 02:26:12PM +0200, David Nadlinger wrote: […] - Built-in arrays and AAs: They are convenient to use, but as far as I can see the single biggest GC dependency in the language. Why not lower array and AA litera

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Monday, April 30, 2012 06:58:18 David Nadlinger wrote: > On Monday, 30 April 2012 at 01:08:28 UTC, Jonathan M Davis wrote: > > On Sunday, April 29, 2012 17:50:48 Don wrote: > >> * package. I have no idea how a failed Java experiment got > >> incorporated > >> into D. > > > > Really? In some cas

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Sunday, April 29, 2012 21:56:08 H. S. Teoh wrote: > I wonder if dmd (or rdmd) should have a mode where it *only* compiles > unittest code (i.e., no main() -- the resulting exe just runs unittests > and nothing else). It wouldn't make sense. It's nowhere near as bad as C++, but dmd has to recom

Re: Does D have too many features?

2012-04-29 Thread David Nadlinger
On Monday, 30 April 2012 at 01:08:28 UTC, Jonathan M Davis wrote: On Sunday, April 29, 2012 17:50:48 Don wrote: * package. I have no idea how a failed Java experiment got incorporated into D. Really? In some cases, it's indispensable. For instance, once std.datetime has been split up, it wil

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Mon, Apr 30, 2012 at 05:16:55AM +0200, Alex Rønne Petersen wrote: > On 30-04-2012 05:03, H. S. Teoh wrote: [...] > >Also, unittest is just that: for _unit_ tests. If you start needing > >an entire framework for them, then you're no longer talking about > >_unit_ tests, you're talking about modul

Re: System signals

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 11:47:24PM +0200, deadalnix wrote: [...] > You misunderstood me (the sentence was not clear). I mean, you cannot > catch kill and the trick mentioned int he link is linux specific. > Obviously, the fact that you cannot catch kill isn't linux specific ;) Ah, I see. But real

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 10:26:40PM +0200, Alex Rønne Petersen wrote: > On 28-04-2012 22:43, H. S. Teoh wrote: [...] > >with statements. They make code hard to read, and besides you can (or > >should be able to) alias long expressions into a short identifier for > >this purpose anyway. > > I don't

Re: Does D have too many features?

2012-04-29 Thread Jesse Phillips
On Sunday, 29 April 2012 at 20:16:16 UTC, Andrej Mitrovic wrote: On 4/29/12, Alex Rønne Petersen wrote: Next up is the issue of op-assign operations. In D, you can't do: obj.foo += 1; obj.foo++; while in C#, you can (it results in a get -> add 1 -> set and get -> inc -> set, etc). It's g

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Mon, Apr 30, 2012 at 01:57:58AM +0200, Alex Rønne Petersen wrote: > On 30-04-2012 01:54, Era Scarecrow wrote: > >On Sunday, 29 April 2012 at 15:07:26 UTC, David Nadlinger wrote: > >>On Sunday, 29 April 2012 at 14:40:38 UTC, Jacob Carlborg wrote: [...] > >>We'd still need a solution for continue

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 04:40:37PM +0200, Jacob Carlborg wrote: [...] > * Do-while loops, how useful are those actually? OK, that got me all riled up about looping constructs, and now I'm provoked to rant: Since the advent of structured programming, looping constructs have always been somewhat b0

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 30-04-2012 05:34, Jonathan M Davis wrote: On Monday, April 30, 2012 05:20:21 Alex Rønne Petersen wrote: Except we can't do: @test void myTest() { // ... } due to the current lack of annotations and discovery-based reflection. ;) *hint hint...* What would that buy you? That's what u

[Q]STM with Strict ordering for Grid applications

2012-04-29 Thread vladp
hello, first message here. Just started learning about D Looking to see if D can be used as 'System language for Grid computing' Specifically for building up distributed coordinated services such as distributed File systems/etc. One specific thing I am looking for is Clojure avout like Software

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Monday, April 30, 2012 05:20:21 Alex Rønne Petersen wrote: > Except we can't do: > > @test > void myTest() > { > // ... > } > > due to the current lack of annotations and discovery-based reflection. ;) > > *hint hint...* What would that buy you? That's what unittest blocks are for. Yes,

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Monday, April 30, 2012 05:12:27 Kapps wrote: > On Monday, 30 April 2012 at 01:08:28 UTC, Jonathan M Davis wrote: > > On Sunday, April 29, 2012 17:50:48 Don wrote: > >> * package. I have no idea how a failed Java experiment got > >> incorporated > >> into D. > > > > Really? In some cases, it's i

Re: How can D become adopted at my company?

2012-04-29 Thread Walter Bright
On 4/29/2012 2:38 AM, Manu wrote: I'm interested to know is whether using a new precise GC will guarantee ALL unreferenced stuff will be cleaned on any given sweep. The new hook put into the typeinfo will do precise collection for references within GC allocated objects. For references that sit

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 30-04-2012 05:12, Jonathan M Davis wrote: On Sunday, April 29, 2012 20:03:44 H. S. Teoh wrote: On Sun, Apr 29, 2012 at 11:39:02PM +0200, deadalnix wrote: Le 29/04/2012 22:54, Alex Rønne Petersen a écrit : D unit tests were never really useful for anything beyond single-library projects IMHO

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 30-04-2012 05:03, H. S. Teoh wrote: On Sun, Apr 29, 2012 at 11:39:02PM +0200, deadalnix wrote: Le 29/04/2012 22:54, Alex Rønne Petersen a écrit : D unit tests were never really useful for anything beyond single-library projects IMHO. They don't scale for large, real-world application project

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 02:26:12PM +0200, David Nadlinger wrote: [...] > - Comma operator: Kill it with extreme prejudice, it is an > anti-feature (allow it in for loop expressions if you really want to, > but I think there are better solutions). +1. The voice of reason. [...] > - HexString,

Re: Does D have too many features?

2012-04-29 Thread Kapps
On Monday, 30 April 2012 at 01:08:28 UTC, Jonathan M Davis wrote: On Sunday, April 29, 2012 17:50:48 Don wrote: * package. I have no idea how a failed Java experiment got incorporated into D. Really? In some cases, it's indispensable. For instance, once std.datetime has been split up, it wil

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Sunday, April 29, 2012 20:03:44 H. S. Teoh wrote: > On Sun, Apr 29, 2012 at 11:39:02PM +0200, deadalnix wrote: > > Le 29/04/2012 22:54, Alex Rønne Petersen a écrit : > > >D unit tests were never really useful for anything beyond > > >single-library projects IMHO. They don't scale for large, real

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 30-04-2012 04:37, H. S. Teoh wrote: On Sun, Apr 29, 2012 at 08:42:23PM +0200, Andrej Mitrovic wrote: On 4/29/12, Jacob Carlborg wrote: In principle I agree with you. But in practice this doesn't always work. Take this for example: Prints "0" and "1" as expected. If we now change "point" to

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 11:39:02PM +0200, deadalnix wrote: > Le 29/04/2012 22:54, Alex Rønne Petersen a écrit : > >D unit tests were never really useful for anything beyond > >single-library projects IMHO. They don't scale for large, real-world > >application projects with lots of libraries and exe

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 10:03:43AM +0400, Dmitry Olshansky wrote: > On 29.04.2012 5:06, bearophile wrote: [...] > >Loops _must_ be fully efficient, they are a basic language construct, > >this is very important. Even foreach() is sometimes not equally > >efficient as a for() in some cases... > > >

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 03:06:53AM +0200, bearophile wrote: > Jonathan M Davis: > > >* foreach_reverse is essentially redudant at this point (not to > >mention > >confusing if combined with delegates), since we have retro. > > retro() can't replace foreach_reverse until the front-end > demonstrab

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Sunday, April 29, 2012 19:37:50 H. S. Teoh wrote: > On Sun, Apr 29, 2012 at 08:42:23PM +0200, Andrej Mitrovic wrote: > > On 4/29/12, Jacob Carlborg wrote: > > > In principle I agree with you. But in practice this doesn't always > > > work. Take this for example: Prints "0" and "1" as expected.

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 08:42:23PM +0200, Andrej Mitrovic wrote: > On 4/29/12, Jacob Carlborg wrote: > > In principle I agree with you. But in practice this doesn't always > > work. Take this for example: Prints "0" and "1" as expected. If we > > now change "point" to a property like this: It wil

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 11:18:12PM +0200, deadalnix wrote: [...] > C don't have out parameters as D have. C have pointer to do kind of > out parameters, and D have pointers too, this is a non issue. I argue that using 'out' vs. a pointer is a good thing, because it clarifies intent. When you see a

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 10:40:03PM +0200, Alex Rønne Petersen wrote: > On 29-04-2012 00:04, H. S. Teoh wrote: [...] > >Yeah, .sort is redundant, and besides shouldn't be an array > >"property" to begin with. [...] > Let's not forget .reverse. Why these are properties (and .dup/.idup) > is seriously

Re: Is it possible to build DMD using Windows SDK?

2012-04-29 Thread Andre Tampubolon
On 4/28/2012 9:01 PM, Rainer Schuetze wrote: > > > On 4/27/2012 7:30 AM, Andre Tampubolon wrote: >> On 4/27/2012 1:30 AM, Rainer Schuetze wrote: >>> >>> >>> On 4/26/2012 2:40 PM, Andre Tampubolon wrote: Rainer Schuetze wrote: > On 4/24/2012 6:43 PM, David Nadlinger wrote: >> On Tue

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 10:21:19PM +0200, Alex Rønne Petersen wrote: > On 29-04-2012 00:49, H. S. Teoh wrote: > >On Sun, Apr 29, 2012 at 12:39:03AM +0200, Timon Gehr wrote: [...] > >>- 'in' operator returning a pointer to the element. > > > >Yeah that one elicited a WAT from me when I first started

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 01:46:25AM -0700, Jonathan M Davis wrote: > On Sunday, April 29, 2012 10:37:10 Timon Gehr wrote: > > Well, what if the programmer "knows" that foo does not change 'aa', > > but it actually does? Then there would possibly be a segmentation > > fault. This implies that the 'i

Re: Shared with no type in Druntime.

2012-04-29 Thread Jakob Ovrum
On Sunday, 29 April 2012 at 15:21:10 UTC, Jacob Carlborg wrote: No, I think it's way better that the DI generator outputs the actually type instead of just "shared/auto" and the assignment. In this case: shared stdin = &_iob[0]; Should be generated as: shared File stdin; Anything to the rig

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 04:43:12PM +0200, Jacob Carlborg wrote: > On 2012-04-28 21:36, Andrej Mitrovic wrote: [...] > >Another feature I'm curious about is .dup/.idup. It's basically > >hardcoded for a couple of types, but why not instead use UFCS and > >implement .dup/.idup in std.array as a free

Re: Does D have too many features?

2012-04-29 Thread H. S. Teoh
On Sun, Apr 29, 2012 at 01:23:17PM +0200, Timon Gehr wrote: > On 04/29/2012 11:31 AM, foobar wrote: > >On Sunday, 29 April 2012 at 08:58:24 UTC, Timon Gehr wrote: [...] > >>It is not. For example, code that is only executed during CTFE does > >>never have to behave gracefully if the input is ill-fo

Re: Does D have too many features?

2012-04-29 Thread Artur Skawina
On 04/30/12 02:33, Simen Kjaeraas wrote: > On Sat, 28 Apr 2012 22:40:10 +0200, Artur Skawina wrote: > >> On 04/28/12 22:02, Walter Bright wrote: >>> On 4/28/2012 12:36 PM, Andrej Mitrovic wrote: Also there's mixin templates. What exactly is the difference between mixin templates and reg

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 30-04-2012 02:40, Robert Clipsham wrote: On 28/04/2012 20:22, Dmitry Olshansky wrote: 3. with statement (?). I kind of like it but bleh it's too boggy and it doesn't seem to pull its weight. (pointers? class references? a lot of stuff to go wrong) Fluent interfaces solve a good portion of its

Re: Does D have too many features?

2012-04-29 Thread Jonathan M Davis
On Sunday, April 29, 2012 17:50:48 Don wrote: > * package. I have no idea how a failed Java experiment got incorporated > into D. Really? In some cases, it's indispensable. For instance, once std.datetime has been split up, it will require it, or it would have duplicate a bunch of implementation

Re: Does D have too many features?

2012-04-29 Thread Robert Clipsham
On 28/04/2012 20:22, Dmitry Olshansky wrote: 3. with statement (?). I kind of like it but bleh it's too boggy and it doesn't seem to pull its weight. (pointers? class references? a lot of stuff to go wrong) Fluent interfaces solve a good portion of its benefits to be specific. My primary use ca

Re: Does D have too many features?

2012-04-29 Thread Simen Kjaeraas
On Sat, 28 Apr 2012 22:40:10 +0200, Artur Skawina wrote: On 04/28/12 22:02, Walter Bright wrote: On 4/28/2012 12:36 PM, Andrej Mitrovic wrote: Also there's mixin templates. What exactly is the difference between mixin templates and regular templates? A mixin template is instantiated in co

Re: How can D become adopted at my company?

2012-04-29 Thread Tove
On Sunday, 29 April 2012 at 23:04:00 UTC, Manu wrote: In some cases I'm comfortable with that type of fragmentation (large regularly sized resources), although that leads me to a gaping hole in D's allocation system... Hmmm I see, also I was thinking... since we have TLS, couldn't we abuse

Re: Does D have too many features?

2012-04-29 Thread Era Scarecrow
On Sunday, 29 April 2012 at 15:07:26 UTC, David Nadlinger wrote: On Sunday, 29 April 2012 at 14:40:38 UTC, Jacob Carlborg wrote: foreach ([1, 2, 3, 4], (i) { writeln(i); }); The above already works today. If we can a bit syntax sugar for delegates and inlinable delegates we could have this:

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 30-04-2012 01:54, Era Scarecrow wrote: On Sunday, 29 April 2012 at 15:07:26 UTC, David Nadlinger wrote: On Sunday, 29 April 2012 at 14:40:38 UTC, Jacob Carlborg wrote: foreach ([1, 2, 3, 4], (i) { writeln(i); }); The above already works today. If we can a bit syntax sugar for delegates and

Re: Does D have too many features?

2012-04-29 Thread Robert Clipsham
On 29/04/2012 19:08, Manu wrote: current module/package http://dlang.org/phobos/std_traits#packageName http://dlang.org/phobos/std_traits#moduleName -- Robert http://octarineparrot.com/

Re: Does D have too many features?

2012-04-29 Thread bearophile
Walter: What's your list? This thread now has something like 240 answers (and probably few more will come), and despite some variability in the answers, we have seen several recurring patterns too. So what are the conclusions, take-home insights, and the to-do's to make something in practi

Re: Does D have too many features?

2012-04-29 Thread David Nadlinger
On Sunday, 29 April 2012 at 21:06:10 UTC, Alex Rønne Petersen wrote: On 29-04-2012 22:24, SomeDude wrote: Ah ok. But I'm not sure what's wrong with the package protection level either, actually. Yes, me neither. And I have found many cases in my code where using it actually makes sense and h

Re: How can D become adopted at my company?

2012-04-29 Thread Manu
On 30 April 2012 01:24, Tove wrote: > On Sunday, 29 April 2012 at 22:13:22 UTC, Manu wrote: > >> Is it technically possible to have a precise GC clean up all unreferenced >> memory in one big pass? >> > > yes, but unless it's also moving/compacting... one would suffer memory > fragmentation... so

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 30-04-2012 00:08, Timon Gehr wrote: On 04/29/2012 10:59 PM, Alex Rønne Petersen wrote: On 29-04-2012 14:26, David Nadlinger wrote: - Unsigned right shift, but I can see how it can be useful (simply underused?). It's clear that arithmetic right shift is what the programmer usually wants, an

Re: How can D become adopted at my company?

2012-04-29 Thread Tove
On Sunday, 29 April 2012 at 22:13:22 UTC, Manu wrote: Is it technically possible to have a precise GC clean up all unreferenced memory in one big pass? yes, but unless it's also moving/compacting... one would suffer memory fragmentation... so I would imagine TempAlloc is a better fit?

Re: lazy is broken, but we have delegates

2012-04-29 Thread deadalnix
Le 30/04/2012 00:03, Peter Alexander a écrit : So, in short, all expressions have an implicit conversion to 'typeof(Expression) delegate()'. Seems reasonable at first glance, although I get the feeling it will have nasty edge cases. Implicit conversions generally do seem to cause trouble. Yes,

Re: How can D become adopted at my company?

2012-04-29 Thread Manu
On 29 April 2012 16:53, Sean Kelly wrote: > On Apr 29, 2012, at 2:38 AM, Manu wrote: > > On 28 April 2012 18:16, Peter Alexander wrote: > >> On Saturday, 28 April 2012 at 09:14:51 UTC, SomeDude wrote: >> >>> On Saturday, 28 April 2012 at 09:12:23 UTC, SomeDude wrote: >>> Real time guar

Re: Does D have too many features?

2012-04-29 Thread Timon Gehr
On 04/29/2012 10:59 PM, Alex Rønne Petersen wrote: On 29-04-2012 14:26, David Nadlinger wrote: - Unsigned right shift, but I can see how it can be useful (simply underused?). It's clear that arithmetic right shift is what the programmer usually wants, and yet, we use >> to denote what they don

Re: Does D have too many features?

2012-04-29 Thread David Nadlinger
On Sunday, 29 April 2012 at 21:23:41 UTC, SomeDude wrote: On Sunday, 29 April 2012 at 19:19:51 UTC, David Nadlinger wrote: What I forgot to mention: - VersionCondition: Just provide a mechanism to map command line flags to constants, probably in a magic »version« namespace, and use static if (

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 23:54, Peter Alexander wrote: On Sunday, 29 April 2012 at 21:18:40 UTC, deadalnix wrote: Le 29/04/2012 03:06, bearophile a écrit : Jonathan M Davis: * foreach_reverse is essentially redudant at this point (not to mention confusing if combined with delegates), since we have retro

Re: Does D have too many features?

2012-04-29 Thread Manu
On 29 April 2012 23:00, Alex Rønne Petersen wrote: > On 28-04-2012 23:18, SomeDude wrote: > >> Yeah, but core language AA are so useful it would be a MAJOR mistake to >> remove them. In Python too, you could put the AA in the libraries. Yet >> everybody uses the AA that are in the language. >> >>

Re: lazy is broken, but we have delegates

2012-04-29 Thread Peter Alexander
So, in short, all expressions have an implicit conversion to 'typeof(Expression) delegate()'. Seems reasonable at first glance, although I get the feeling it will have nasty edge cases. Implicit conversions generally do seem to cause trouble.

Re: Does D have too many features?

2012-04-29 Thread Peter Alexander
On Sunday, 29 April 2012 at 21:18:40 UTC, deadalnix wrote: Le 29/04/2012 03:06, bearophile a écrit : Jonathan M Davis: * foreach_reverse is essentially redudant at this point (not to mention confusing if combined with delegates), since we have retro. retro() can't replace foreach_reverse un

lazy is broken, but we have delegates

2012-04-29 Thread deadalnix
OK, many people seems to want lazy to go. it is understandable : the feature is broken. lazy imply computation inside the function, but it is impossible to ensure anything about that computation (is it pure ? is it nothrow ? is it @safe, etc . . .). In fact, to be usefull, lazy need to be abl

Re: Does D have too many features?

2012-04-29 Thread Timon Gehr
On 04/29/2012 10:03 PM, Alex Rønne Petersen wrote: On 28-04-2012 23:41, Timon Gehr wrote: As I understand it, the 'agreed upon' design is that @property int foo() { return x; } @property void foo(int v) { x = v; } Would be completely equivalent to C#: int foo { set{ x = value; }; get{ return

Re: Does D have too many features?

2012-04-29 Thread akaz
On Saturday, 28 April 2012 at 19:58:03 UTC, foobar wrote: * di files - a library should encapsulate all the info required to use it. Java Jars, .Net assemblies and even old school; Pascal units all solved this long ago. I strongly support this.

Re: System signals

2012-04-29 Thread deadalnix
Le 29/04/2012 00:23, H. S. Teoh a écrit : On Sun, Apr 29, 2012 at 12:16:15AM +0200, deadalnix wrote: Le 28/04/2012 22:04, Andrea Fontana a écrit : How can i catch kill signal to gracefully shutdown my app? This can be used for other signals : http://www.deadalnix.me/2012/03/24/get-an-except

Re: Does D have too many features?

2012-04-29 Thread deadalnix
Le 29/04/2012 22:54, Alex Rønne Petersen a écrit : D unit tests were never really useful for anything beyond single-library projects IMHO. They don't scale for large, real-world application projects with lots of libraries and executables. +1 A good std.unittest + attributes is probably a bette

Re: Does D have too many features?

2012-04-29 Thread SomeDude
On Sunday, 29 April 2012 at 19:19:51 UTC, David Nadlinger wrote: On Sunday, 29 April 2012 at 12:26:13 UTC, David Nadlinger wrote: What I forgot to mention: - VersionCondition: Just provide a mechanism to map command line flags to constants, probably in a magic »version« namespace, and use stat

Re: Does D have too many features?

2012-04-29 Thread deadalnix
Le 29/04/2012 03:06, bearophile a écrit : Jonathan M Davis: * foreach_reverse is essentially redudant at this point (not to mention confusing if combined with delegates), since we have retro. retro() can't replace foreach_reverse until the front-end demonstrability produces asm code equally e

Re: Does D have too many features?

2012-04-29 Thread SomeDude
On Sunday, 29 April 2012 at 20:54:11 UTC, Alex Rønne Petersen wrote: - unit tests I would rather have them as a library. D unit tests were never really useful for anything beyond single-library projects IMHO. They don't scale for large, real-world application projects with lots of libraries a

Re: Does D have too many features?

2012-04-29 Thread deadalnix
Le 29/04/2012 21:30, Nick Sabalausky a écrit : "deadalnix" wrote in message news:jnhopd$gi3$1...@digitalmars.com... - out arguments. We can return tuples, out argument is going backward in history. You can overload on out parameters. You can't overload on return type. So without "out" maki

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 22:16, Andrej Mitrovic wrote: On 4/29/12, Alex Rønne Petersen wrote: Next up is the issue of op-assign operations. In D, you can't do: obj.foo += 1; obj.foo++; while in C#, you can (it results in a get -> add 1 -> set and get -> inc -> set, etc). It's great to see another

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 22:52, Andrej Mitrovic wrote: On 4/29/12, Andrej Mitrovic wrote: struct Foo { auto opIn_r(string op)(int i) { return 1; } } Sorry that's wrong, should be: struct Foo { auto opIn_r(int i) { return 1; } } And then you get: test.d(25): Error: function test.Foo.opIn_r (in

Re: Does D have too many features?

2012-04-29 Thread deadalnix
Le 29/04/2012 22:40, Alex Rønne Petersen a écrit : On 29-04-2012 00:04, H. S. Teoh wrote: On Sat, Apr 28, 2012 at 11:58:19PM +0200, deadalnix wrote: [...] - is is messed up. It is a massive hack and have to be rationalized. As I said in another thread, the _functionality_ of various is() expr

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 16:40, Jacob Carlborg wrote: On 2012-04-28 20:47, Walter Bright wrote: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not add significant value? A couple already agreed upon ones are typedef and the cfloat

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 22:24, SomeDude wrote: On Sunday, 29 April 2012 at 18:47:11 UTC, David Nadlinger wrote: On Sunday, 29 April 2012 at 18:39:49 UTC, SomeDude wrote: What's wrong with packages ? Nothing – this is about the »package« protection level, not packages. ;) David Ah ok. But I'm not sur

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 21:19, David Nadlinger wrote: On Sunday, 29 April 2012 at 12:26:13 UTC, David Nadlinger wrote: On Saturday, 28 April 2012 at 18:48:18 UTC, Walter Bright wrote: What's your list? My personal list of features I could easily live without – some of these might be controversial, but

Re: Does D have too many features?

2012-04-29 Thread SomeDude
On Saturday, 28 April 2012 at 23:41:29 UTC, Peter Alexander wrote: But in D the main purpose of "pure" is not as optimization tool, but more as a tool to enforce a better coding style, that makes code understanding (and testing simpler), and helps avoid some bugs, coming from using variables

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 14:26, David Nadlinger wrote: On Saturday, 28 April 2012 at 18:48:18 UTC, Walter Bright wrote: What's your list? My personal list of features I could easily live without – some of these might be controversial, but yes, I have written non-trivial amounts of code in both D1 and D2:

Re: Does D have too many features?

2012-04-29 Thread bearophile
Alex Rønne Petersen: D unit tests were never really useful for anything beyond single-library projects IMHO. They don't scale for large, real-world application projects with lots of libraries and executables. I think D has to offers means to library writers to instrument the built-in unit-t

Re: Does D have too many features?

2012-04-29 Thread bearophile
Alex Rønne Petersen: - lazy, I use it only for logging lazy is horribly broken in many ways.< Sometimes I use std.exception.enforce(), that uses lazy. Bye, bearophile

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 08:31, Paulo Pinto wrote: Am 28.04.2012 20:47, schrieb Walter Bright: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not add significant value? A couple already agreed upon ones are typedef and the cfloat,

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 03:20, ponce wrote: Le 28/04/2012 20:47, Walter Bright a écrit : What's your list? - builtin complex types (I don't _need_ be able to write "4 + 5i") +1. - builtin associative arrays - some builtin properties like arr.sort +1, and .reverse. I'm also against .dup and .idup b

Re: Does D have too many features?

2012-04-29 Thread Andrej Mitrovic
On 4/29/12, Andrej Mitrovic wrote: > struct Foo { > auto opIn_r(string op)(int i) { return 1; } > } Sorry that's wrong, should be: struct Foo { auto opIn_r(int i) { return 1; } } And then you get: test.d(25): Error: function test.Foo.opIn_r (int i) is not callable using argument types (s

Re: Does D have too many features?

2012-04-29 Thread Andrej Mitrovic
On 4/29/12, Alex Rønne Petersen wrote: > I hate to nitpick and all that, but opBinaryRight!"in" actually works > now. ;) Yes and then you get to have those nice template instantiation errors, which make no sense at all: struct Foo { auto opIn_r(string op)(int i) { return 1; } } struct Bar {

Re: Does D have too many features?

2012-04-29 Thread SomeDude
On Sunday, 29 April 2012 at 20:00:27 UTC, Alex Rønne Petersen wrote: Let's get a standard package manager that we either advocate on dlang.org or include in the releases before we start talking about reducing the amount of modules in Phobos. Don't get me wrong. I don't want to reduce the amo

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 03:40, Jonathan M Davis wrote: On Sunday, April 29, 2012 03:06:53 bearophile wrote: * Increasingly, I don't like UFCS. I think that in most cases, it complicates code for little value. And I _really_ don't like how it results in people flipping chains of a(b(c(d(5 calls into so

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 03:06, bearophile wrote: Jonathan M Davis: * foreach_reverse is essentially redudant at this point (not to mention confusing if combined with delegates), since we have retro. retro() can't replace foreach_reverse until the front-end demonstrability produces asm code equally effi

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 00:04, H. S. Teoh wrote: On Sat, Apr 28, 2012 at 11:58:19PM +0200, deadalnix wrote: [...] - is is messed up. It is a massive hack and have to be rationalized. As I said in another thread, the _functionality_ of various is() expressions are very useful and should be kept. But th

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 00:18, Manu wrote: On 28 April 2012 21:47, Walter Bright mailto:newshou...@digitalmars.com>> wrote: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not add significant value? A couple alread

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 01:41, Peter Alexander wrote: On Saturday, 28 April 2012 at 23:29:35 UTC, bearophile wrote: Peter Alexander: f(x) ---> x.f() is not progress in language design. I used to think the same. But Haskell offers "." and $ to chain functions and remove parentheses, F# has the |> pipe

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 29-04-2012 00:30, Manu wrote: On 29 April 2012 00:42, Peter Alexander mailto:peter.alexander...@gmail.com>> wrote: On Saturday, 28 April 2012 at 18:48:18 UTC, Walter Bright wrote: Andrei and I had a fun discussion last night about this question. The idea was which feature

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 28-04-2012 23:59, H. S. Teoh wrote: On Sat, Apr 28, 2012 at 11:42:31PM +0200, Peter Alexander wrote: [...] - UFCS. It's just sugar, but adds complexity. On the contrary, it's a major helper for writing generic code. In my new AA implementation, I use UFCS to provide a default toHash functio

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 28-04-2012 23:20, Adam D. Ruppe wrote: On Saturday, 28 April 2012 at 18:48:18 UTC, Walter Bright wrote: What's your list? I think most the responses to this thread are insane. But, there is one thing I don't think D needs: new. I'm pretty sure it could be done in the library now that we ha

Re: Does D have too many features?

2012-04-29 Thread Alex Rønne Petersen
On 28-04-2012 22:43, H. S. Teoh wrote: On Sat, Apr 28, 2012 at 11:47:31AM -0700, Walter Bright wrote: Andrei and I had a fun discussion last night about this question. The idea was which features in D are redundant and/or do not add significant value? A couple already agreed upon ones are typed

Re: Does D have too many features?

2012-04-29 Thread SomeDude
On Sunday, 29 April 2012 at 18:47:11 UTC, David Nadlinger wrote: On Sunday, 29 April 2012 at 18:39:49 UTC, SomeDude wrote: What's wrong with packages ? Nothing – this is about the »package« protection level, not packages. ;) David Ah ok. But I'm not sure what's wrong with the package prot

  1   2   >