Re: Just where has this language gone wrong?

2012-07-24 Thread Chris NS
On Tuesday, 24 July 2012 at 02:51:44 UTC, H. S. Teoh wrote: Reminds of a certain individual who shall remain unnamed, with whom I argued about why he should *not* implement IPv6 prefix checking by converting the address and prefixes to strings and then using strncmp()... Truly boggles the

Re: Just where has this language gone wrong?

2012-07-24 Thread Paulo Pinto
Stuart wrote in message news:nnyvtncaxpgnjtklv...@forum.dlang.org... On Monday, 23 July 2012 at 15:56:37 UTC, Paulo Pinto wrote: Am 23.07.2012 14:49, schrieb Stuart: On Saturday, 21 July 2012 at 22:16:52 UTC, Nick Sabalausky wrote: C++ is living in the 70's. Precisely what I have been

Re: Just where has this language gone wrong?

2012-07-24 Thread Paulo Pinto
Nick Sabalausky wrote in message news:20120723171909.0527@unknown... On Mon, 23 Jul 2012 22:51:19 +0200 Stuart stu...@gmx.com wrote: On Monday, 23 July 2012 at 15:56:37 UTC, Paulo Pinto wrote: Am 23.07.2012 14:49, schrieb Stuart: On Saturday, 21 July 2012 at 22:16:52 UTC, Nick

Re: Just where has this language gone wrong?

2012-07-24 Thread Nick Sabalausky
On Tue, 24 Jul 2012 08:40:13 +0200 Chris NS ibisbase...@gmail.com wrote: On Tuesday, 24 July 2012 at 02:51:44 UTC, H. S. Teoh wrote: Reminds of a certain individual who shall remain unnamed, with whom I argued about why he should *not* implement IPv6 prefix checking by converting

Re: Just where has this language gone wrong?

2012-07-24 Thread Jens Mueller
David Nadlinger wrote: On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote: Where is argmin defined? I couldn't find it. On the slide before that… ;) :) Jens

Re: Just where has this language gone wrong?

2012-07-24 Thread Simen Kjaeraas
On Tue, 24 Jul 2012 04:21:18 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Tuple!(float, x, float, y) bar() { return typeof(return)( 0.0, 0.0 ); } [snip] We could make return tuple(0.0, 0.0); to work. I can't imagine a scenario in which this relaxation would cause a

Re: Just where has this language gone wrong?

2012-07-24 Thread Jonathan M Davis
On Tuesday, July 24, 2012 11:03:16 Simen Kjaeraas wrote: On Tue, 24 Jul 2012 04:21:18 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Tuple!(float, x, float, y) bar() { return typeof(return)( 0.0, 0.0 ); } [snip] We could make return tuple(0.0, 0.0); to

Re: Just where has this language gone wrong?

2012-07-24 Thread Simen Kjaeraas
On Tue, 24 Jul 2012 13:00:44 +0200, Jonathan M Davis jmdavisp...@gmx.com wrote: On Tuesday, July 24, 2012 11:03:16 Simen Kjaeraas wrote: On Tue, 24 Jul 2012 04:21:18 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Tuple!(float, x, float, y) bar() { return typeof(return)(

Re: Just where has this language gone wrong?

2012-07-24 Thread Andrei Alexandrescu
On 7/24/12 5:03 AM, Simen Kjaeraas wrote: On Tue, 24 Jul 2012 04:21:18 +0200, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Tuple!(float, x, float, y) bar() { return typeof(return)( 0.0, 0.0 ); } [snip] We could make return tuple(0.0, 0.0); to work. I can't imagine a scenario in

Re: Just where has this language gone wrong?

2012-07-24 Thread Stuart
On Monday, 23 July 2012 at 21:14:31 UTC, Simen Kjaeraas wrote: On Mon, 23 Jul 2012 22:51:19 +0200, Stuart stu...@gmx.com wrote: Saves us having to create a struct for every goddamn little function; or using tuples directly, which means we have to refer to variables like .value1 and .value2

Re: Just where has this language gone wrong?

2012-07-24 Thread Regan Heath
On Tue, 24 Jul 2012 15:42:19 +0100, Stuart stu...@gmx.com wrote: On Monday, 23 July 2012 at 21:14:31 UTC, Simen Kjaeraas wrote: On Mon, 23 Jul 2012 22:51:19 +0200, Stuart stu...@gmx.com wrote: Saves us having to create a struct for every goddamn little function; or using tuples directly,

Re: Just where has this language gone wrong?

2012-07-24 Thread H. S. Teoh
On Tue, Jul 24, 2012 at 03:49:14PM +0100, Regan Heath wrote: On Tue, 24 Jul 2012 15:42:19 +0100, Stuart stu...@gmx.com wrote: [...] You mean it's already supported? Nice! Although, It'd still be awesome to be able to do things like: auto a,b = bar(); auto c,_ = bar(); Sadly the

Re: Just where has this language gone wrong?

2012-07-24 Thread Simen Kjaeraas
On Tue, 24 Jul 2012 16:42:19 +0200, Stuart stu...@gmx.com wrote: You mean it's already supported? Nice! That's what I mean. :p Although, It'd still be awesome to be able to do things like: auto a,b = bar(); auto c,_ = bar(); That would be nice, and has been on the table

Re: Just where has this language gone wrong?

2012-07-24 Thread Stuart
On Tuesday, 24 July 2012 at 14:50:02 UTC, Regan Heath wrote: On Tue, 24 Jul 2012 15:42:19 +0100, Stuart stu...@gmx.com wrote: You mean it's already supported? Nice! Although, It'd still be awesome to be able to do things like: auto a,b = bar(); auto c,_ = bar(); Sadly the comma

Re: Just where has this language gone wrong?

2012-07-24 Thread Ali Çehreli
On 07/24/2012 07:42 AM, Stuart wrote: You mean it's already supported? Nice! Although, It'd still be awesome to be able to do things like: auto a,b = bar(); auto c,_ = bar(); Works in foreach loops: foreach (a, b; hasTupleElements) The element type of the following range of map

Re: Just where has this language gone wrong?

2012-07-24 Thread Andrej Mitrovic
On 7/24/12, H. S. Teoh hst...@quickfur.ath.cx wrote: The comma operator must go. The comma operator needs to die a fast but painful death. I've had this sort of bug recently: int getInt(string op) { if (op, a) return 1; else if (op == b) return 2; else

Re: Just where has this language gone wrong?

2012-07-24 Thread Russel Winder
On Tue, 2012-07-24 at 16:59 +0200, Simen Kjaeraas wrote: […] ...which inspired me to write this implementation of fibonacci: T fib(T = int)(int n, T a = 0, T b = 1) { while ( n-- ) { TypeTuple!(a,b) = tuple(b, a +b); } return a; } Or possibly better: long

Re: Just where has this language gone wrong?

2012-07-24 Thread Simen Kjaeraas
On Tue, 24 Jul 2012 19:02:07 +0200, Russel Winder rus...@winder.org.uk wrote: On Tue, 2012-07-24 at 16:59 +0200, Simen Kjaeraas wrote: […] ...which inspired me to write this implementation of fibonacci: T fib(T = int)(int n, T a = 0, T b = 1) { while ( n-- ) { TypeTuple!(a,b)

Re: Just where has this language gone wrong?

2012-07-24 Thread Era Scarecrow
On Tuesday, 24 July 2012 at 06:40:14 UTC, Chris NS wrote: On Tuesday, 24 July 2012 at 02:51:44 UTC, H. S. Teoh wrote: Reminds of a certain individual who shall remain unnamed, with whom I argued about why he should *not* implement IPv6 prefix checking by converting the address and prefixes

Re: Just where has this language gone wrong?

2012-07-24 Thread Era Scarecrow
On Tuesday, 24 July 2012 at 22:38:07 UTC, Era Scarecrow wrote: documented' because they couldn't understand what were for. Sorry my filter stripped that out. They couldn't understand what and were for.

Re: Just where has this language gone wrong?

2012-07-24 Thread Andrei Alexandrescu
On 7/24/12 6:48 PM, Era Scarecrow wrote: On Tuesday, 24 July 2012 at 22:38:07 UTC, Era Scarecrow wrote: documented' because they couldn't understand what were for. Sorry my filter stripped that out. They couldn't understand what and were for. x = 2; // if x much greater than 2, assign 2

Re: Just where has this language gone wrong?

2012-07-24 Thread Chris NS
On Tuesday, 24 July 2012 at 22:38:07 UTC, Era Scarecrow wrote: [code] //remember, java String toGuid(byte input[16]) { String ID = {; if (Integer.toHexString(input[5]).length 2) ID = ID + 0; ID = ID + Integer.toHexString(input[5]); if (Integer.toHexString(input[6]).length 2)

Re: Just where has this language gone wrong?

2012-07-24 Thread Nick Sabalausky
On Wed, 25 Jul 2012 03:52:28 +0200 Chris NS ibisbase...@gmail.com wrote: Erm, so that I'm not completely off-topic: I know where D has truly gone wrong. There's just too many damn semi-colons! Nah, I know exactly where it went wrong. Albuquerque. Shoulda gone left.

Re: Just where has this language gone wrong?

2012-07-24 Thread Stuart
I've only recently discovered D, and I already think it's great. I mean, where else am I going to find a language that [a] compiles to native code, [b] has classes, [c] has no stupid flat-file #include system, and [d] has a GC? Honestly, I can't think of any others! I really don't understand

Re: Just where has this language gone wrong?

2012-07-23 Thread monarch_dodra
On Sunday, 22 July 2012 at 21:10:08 UTC, Andrei Alexandrescu wrote: On 7/22/12 12:32 PM, David Nadlinger wrote: On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote: Where is argmin defined? I couldn't find it. On the slide before that… ;) I think argmin is intuitive, popular, and

Re: Just where has this language gone wrong?

2012-07-23 Thread Stuart
On Saturday, 21 July 2012 at 22:16:52 UTC, Nick Sabalausky wrote: C++ is living in the 70's. Precisely what I have been thinking. It's a loose wrapper around assembly, nothing more. Certainly not the high-level language it's touted as.

Re: Just where has this language gone wrong?

2012-07-23 Thread Paulo Pinto
Am 23.07.2012 14:49, schrieb Stuart: On Saturday, 21 July 2012 at 22:16:52 UTC, Nick Sabalausky wrote: C++ is living in the 70's. Precisely what I have been thinking. It's a loose wrapper around assembly, nothing more. Certainly not the high-level language it's touted as. Only due to the

Re: Just where has this language gone wrong?

2012-07-23 Thread Stuart
On Monday, 23 July 2012 at 15:56:37 UTC, Paulo Pinto wrote: Am 23.07.2012 14:49, schrieb Stuart: On Saturday, 21 July 2012 at 22:16:52 UTC, Nick Sabalausky wrote: C++ is living in the 70's. Precisely what I have been thinking. It's a loose wrapper around assembly, nothing more. Certainly

Re: Just where has this language gone wrong?

2012-07-23 Thread Stuart
On Monday, 23 July 2012 at 20:51:19 UTC, Stuart wrote: Incidentally, it'd be really handy to have anonymous tuples in D. Or perhaps I should've said named tuples. I dunno what the correct term might be. All I know is, I've only seen it in one or two obscure languages, and I've always wished

Re: Just where has this language gone wrong?

2012-07-23 Thread Simen Kjaeraas
On Mon, 23 Jul 2012 22:51:19 +0200, Stuart stu...@gmx.com wrote: Saves us having to create a struct for every goddamn little function; or using tuples directly, which means we have to refer to variables like .value1 and .value2 instead of something meaningful. You mean like this?

Re: Just where has this language gone wrong?

2012-07-23 Thread Nick Sabalausky
On Mon, 23 Jul 2012 22:51:19 +0200 Stuart stu...@gmx.com wrote: On Monday, 23 July 2012 at 15:56:37 UTC, Paulo Pinto wrote: Am 23.07.2012 14:49, schrieb Stuart: On Saturday, 21 July 2012 at 22:16:52 UTC, Nick Sabalausky wrote: C++ is living in the 70's. Precisely what I have been

Re: Just where has this language gone wrong?

2012-07-23 Thread Nick Sabalausky
On Mon, 23 Jul 2012 17:19:09 -0400 Nick Sabalausky seewebsitetocontac...@semitwist.com wrote: On Mon, 23 Jul 2012 22:51:19 +0200 Stuart stu...@gmx.com wrote: On Monday, 23 July 2012 at 15:56:37 UTC, Paulo Pinto wrote: Am 23.07.2012 14:49, schrieb Stuart: On Saturday, 21 July 2012 at

Re: Just where has this language gone wrong?

2012-07-23 Thread Nick Sabalausky
On Sun, 22 Jul 2012 20:24:19 +0200 Paulo Pinto pj...@progtools.org wrote: Am 22.07.2012 00:16, schrieb Nick Sabalausky: On Sat, 21 Jul 2012 23:14:12 +0200 Stuartstu...@gmx.com wrote: Let me just add, I really *like* the terse syntax of D. Lambdas, uniform function call syntax, and so

Re: Just where has this language gone wrong?

2012-07-23 Thread Andrei Alexandrescu
On 7/23/12 5:14 PM, Simen Kjaeraas wrote: On Mon, 23 Jul 2012 22:51:19 +0200, Stuart stu...@gmx.com wrote: Saves us having to create a struct for every goddamn little function; or using tuples directly, which means we have to refer to variables like .value1 and .value2 instead of something

Re: Just where has this language gone wrong?

2012-07-23 Thread H. S. Teoh
On Mon, Jul 23, 2012 at 10:00:24PM -0400, Nick Sabalausky wrote: On Sun, 22 Jul 2012 20:24:19 +0200 Paulo Pinto pj...@progtools.org wrote: [...] The type of programmer clogs we have in our projects are so low skill, that I have bad dreams what they could do in more powerfull languages.

Re: Just where has this language gone wrong?

2012-07-22 Thread monarch_dodra
On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote: Where is argmin defined? I couldn't find it. Jens Argmin don't exist, but it could, and that's what counts. The important thing in these slides is proof of concept, rather than actual code snippets. However, std.algorithm does

Re: Just where has this language gone wrong?

2012-07-22 Thread David Nadlinger
On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote: Where is argmin defined? I couldn't find it. On the slide before that… ;) David

Re: Just where has this language gone wrong?

2012-07-22 Thread Paulo Pinto
Am 22.07.2012 00:16, schrieb Nick Sabalausky: On Sat, 21 Jul 2012 23:14:12 +0200 Stuartstu...@gmx.com wrote: Let me just add, I really *like* the terse syntax of D. Lambdas, uniform function call syntax, and so on. Yea. I used Java in college and ever since then I've been a fan of

Re: Just where has this language gone wrong?

2012-07-22 Thread Nick Sabalausky
On Sun, 22 Jul 2012 20:24:19 +0200 Paulo Pinto pj...@progtools.org wrote: Am 22.07.2012 00:16, schrieb Nick Sabalausky: On Sat, 21 Jul 2012 23:14:12 +0200 Stuartstu...@gmx.com wrote: Let me just add, I really *like* the terse syntax of D. Lambdas, uniform function call syntax, and so

Re: Just where has this language gone wrong?

2012-07-22 Thread Andrei Alexandrescu
On 7/22/12 12:32 PM, David Nadlinger wrote: On Sunday, 22 July 2012 at 03:06:28 UTC, Jens Mueller wrote: Where is argmin defined? I couldn't find it. On the slide before that… ;) I think argmin is intuitive, popular, and useful enough to warrant a presence in std.algorithm. Would anyone

Re: Just where has this language gone wrong?

2012-07-22 Thread Paulo Pinto
Am 22.07.2012 21:28, schrieb Nick Sabalausky: On Sun, 22 Jul 2012 20:24:19 +0200 Paulo Pintopj...@progtools.org wrote: Am 22.07.2012 00:16, schrieb Nick Sabalausky: On Sat, 21 Jul 2012 23:14:12 +0200 Stuartstu...@gmx.com wrote: Let me just add, I really *like* the terse syntax of D.

Re: Just where has this language gone wrong?

2012-07-22 Thread Nick Sabalausky
On Sun, 22 Jul 2012 23:15:06 +0200 Paulo Pinto pj...@progtools.org wrote: Am 22.07.2012 21:28, schrieb Nick Sabalausky: On Sun, 22 Jul 2012 20:24:19 +0200 Paulo Pintopj...@progtools.org wrote: Am 22.07.2012 00:16, schrieb Nick Sabalausky: On Sat, 21 Jul 2012 23:14:12 +0200

Re: Just where has this language gone wrong?

2012-07-21 Thread Marco Leise
Am Fri, 20 Jul 2012 16:43:18 +0200 schrieb Jacob Carlborg d...@me.com: On 2012-07-20 16:33, Marco Leise wrote: I think C++ uses a pragmatic approach: No overhead for explicit initialization. But everything that goes into the executable and doesn't have a specific value, will go into

Re: Just where has this language gone wrong?

2012-07-21 Thread Stuart
Let me just add, I really *like* the terse syntax of D. Lambdas, uniform function call syntax, and so on. Although the most important difference between C++ and D, in my opinion, is the absence of the damn #include statement!! That archaic assembly-language-inspired way of cramming billions

Re: Just where has this language gone wrong?

2012-07-21 Thread Nick Sabalausky
On Sat, 21 Jul 2012 23:14:12 +0200 Stuart stu...@gmx.com wrote: Let me just add, I really *like* the terse syntax of D. Lambdas, uniform function call syntax, and so on. Yea. I used Java in college and ever since then I've been a fan of non-verbose systax - ie syntax that's the *opposite* of

Re: Just where has this language gone wrong?

2012-07-21 Thread Andrei Alexandrescu
On 7/21/12 6:16 PM, Nick Sabalausky wrote: Yea. I used Java in college and ever since then I've been a fan of non-verbose systax - ie syntax that's the *opposite* of Java ;) On slide 19 of the OSCON slides there's this sample: auto s = [abc, a, xz]; auto m = s.argmin!((x) = x.length); People

Re: Just where has this language gone wrong?

2012-07-21 Thread Nick Sabalausky
On Sat, 21 Jul 2012 18:24:04 -0400 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 7/21/12 6:16 PM, Nick Sabalausky wrote: Yea. I used Java in college and ever since then I've been a fan of non-verbose systax - ie syntax that's the *opposite* of Java ;) On slide 19 of the

Re: Just where has this language gone wrong?

2012-07-21 Thread Jens Mueller
Nick Sabalausky wrote: On Sat, 21 Jul 2012 18:24:04 -0400 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 7/21/12 6:16 PM, Nick Sabalausky wrote: Yea. I used Java in college and ever since then I've been a fan of non-verbose systax - ie syntax that's the *opposite* of Java

Re: Just where has this language gone wrong?

2012-07-20 Thread Jeff Nowakowski
On 07/19/2012 09:35 PM, Damian wrote: On Thursday, 19 July 2012 at 22:32:04 UTC, David Piepgrass wrote: Actually, C# has no default initialization* of local variables, and I love it. Instead, it is a compile-time error to read a variable if the compiler cannot guarantee that you have

Re: Just where has this language gone wrong?

2012-07-20 Thread Jacob Carlborg
On 2012-07-20 00:05, Nick Sabalausky wrote: No, this is why any C/C++ project should be replaced by D ;) I'm knee-deep in a C++ project right now, and the language is such a pedantic, anachronistic turd. C++'s *only* saving graces are: - It's a systems language (ie, native compiled with

Re: Just where has this language gone wrong?

2012-07-20 Thread Jacob Carlborg
On 2012-07-20 00:32, David Piepgrass wrote: Actually, C# has no default initialization* of local variables, and I love it. Instead, it is a compile-time error to read a variable if the compiler cannot guarantee that you have initialized it. IMO this is much better than D's let's initialize

Re: Just where has this language gone wrong?

2012-07-20 Thread Paulo Pinto
Jacob Carlborg wrote in message news:juaudk$2slh$1...@digitalmars.com... On 2012-07-20 00:05, Nick Sabalausky wrote: No, this is why any C/C++ project should be replaced by D ;) I'm knee-deep in a C++ project right now, and the language is such a pedantic, anachronistic turd. C++'s *only*

Re: Just where has this language gone wrong?

2012-07-20 Thread renoX
On Friday, 20 July 2012 at 06:40:18 UTC, Jacob Carlborg wrote: On 2012-07-20 00:32, David Piepgrass wrote: Actually, C# has no default initialization* of local variables, and I love it. Instead, it is a compile-time error to read a variable if the compiler cannot guarantee that you have

Re: Just where has this language gone wrong?

2012-07-20 Thread Marco Leise
Am Thu, 19 Jul 2012 22:43:17 +0200 schrieb Jacob Carlborg d...@me.com: On 2012-07-19 16:50, Alex Rønne Petersen wrote: In C++ it's even better (irony). It depends on what kind of variable is declared. I.e. a global variable, a local, instance or a class variable (static). Some of these

Re: Just where has this language gone wrong?

2012-07-20 Thread Jacob Carlborg
On 2012-07-20 16:33, Marco Leise wrote: I think C++ uses a pragmatic approach: No overhead for explicit initialization. But everything that goes into the executable and doesn't have a specific value, will go into the BSS section, where it A) takes up no space and B) the OS will take care of

Re: Just where has this language gone wrong?

2012-07-20 Thread Era Scarecrow
On Friday, 20 July 2012 at 08:17:03 UTC, renoX wrote: On Friday, 20 July 2012 at 06:40:18 UTC, Jacob Carlborg wrote: On 2012-07-20 00:32, David Piepgrass wrote: Actually, C# has no default initialization* of local variables, and I love it. Instead, it is a compile-time error to read a

Just where has this language gone wrong?

2012-07-19 Thread Petr Janda
Hi, I'm an occasional lurker on the D forums just to see where the language is going,but I'm a little puzzled. In another thread I found this code auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x = x.to!string); I don't understand whats going on here. Int array is getting sorted, then Uniqued,

Re: Just where has this language gone wrong?

2012-07-19 Thread q66
On Thursday, 19 July 2012 at 14:21:47 UTC, Petr Janda wrote: Hi, I'm an occasional lurker on the D forums just to see where the language is going,but I'm a little puzzled. In another thread I found this code auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x = x.to!string); I don't understand whats

Re: Just where has this language gone wrong?

2012-07-19 Thread David
Am 19.07.2012 16:21, schrieb Petr Janda: Hi, I'm an occasional lurker on the D forums just to see where the language is going,but I'm a little puzzled. In another thread I found this code auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x = x.to!string); I don't understand whats going on here. Int

Re: Just where has this language gone wrong?

2012-07-19 Thread q66
btw - as for your complains - I would blame poor D documentation more than the feature itself; as for what type is x, it's inferred from the prototype of the called function; type inference is a standard feature in many static languages.

Re: Just where has this language gone wrong?

2012-07-19 Thread Robik
On Thursday, 19 July 2012 at 14:21:47 UTC, Petr Janda wrote: Hi, Hi I'm an occasional lurker on the D forums just to see where the language is going,but I'm a little puzzled. In another thread I found this code auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x = x.to!string); Here's list what

Re: Just where has this language gone wrong?

2012-07-19 Thread Christophe Travert
q66 , dans le message (digitalmars.D:172716), a écrit : (so instead of calling a(b(c(d(e(f) you can just call a.b.c.d.e.f()) rather f.e.d.c.b.a, if you omit the empty parenthesis after each letter (but f).

Re: Just where has this language gone wrong?

2012-07-19 Thread Alex Rønne Petersen
On 19-07-2012 16:31, Petr Janda wrote: Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map). Everything was recently introduced around 2.059. Ok, but what is map!(). What's the point of the exclamation mark, is it a template specialization?

Re: Just where has this language gone wrong?

2012-07-19 Thread q66
On Thursday, 19 July 2012 at 14:31:41 UTC, Petr Janda wrote: Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map). Everything was recently introduced around 2.059. Ok, but what is map!(). What's the point of the exclamation mark, is it a

Re: Just where has this language gone wrong?

2012-07-19 Thread Petr Janda
Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map). Everything was recently introduced around 2.059. Ok, but what is map!(). What's the point of the exclamation mark, is it a template specialization?

Re: Just where has this language gone wrong?

2012-07-19 Thread q66
On Thursday, 19 July 2012 at 14:33:49 UTC, q66 wrote: On Thursday, 19 July 2012 at 14:31:41 UTC, Petr Janda wrote: Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map). Everything was recently introduced around 2.059. Ok, but what is map!().

Re: Just where has this language gone wrong?

2012-07-19 Thread David
Am 19.07.2012 16:31, schrieb Petr Janda: Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map). Everything was recently introduced around 2.059. Ok, but what is map!(). What's the point of the exclamation mark, is it a template specialization?

Re: Just where has this language gone wrong?

2012-07-19 Thread Christophe Travert
Petr Janda , dans le message (digitalmars.D:172719), a écrit : Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map). Everything was recently introduced around 2.059. Ok, but what is map!(). What's the point of the exclamation mark, is it a

Re: Just where has this language gone wrong?

2012-07-19 Thread Petr Janda
On Thursday, 19 July 2012 at 14:31:53 UTC, trav...@phare.normalesup.org (Christophe Travert) wrote: q66 , dans le message (digitalmars.D:172716), a écrit : (so instead of calling a(b(c(d(e(f) you can just call a.b.c.d.e.f()) rather f.e.d.c.b.a, if you omit the empty parenthesis after

Re: Just where has this language gone wrong?

2012-07-19 Thread Christophe Travert
Robik , dans le message (digitalmars.D:172718), a écrit : On Thursday, 19 July 2012 at 14:21:47 UTC, Petr Janda wrote: Hi, Hi I'm an occasional lurker on the D forums just to see where the language is going,but I'm a little puzzled. In another thread I found this code auto r = [5, 3,

Re: Just where has this language gone wrong?

2012-07-19 Thread Alex Rønne Petersen
On 19-07-2012 16:36, Christophe Travert wrote: Petr Janda , dans le message (digitalmars.D:172719), a écrit : Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map). Everything was recently introduced around 2.059. Ok, but what is map!(). What's

Re: Just where has this language gone wrong?

2012-07-19 Thread Christophe Travert
Petr Janda , dans le message (digitalmars.D:172727), a écrit : On Thursday, 19 July 2012 at 14:31:53 UTC, trav...@phare.normalesup.org (Christophe Travert) wrote: q66 , dans le message (digitalmars.D:172716), a écrit : (so instead of calling a(b(c(d(e(f) you can just call a.b.c.d.e.f())

Re: Just where has this language gone wrong?

2012-07-19 Thread Christophe Travert
Alex Rønne Petersen , dans le message (digitalmars.D:172728), a écrit : On 19-07-2012 16:36, Christophe Travert wrote: Petr Janda , dans le message (digitalmars.D:172719), a écrit : Array gets sorted, then doubles are removed (uniq) and then everything is converted to a string (map).

Re: Just where has this language gone wrong?

2012-07-19 Thread Alex Rønne Petersen
On 19-07-2012 16:21, Petr Janda wrote: Hi, I'm an occasional lurker on the D forums just to see where the language is going,but I'm a little puzzled. In another thread I found this code auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x = x.to!string); I don't understand whats going on here. Int array

Re: Just where has this language gone wrong?

2012-07-19 Thread Timon Gehr
On 07/19/2012 04:21 PM, Petr Janda wrote: Hi, I'm an occasional lurker on the D forums just to see where the language is going,but I'm a little puzzled. In another thread I found this code auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x = x.to!string); I don't understand whats going on here. Int

Re: Just where has this language gone wrong?

2012-07-19 Thread Petr Janda
No, please, template instantiation. Specialization is something completely different, and doesn't happen at the call site. Sorry, my fault. I'm a non-native english speaker. What I meant is calling functionstring(args) I think it's called instantiation.

Re: Just where has this language gone wrong?

2012-07-19 Thread Petr Janda
It's just syntax. Eliminating syntax noise is fine. Code should look like what it does. Not if eliminating noise equals to making things harder to understand. When you say (int x) { return x; } it's clear about what it is, a _function_ without name.

Re: Just where has this language gone wrong?

2012-07-19 Thread Timon Gehr
On 07/19/2012 05:03 PM, Petr Janda wrote: It's just syntax. Eliminating syntax noise is fine. Code should look like what it does. Not if eliminating noise equals to making things harder to understand. Harder to understand to whom? Optimizing stuff for beginners usually makes it a PITA to

Re: Just where has this language gone wrong?

2012-07-19 Thread Timon Gehr
On 07/19/2012 04:39 PM, Petr Janda wrote: On Thursday, 19 July 2012 at 14:31:53 UTC, trav...@phare.normalesup.org (Christophe Travert) wrote: q66 , dans le message (digitalmars.D:172716), a écrit : (so instead of calling a(b(c(d(e(f) you can just call a.b.c.d.e.f()) rather f.e.d.c.b.a,

Re: Just where has this language gone wrong?

2012-07-19 Thread Brad Anderson
On Thu, Jul 19, 2012 at 9:03 AM, Petr Janda janda.p...@gmail.com wrote: It's just syntax. Eliminating syntax noise is fine. Code should look like what it does. Not if eliminating noise equals to making things harder to understand. When you say (int x) { return x; } it's clear about what it

Re: Just where has this language gone wrong?

2012-07-19 Thread Brad Anderson
On Thu, Jul 19, 2012 at 9:20 AM, Brad Anderson e...@gnuk.net wrote: On Thu, Jul 19, 2012 at 9:03 AM, Petr Janda janda.p...@gmail.com wrote: It's just syntax. Eliminating syntax noise is fine. Code should look like what it does. Not if eliminating noise equals to making things harder to

Re: Just where has this language gone wrong?

2012-07-19 Thread Timon Gehr
On 07/19/2012 05:20 PM, Brad Anderson wrote: On Thu, Jul 19, 2012 at 9:03 AM, Petr Janda janda.p...@gmail.com mailto:janda.p...@gmail.com wrote: It's just syntax. Eliminating syntax noise is fine. Code should look like what it does. Not if eliminating noise equals to

Re: Just where has this language gone wrong?

2012-07-19 Thread David Nadlinger
On Thursday, 19 July 2012 at 14:51:59 UTC, Timon Gehr wrote: On another note, (copied from wikipedia) foreach(item; set) { // do something to item } what's with the lax syntax being allowed? s/lax/to the point/ Shouldn't it be at least specified auto item? Why on earth would that be the

Re: Just where has this language gone wrong?

2012-07-19 Thread Ali Çehreli
On 07/19/2012 08:03 AM, Petr Janda wrote: It's just syntax. Eliminating syntax noise is fine. Code should look like what it does. Not if eliminating noise equals to making things harder to understand. When you say (int x) { return x; } it's clear about what it is, a _function_ without

Re: Just where has this language gone wrong?

2012-07-19 Thread Nick Sabalausky
On Thu, 19 Jul 2012 14:44:20 + (UTC) trav...@phare.normalesup.org (Christophe Travert) wrote: Petr Janda , dans le message (digitalmars.D:172727), a écrit : On Thursday, 19 July 2012 at 14:31:53 UTC, trav...@phare.normalesup.org (Christophe Travert) wrote: q66 , dans le message

Re: Just where has this language gone wrong?

2012-07-19 Thread Jacob Carlborg
On 2012-07-19 16:39, Petr Janda wrote: It's another thing I hate about Ruby is that a parenthesis enforcement is weak. I love that :) -- /Jacob Carlborg

Re: Just where has this language gone wrong?

2012-07-19 Thread Paulo Pinto
Am 19.07.2012 22:43, schrieb Jacob Carlborg: On 2012-07-19 16:50, Alex Rønne Petersen wrote: I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features

Re: Just where has this language gone wrong?

2012-07-19 Thread Jacob Carlborg
On 2012-07-19 16:50, Alex Rønne Petersen wrote: I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even C++11's take on lambdas is an abomination)

Re: Just where has this language gone wrong?

2012-07-19 Thread Jacob Carlborg
On 2012-07-19 17:03, Petr Janda wrote: It's just syntax. Eliminating syntax noise is fine. Code should look like what it does. Not if eliminating noise equals to making things harder to understand. When you say (int x) { return x; } it's clear about what it is, a _function_ without name.

Re: Just where has this language gone wrong?

2012-07-19 Thread Bernard Helyer
What the _fuck_ guys? How did you get this many posts on what is essentially this looks weird and I can't be fucked reading the documentation?.

Re: Just where has this language gone wrong?

2012-07-19 Thread Nick Sabalausky
On Thu, 19 Jul 2012 22:45:10 +0200 Paulo Pinto pj...@progtools.org wrote: Am 19.07.2012 22:43, schrieb Jacob Carlborg: On 2012-07-19 16:50, Alex Rønne Petersen wrote: I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you

Re: Just where has this language gone wrong?

2012-07-19 Thread David Piepgrass
I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even C++11's take on lambdas is an abomination) and encourages defensive programming to the

Re: Just where has this language gone wrong?

2012-07-19 Thread Nick Sabalausky
On Fri, 20 Jul 2012 00:32:03 +0200 David Piepgrass qwertie...@gmail.com wrote: I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even

Re: Just where has this language gone wrong?

2012-07-19 Thread Faux Amis
On 20/07/2012 00:49, Nick Sabalausky wrote: On Fri, 20 Jul 2012 00:32:03 +0200 David Piepgrass qwertie...@gmail.com wrote: I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no

Re: Just where has this language gone wrong?

2012-07-19 Thread Damian
On Thursday, 19 July 2012 at 22:32:04 UTC, David Piepgrass wrote: I suspect that you have a C++ background. If this is not accurate, ignore the rest. But if it is accurate, my plea to you is: Learn other languages. C++ has next to no innovative language features (even C++11's take on lambdas

Re: Just where has this language gone wrong?

2012-07-19 Thread Chad J
On 07/19/2012 10:21 AM, Petr Janda wrote: ... I think the other points have been adequately covered. ... auto r = [5, 3, 5, 6, 8].sort.uniq.map!(x = x.to!string); ... I'm sorry I don't mean to be a criticizer, but it seems to me that D is trying to be a dynamic-like compiled language way too