Re: Short article on std.parallism

2011-05-31 Thread Jonathan M Davis
On 2011-05-30 22:52, Andrej Mitrovic wrote: On 5/30/11, Vladimir Panteleev vladi...@thecybershadow.net wrote: On Mon, 30 May 2011 04:18:14 +0300, Jeremy Wright jer...@codestrokes.com wrote: I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism. I

Re: Short article on std.parallism

2011-05-31 Thread Andrej Mitrovic
Why doesn't Appender overload opCatAssign? It would be almost trivial to replace usage of existing arrays with Appender, instead of having to replace all calls with var.put(). And why doesn't it overload toString? You can't print its contents to stdout like you can with slices. And why can't you

Re: Short article on std.parallism

2011-05-31 Thread Jonathan M Davis
On 2011-05-30 23:21, Andrej Mitrovic wrote: Why doesn't Appender overload opCatAssign? It would be almost trivial to replace usage of existing arrays with Appender, instead of having to replace all calls with var.put(). And why doesn't it overload toString? You can't print its contents to

Re: Win an iPad2 contest deadline on June 1!

2011-05-31 Thread Walter Bright
Remember: 9. Final submissions are to be posted to the digitalmars.D newsgroup with [Submission] in the Subject line On 5/30/2011 12:05 PM, Walter Bright wrote: Just a reminder! Article submission deadline: before June 1, 2011, GMT Voting deadline: before June 8, 2011, GMT D Article

Re: DVM - D Version Manager 0.2.0

2011-05-31 Thread Lars T. Kyllingstad
On Tue, 17 May 2011 23:15:42 +0200, Jacob Carlborg wrote: I just released a new version of DVM, 0.2.0. For installation instructions see: https://bitbucket.org/doob/dvm Changelog: Version 0.2.0 New/Change Features * 64bit version now available on Linux * It's now possible to update

Re: DVM - D Version Manager 0.2.0

2011-05-31 Thread Jacob Carlborg
On 2011-05-31 12:25, Lars T. Kyllingstad wrote: On Tue, 17 May 2011 23:15:42 +0200, Jacob Carlborg wrote: I just released a new version of DVM, 0.2.0. For installation instructions see: https://bitbucket.org/doob/dvm Changelog: Version 0.2.0 New/Change Features * 64bit version now

Re: Short article on std.parallism

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 02:21:13 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Why doesn't Appender overload opCatAssign? It would be almost trivial to replace usage of existing arrays with Appender, instead of having to replace all calls with var.put(). It should, there might

Re: Win an iPad2 contest deadline on June 1!

2011-05-31 Thread Jesse Phillips
Walter Bright Wrote: Just a reminder! Article submission deadline: before June 1, 2011, GMT Voting deadline: before June 8, 2011, GMT I would like to nominate this blog: http://www.gamedev.net/blog/1140-d-bits/ I know it is an article contest and these were not written for said contest,

Re: D Article Contest - win an iPad2

2011-05-31 Thread Luis Carlos Moreira da Costa
Very Interesting!

Nested Inferred Templates Don't Work?

2011-05-31 Thread Mehrdad
Hi! Say I've got a piece of code like this, which gives me the longest line in a file: pipe!(readText, splitlines, map!((a) { return a.length; }), reduce!max)(Demo.txt); The problem is, it doesn't work. Which is kind of a bummer. :( Is there an **elegant** way to get around it? Of

Re: Which link to use?

2011-05-31 Thread Jonathan M Davis
On 2011-05-30 22:51, Ali Çehreli wrote: On 05/30/2011 09:37 PM, albeitnicht wrote: Michel Fortin wrote [in subject]: which link to use? Answer: comp.lang.C++ Oooh... You can't handle comp.lang.c++.moderated? Poor kitty... (Deal with it. It is the truth) Deal with it.

Re: Character set conversions

2011-05-31 Thread Jacob Carlborg
On 2011-05-30 19:57, Jérôme M. Berger wrote: Adam D. Ruppe wrote: Kagamin wrote: May be, it's his cgi lib? :) Client is free to send requests in any encoding, I suppose. In practice, that hasn't been a problem because browser tend to send requests in the same encoding as the html you served.

Re: Character set conversions

2011-05-31 Thread Kagamin
Adam D. Ruppe Wrote: The first problem I had was users can upload csv files, which they generally make in Excel... which apparently outputs Windows-1252. I suppose it's system ANSI encoding, which is locale-dependent, you can see the list of ANSI encodings for different locales somewhere in

Re: Character set conversions

2011-05-31 Thread Kagamin
Adam D. Ruppe Wrote: The first problem I had was users can upload csv files, which they generally make in Excel... which apparently outputs Windows-1252. Fine for 99% of text, but then someone puts in a curly quote or an em dash and it throws an invalid utf 8 sequence. The client usually

Re: Article Review: Migrating from std.date to std.datetime [final version]

2011-05-31 Thread Jonathan M Davis
I created a pull request for the most recent version: https://github.com/D- Programming-Language/d-programming-language.org/pull/10 So, hopefully it ends up on d-programming-language.org before too long. And if you don't want to build d-programming-language.org yourself, you can grab it from

[Submission] Article: Introduction to std.datetime

2011-05-31 Thread Jonathan M Davis
Okay. According to a recent post on the Announce group, Walter wants all articles for the contest to be posted to the D newsgroup with [Submission] in the subject line, so I'm reposting the latest version of my std.datetime article with [Submission] in the subject line. The article can be

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread Lars T. Kyllingstad
On Tue, 31 May 2011 02:36:58 -0400, Nick Sabalausky wrote: Getting in just under the wire here. I seem to have misjudged the scope of my topic, it ended up a bit large... Anyway, here's my entry: http://www.semitwist.com/articles/EfficientAndFlexible/SinglePage/ Nice article. :) Some of

[Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread Nick Sabalausky
Jonathan M Davis jmdavisp...@gmx.com wrote in message news:mailman.494.1306830186.14074.digitalmar...@puremagic.com... Okay. According to a recent post on the Announce group, Walter wants all articles for the contest to be posted to the D newsgroup with [Submission] in the subject line, so

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread Nick Sabalausky
Lars T. Kyllingstad public@kyllingen.NOSPAMnet wrote in message news:is2aah$29pf$1...@digitalmars.com... On Tue, 31 May 2011 02:36:58 -0400, Nick Sabalausky wrote: Getting in just under the wire here. I seem to have misjudged the scope of my topic, it ended up a bit large... Anyway, here's my

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread bearophile
Nick Sabalausky: http://www.semitwist.com/articles/EfficientAndFlexible/SinglePage/ Regarding your addGizmos() in ex6_meta_flex3_runtimeToCompileTime1.d: void addGizmos(int numPorts, bool isSpinnable, int numGizmos) { // Dispatch to correct version of addGizmosTo. // Effectively

Re: Character set conversions

2011-05-31 Thread Kagamin
Daniel Gibson Wrote: according to N1425 7.11.1.1 4. At program startup, the equivalent of setlocale(LC_ALL, C); is executed. Fun fact is MS conforms with this specification. So they break it deliberately in Excel? Smart. Excel deliberately localizes data presented to the user.

Re: Character set conversions

2011-05-31 Thread Daniel Gibson
Am 31.05.2011 13:12, schrieb Kagamin: Daniel Gibson Wrote: according to N1425 7.11.1.1 4. At program startup, the equivalent of setlocale(LC_ALL, C); is executed. Fun fact is MS conforms with this specification. So they break it deliberately in Excel? Smart. Excel deliberately

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread Timon Gehr
bearophile wrote: ... A shorter way to write it: void addGizmos(int numPorts, bool isSpinnable, int numGizmos) { foreach (np; TypeTuple!(1, 2, 3, 5, 10)) if (numPorts == np) { foreach (b; TypeTuple!(true, false)) if (isSpinnable == b)

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread Ary Manzana
On 5/31/11 6:05 PM, bearophile wrote: Nick Sabalausky: http://www.semitwist.com/articles/EfficientAndFlexible/SinglePage/ Regarding your addGizmos() in ex6_meta_flex3_runtimeToCompileTime1.d: void addGizmos(int numPorts, bool isSpinnable, int numGizmos) { // Dispatch to correct

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread Timon Gehr
Ary Manzana wrote: Why you need a type tuple? Can't you do: foreach(np; [1, 2, 3, 5, 10]) That is a runtime foreach, so no. If the argument is a TypeTuple, the compiler evaluates the foreach as a static foreach, effectively duplicating all code in its body and filling in the constants/types in

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread bearophile
Timon Gehr: Nice, but isSpinnable is always checked twice with your approach. Right. But isn't the compiler able to optimize away this inefficiency? I would like an explicit static foreach better though. See: http://d.puremagic.com/issues/show_bug.cgi?id=4085 Bye, bearophile

[Submission] D Slices

2011-05-31 Thread Steven Schveighoffer
This is my final submission for the D article contest. This takes into account all the fixes and suggestions from the first draft review. http://www.dsource.org/projects/dcollections/wiki/ArrayArticle -Steve

Re: Character set conversions

2011-05-31 Thread Kagamin
Daniel Gibson Wrote: I'm not talking about representing the values on the screen - I'm talking about the format of CSV files. And I find translated function names pretty strange.. I'm wondering how well that works when opening a file with another locale etc. Isn't it natural to get string

Re: Example within documentations of D seriously need some improvement.

2011-05-31 Thread Steven Schveighoffer
On Sat, 28 May 2011 09:16:37 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Proper comment and proper output. writeln(1+2); // should print 3, numbers are added. There's nothing proper about that. I've already fixed a bunch of examples in the documentation because they had

Re: Character set conversions

2011-05-31 Thread Daniel Gibson
Am 31.05.2011 14:54, schrieb Kagamin: Daniel Gibson Wrote: I'm not talking about representing the values on the screen - I'm talking about the format of CSV files. And I find translated function names pretty strange.. I'm wondering how well that works when opening a file with another locale

Re: Character set conversions

2011-05-31 Thread Kagamin
Daniel Gibson Wrote: And I find translated function names pretty strange.. I'm wondering how well that works when opening a file with another locale etc. I've checked excel 2007, seems like it stores (in xlsx) numbers and function names in locale independent form. Don't know, how it works in

Re: Character set conversions

2011-05-31 Thread Daniel Gibson
Am 31.05.2011 15:02, schrieb Kagamin: Daniel Gibson Wrote: And I find translated function names pretty strange.. I'm wondering how well that works when opening a file with another locale etc. I've checked excel 2007, seems like it stores (in xlsx) numbers and function names in locale

Re: [Submission] D Slices

2011-05-31 Thread eles
int[] b = a[0..2]; // This is a 'slicing' operation. b now refers to the first two elements of a is not the first *three* elements of a?

Re: [Submission] D Slices

2011-05-31 Thread Daniel Gibson
Am 31.05.2011 15:13, schrieb eles: int[] b = a[0..2]; // This is a 'slicing' operation. b now refers to the first two elements of a is not the first *three* elements of a? No, it contains a[0] and a[1]. The right boundary of a slice is exclusive. This makes sense, so you can do stuff like

Re: [Submission] D Slices

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 08:34:12 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: This is my final submission for the D article contest. This takes into account all the fixes and suggestions from the first draft review. http://www.dsource.org/projects/dcollections/wiki/ArrayArticle

Re: [Submission] D Slices

2011-05-31 Thread eles
The right boundary of a slice is exclusive. I think it should be stated more obvious in the paper. This makes sense, so you can do stuff like a[1..$] (== a[1..a.length]) to get a slice that contains all elements of a except for the first one (a[0]). I disagree, but I have not much influence

Re: [Submission] D Slices

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 09:23:24 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 31 May 2011 08:34:12 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: This is my final submission for the D article contest. This takes into account all the fixes and suggestions from the

Re: [Article Submission] Have Your Efficiency, and Flexibility Too

2011-05-31 Thread Timon Gehr
Timon Gehr: Nice, but isSpinnable is always checked twice with your approach. Right. But isn't the compiler able to optimize away this inefficiency? Nope. You don't get a guarantee from the language that your code will be optimized in a certain way. That said, dmd/gdc are _not_ able to do

Re: [Submission] D Slices

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 8:29 AM, eles wrote: The right boundary of a slice is exclusive. I think it should be stated more obvious in the paper. This makes sense, so you can do stuff like a[1..$] (== a[1..a.length]) to get a slice that contains all elements of a except for the first one (a[0]). I

Re: Nested Inferred Templates Don't Work?

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 1:04 AM, Mehrdad wrote: Hi! Say I've got a piece of code like this, which gives me the longest line in a file: pipe!(readText, splitlines, map!((a) { return a.length; }), reduce!max)(Demo.txt); The problem is, it doesn't work. Which is kind of a bummer. :( Is there an **elegant**

Re: [Submission] D Slices

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 09:29:48 -0400, eles e...@eles.com wrote: The right boundary of a slice is exclusive. I think it should be stated more obvious in the paper. It's now clarified in the comment. Thanks for the feedback. -Steve

Re: [Submission] D Slices

2011-05-31 Thread Timon Gehr
eles wrote: The right boundary of a slice is exclusive. I think it should be stated more obvious in the paper. This makes sense, so you can do stuff like a[1..$] (== a[1..a.length]) to get a slice that contains all elements of a except for the first one (a[0]). I disagree, but I have not

Re: std.log available for viewing

2011-05-31 Thread Steven Schveighoffer
On Sun, 29 May 2011 16:57:52 -0400, Brad Roberts bra...@puremagic.com wrote: On 5/29/2011 8:44 AM, Andrei Alexandrescu wrote: 1. The fatal log should never be stripped. This is because execution of code after using fatal depends on compile-time flags, which is unacceptable. Logging to fatal

Re: [Submission] D Slices

2011-05-31 Thread eles
Without being rude, but I find that you are too much a zealot and too little of a listener. You are firing bullets in many, but wrong directions, trying to scary and to impress. Yes, I have no much experience with D, although I have some with C. The syntax is not for D, but for general

Re: Nested Inferred Templates Don't Work?

2011-05-31 Thread Mehrdad
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 5/31/11 1:04 AM, Mehrdad wrote: Hi! Say I've got a piece of code like this, which gives me the longest line in a file: pipe!(readText, splitlines, map!((a) { return a.length; }), reduce!max)(Demo.txt);

Re: Example within documentations of D seriously need some improvement.

2011-05-31 Thread Andrej Mitrovic
If you have a 100 line example There's a few (I think?) of those in the docs. There was one such example for associative arrays which I've refactored a bit. And it does use writeln, as it should. The nice thing about that example is that it's at the end of the page, showcasing how hashes can be

Re: [Submission] D Slices

2011-05-31 Thread eles
if (i1 i2) swap(i1, i2); That will affect further values from that point onward, which could not be necessarily intended. Also, is a bit of overhead for solving such a little issue. OK, it is simple to swap but... why to be force to do it? The war between open-right and closed-right limit has

Re: [Submission] D Slices

2011-05-31 Thread Timon Gehr
eles wrote: Without being rude, but I find that you are too much a zealot and too little of a listener. You are firing bullets in many, but wrong directions, trying to scary and to impress. Oh, sorry. I did not want to be rude. Communicating over newsgroups tends to be working poorly in that

Re: [Submission] D Slices

2011-05-31 Thread Andrej Mitrovic
This is how I got to terms with it long ago: http://i.imgur.com/lSkvs.png When it's a slice, it's basically two anchors or gaps at some location, and whatever items are between the anchors is your result. Otherwise with indexing it's the number that starts at that offset (in this case it would be

Re: [Submission] D Slices

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 11:10:59 -0400, eles e...@eles.com wrote: if (i1 i2) swap(i1, i2); That will affect further values from that point onward, which could not be necessarily intended. Also, is a bit of overhead for solving such a little issue. OK, it is simple to swap but... why to be force

Re: [Submission] D Slices

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 10:10 AM, eles wrote: I agree that the issue is not simple (else, there would have been no war). I know no other examples where open-right limits are used. I use (intensively) just another language capable of slicing, that is Matlab. It uses the closed-left and closed-right limits and

Re: [Submission] D Slices

2011-05-31 Thread Timon Gehr
eles wrote: if (i1 i2) swap(i1, i2); That will affect further values from that point onward, which could not be necessarily intended. Also, is a bit of overhead for solving such a little issue. OK, it is simple to swap but... why to be force to do it? The war between open-right and

Re: [Submission] D Slices

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 10:28 AM, Timon Gehr wrote: eles wrote: Without being rude, but I find that you are too much a zealot and too little of a listener. You are firing bullets in many, but wrong directions, trying to scary and to impress. Oh, sorry. I did not want to be rude. Communicating over

Re: [Submission] D Slices

2011-05-31 Thread Michel Fortin
On 2011-05-31 11:10:59 -0400, eles e...@eles.com said: I agree that the issue is not simple (else, there would have been no war). I know no other examples where open-right limits are used. I use (intensively) just another language capable of slicing, that is Matlab. It uses the closed-left and

Re: [Submission] D Slices

2011-05-31 Thread eles
== Quote from Andrej Mitrovic (andrej.mitrov...@gmail.com)'s article This is how I got to terms with it long ago: http://i.imgur.com/ lSkvs.png When it's a slice, it's basically two anchors or gaps at some location, and whatever items are between the anchors is your result. Otherwise with

Re: [Submission] D Slices

2011-05-31 Thread eles
I don't think you can enter this debate without bringing the other war about zero-based indices vs. one-based indices. Matlab first's index number is number one, and I think this fits very naturally with the closed-right limit. In many fields, one-based indices are common because they are

Re: [Submission] D Slices

2011-05-31 Thread KennyTM~
On Jun 1, 11 00:02, eles wrote: == Quote from Andrej Mitrovic (andrej.mitrov...@gmail.com)'s article This is how I got to terms with it long ago: http://i.imgur.com/ lSkvs.png When it's a slice, it's basically two anchors or gaps at some location, and whatever items are between the anchors is

Re: [Submission] D Slices

2011-05-31 Thread eles
I agree that 1-based indexing works pretty well with closed-right intervals; forgot to mention that in my first response. Even with such an approach, certain things are less obvious, e.g. the number of elements in an interval a..b is b-a+1, not b-a. Yes, but in C too, when going from a[0] to

Re: [Submission] D Slices

2011-05-31 Thread eles
Is Python successful? a = [0,1,2,3,4,5,6] a[3:5] [3, 4] Well, I am not a Python user, I give you credit for that. Actually, I don't really appreciate Python for its indentation choice, but that's a matter of taste. In C++'s iterator concept, x.end() points to one position after the last

Re: std.log available for viewing

2011-05-31 Thread Jose Armando Garcia
On Tue, May 31, 2011 at 11:28 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 29 May 2011 16:57:52 -0400, Brad Roberts bra...@puremagic.com wrote: On 5/29/2011 8:44 AM, Andrei Alexandrescu wrote: 1. The fatal log should never be stripped. This is because execution of code after

Re: [Submission] D Slices

2011-05-31 Thread Andrej Mitrovic
On 5/31/11, eles e...@eles.com wrote: Nice picture, but then why foo[1] is rather 8 than 4? And what is foo [9]? foo[9] is out of range. If foo[1] was actually referring to 4, then foo[0] would be out of range too. I've only used this picture because back years ago when I was trying to

[Submission] Concurrency, Parallelism and D

2011-05-31 Thread dsimcha
Final submission for article contest. http://davesdprogramming.wordpress.com/2011/04/07/7/

Re: [Submission] D Slices

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 11:10 AM, eles wrote: I hope some day someone would not have to write a paper like http:// drdobbs.com/blogs/cpp/228701625 but targetting... D's biggest mistake was to use open-limit on the right. I sure wish that were the biggest mistake! :o) Andrei

Re: [Submission] D Slices

2011-05-31 Thread David Nadlinger
On 5/31/11 6:10 PM, eles wrote: Actually, I think 0-based vs. 1-based is of little importance in the fact if limits should be closed or open. Why do you think the contrary? Why it is natural to use open-limit for 0-based? I think it is quite subjective. Why to the right and not to the left?

Re: [Submission] D Slices

2011-05-31 Thread Mafi
Am 31.05.2011 18:16, schrieb eles: Now, why: for(iterator from a[0] to a[N-1]){ //etc. } //let use the above notation for for(i=0; i=N-1; i++) is acceptable, but sudden is no more acceptable to write a[for(iterator from 0 to N-1)] and one must use a[for(iterator from 0 to N]] in order to

Re: [Submission] D Slices

2011-05-31 Thread Mafi
Am 31.05.2011 18:10, schrieb eles: I don't think you can enter this debate without bringing the other war about zero-based indices vs. one-based indices. Matlab first's index number is number one, and I think this fits very naturally with the closed-right limit. In many fields, one-based

Re: [Submission] D Slices

2011-05-31 Thread Timon Gehr
eles wrote: Is Python successful? a = [0,1,2,3,4,5,6] a[3:5] [3, 4] Well, I am not a Python user, I give you credit for that. Actually, I don't really appreciate Python for its indentation choice, but that's a matter of taste. In C++'s iterator concept, x.end() points to one position

Re: std.log available for viewing

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 12:28:12 -0400, Jose Armando Garcia jsan...@gmail.com wrote: On Tue, May 31, 2011 at 11:28 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 29 May 2011 16:57:52 -0400, Brad Roberts bra...@puremagic.com wrote: On 5/29/2011 8:44 AM, Andrei Alexandrescu wrote:

Re: [Submission] D Slices

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 11:16 AM, eles wrote: I agree that 1-based indexing works pretty well with closed-right intervals; forgot to mention that in my first response. Even with such an approach, certain things are less obvious, e.g. the number of elements in an interval a..b is b-a+1, not b-a. Yes, but

Re: [Submission] D Slices

2011-05-31 Thread eles
== Quote from Andrej Mitrovic (andrej.mitrov...@gmail.com)'s article On 5/31/11, eles e...@eles.com wrote: Nice picture, but then why foo[1] is rather 8 than 4? And what is foo [9]? foo[9] is out of range. If foo[1] was actually referring to 4, then foo[0] would be out of range too. I've

Re: [Submission] D Slices

2011-05-31 Thread eles
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 5/31/11 11:10 AM, eles wrote: I hope some day someone would not have to write a paper like http:// drdobbs.com/blogs/cpp/228701625 but targetting... D's biggest mistake was to use open-limit on the right. I sure

Re: std.log available for viewing

2011-05-31 Thread Jose Armando Garcia
On Tue, May 31, 2011 at 2:34 PM, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 31 May 2011 12:28:12 -0400, Jose Armando Garcia jsan...@gmail.com wrote: On Tue, May 31, 2011 at 11:28 AM, Steven Schveighoffer schvei...@yahoo.com wrote: On Sun, 29 May 2011 16:57:52 -0400, Brad

Re: [Submission] D Slices

2011-05-31 Thread eles
== Quote from David Nadlinger (s...@klickverbot.at)'s article On 5/31/11 6:10 PM, eles wrote: Actually, I think 0-based vs. 1-based is of little importance in the fact if limits should be closed or open. Why do you think the contrary? Why it is natural to use open-limit for 0-based? I

Re: std.log available for viewing

2011-05-31 Thread Jose Armando Garcia
On Tue, May 31, 2011 at 3:10 PM, Jose Armando Garcia jsan...@gmail.com wrote: On Tue, May 31, 2011 at 2:34 PM, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 31 May 2011 12:28:12 -0400, Jose Armando Garcia jsan...@gmail.com wrote: On Tue, May 31, 2011 at 11:28 AM, Steven

Re: [Submission] D Slices

2011-05-31 Thread eles
== Quote from Mafi (m...@example.org)'s article Am 31.05.2011 18:16, schrieb eles: Now, why: for(iterator from a[0] to a[N-1]){ //etc. } //let use the above notation for for(i=0; i=N-1; i++) is acceptable, but sudden is no more acceptable to write a[for(iterator from 0 to N-1)]

Re: [Submission] D Slices

2011-05-31 Thread KennyTM~
On Jun 1, 11 02:12, eles wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 5/31/11 11:10 AM, eles wrote: I hope some day someone would not have to write a paper like http:// drdobbs.com/blogs/cpp/228701625 but targetting... D's biggest mistake was to use

Re: [Submission] D Slices

2011-05-31 Thread eles
In my opinion it is natuaral to use half open intervals for zero- based indices. My reasoning: //zero-based int[8] zero; //indices from 0 upto and excluding 8 - [0,8) //one-based int[8] one; //in many languages the indices from 1 upto and including 8 - [1,8] Then, using the same type of

Re: [Submission] D Slices

2011-05-31 Thread Michel Fortin
On 2011-05-31 12:10:24 -0400, eles e...@eles.com said: I don't think you can enter this debate without bringing the other war about zero-based indices vs. one-based indices. Matlab first's index number is number one, and I think this fits very naturally with the closed-right limit. In many

Re: [Submission] D Slices

2011-05-31 Thread Timon Gehr
eles wrote: == Quote from Andrej Mitrovic (andrej.mitrov...@gmail.com)'s article On 5/31/11, eles e...@eles.com wrote: Nice picture, but then why foo[1] is rather 8 than 4? And what is foo [9]? foo[9] is out of range. If foo[1] was actually referring to 4, then foo[0] would be out

Re: [Submission] D Slices

2011-05-31 Thread KennyTM~
On Jun 1, 11 02:16, eles wrote: == Quote from David Nadlinger (s...@klickverbot.at)'s article On 5/31/11 6:10 PM, eles wrote: Actually, I think 0-based vs. 1-based is of little importance in the fact if limits should be closed or open. Why do you think the contrary? Why it is natural to use

Re: [Submission] D Slices

2011-05-31 Thread Andrej Mitrovic
Quite frankly I don't give a damn about for loops because I hardly use them. Whenever I can, I use foreach, and if I get stuck and think that foreach can't be used I rather think twice and consider to do a small redesign of my code rather than start using ancient for loops. I don't want to deal

Re: [Submission] D Slices

2011-05-31 Thread Timon Gehr
eles wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 5/31/11 11:10 AM, eles wrote: I hope some day someone would not have to write a paper like http:// drdobbs.com/blogs/cpp/228701625 but targetting... D's biggest mistake was to use open-limit

Re: std.log available for viewing

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 14:10:20 -0400, Jose Armando Garcia jsan...@gmail.com wrote: On Tue, May 31, 2011 at 2:34 PM, Steven Schveighoffer schvei...@yahoo.com wrote: Again, this sounds way too complicated for what it's giving you (avoiding having to forcibly kill your application if that's

Re: [Submission] D Slices

2011-05-31 Thread KennyTM~
On Jun 1, 11 02:24, eles wrote: In my opinion it is natuaral to use half open intervals for zero- based indices. My reasoning: //zero-based int[8] zero; //indices from 0 upto and excluding 8 - [0,8) //one-based int[8] one; //in many languages the indices from 1 upto and including 8 - [1,8]

Re: std.log available for viewing

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 1:32 PM, Steven Schveighoffer wrote: On Tue, 31 May 2011 14:10:20 -0400, Jose Armando Garcia jsan...@gmail.com wrote: On Tue, May 31, 2011 at 2:34 PM, Steven Schveighoffer schvei...@yahoo.com wrote: Again, this sounds way too complicated for what it's giving you (avoiding having

Re: [Submission] D Slices

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 14:20:20 -0400, eles e...@eles.com wrote: == Quote from Mafi (m...@example.org)'s article Am 31.05.2011 18:16, schrieb eles: Now, why: for(iterator from a[0] to a[N-1]){ //etc. } //let use the above notation for for(i=0; i=N-1; i++) is acceptable, but sudden is no

Re: [Submission] D Slices

2011-05-31 Thread Andrei Alexandrescu
On 5/31/11 1:36 PM, Timon Gehr wrote: eles wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 5/31/11 11:10 AM, eles wrote: I hope some day someone would not have to write a paper like http:// drdobbs.com/blogs/cpp/228701625 but targetting... D's biggest

Re: [Submission] D Slices

2011-05-31 Thread Simen Kjaeraas
On Tue, 31 May 2011 20:29:51 +0200, KennyTM~ kenn...@gmail.com wrote: If your program needs an array of 4 billion elements (2e+19 elements on 64-bit system), you're programming it wrong. Not true. (for 32 bits) True for simple arrays, yes. Not for other ranges that may e.g. lazily read

Re: std.log available for viewing

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 14:48:57 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 5/31/11 1:32 PM, Steven Schveighoffer wrote: On Tue, 31 May 2011 14:10:20 -0400, Jose Armando Garcia jsan...@gmail.com wrote: On Tue, May 31, 2011 at 2:34 PM, Steven Schveighoffer

Re: std.log available for viewing

2011-05-31 Thread Steven Schveighoffer
On Tue, 31 May 2011 15:09:07 -0400, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 31 May 2011 14:48:57 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I'm operating under the assumption that logCritical and logFatal are at a different log level (i.e. the primary

Re: [Submission] D Slices

2011-05-31 Thread eles
Actually, I think 0-based vs. 1-based is of little importance in the fact if limits should be closed or open. Why do you think the contrary? Good question. Actually, I'm not too sure if 1-based is better suited with closed. But I can say that it makes a lot of sense for 0-based arrays to

Re: [Submission] D Slices

2011-05-31 Thread eles
This has been discussed a lot of times before. See http://digitalmars.com/d/archives/digitalmars/D/ About_switch_case_statements..._101110.html#N101112. Thank you. I know. I follow this newsgroup since the days when EvilOne Minayev was still posting here and also witnessed D 1.0 and old D group

Re: [Submission] D Slices

2011-05-31 Thread eles
If your program needs an array of 4 billion elements (2e+19 elements on 64-bit system), you're programming it wrong. This is an problem that won't arise practically. You are limiting yourself to Desktop PC. It is not always the case. There are also other platforms (embedded D, let's say),

Re: [Submission] D Slices

2011-05-31 Thread eles
== Quote from Andrej Mitrovic (andrej.mitrov...@gmail.com)'s article Quite frankly I don't give a damn about for loops because I hardly use them. Whenever I can, I use foreach, and if I get stuck and think that foreach can't be used I rather think twice and consider to do a small redesign of

Re: [Submission] D Slices

2011-05-31 Thread Ali Çehreli
On 05/31/2011 08:10 AM, eles wrote: I know no other examples where open-right limits are used. The C++ standard library uses open-right with its pairs of iterators. The second iterator points at one beyond the last element of the range. Ali

Re: [Submission] D Slices

2011-05-31 Thread eles
Array indices do not form a field in D. What's the point bringing it in? Yes, they are (it is true no matter that we speak of D or not). Or, more exactly, they should be a field. They are numbers, after all. Secondly, why they should not be a field? Yes, the current approach introduces a n+1th

Re: [Submission] D Slices

2011-05-31 Thread eles
The evidence collected makes it clear to any reasonable observer that enforcing flow of control statements after code in case labels would mark a net improvement for D. How big? Probably not bigger than operating other improvements. But definitely not negligible. Andrei Then, why not to

Re: [Submission] D Slices

2011-05-31 Thread David Nadlinger
On 5/31/11 8:16 PM, eles wrote: == Quote from David Nadlinger (s...@klickverbot.at)'s article On 5/31/11 6:10 PM, eles wrote: Actually, I think 0-based vs. 1-based is of little importance in the fact if limits should be closed or open. Why do you think the contrary? Why it is natural to use

Re: [Submission] D Slices

2011-05-31 Thread Nick Sabalausky
eles e...@eles.com wrote in message news:is2qgc$2o7h$1...@digitalmars.com... The right boundary of a slice is exclusive. I think it should be stated more obvious in the paper. This makes sense, so you can do stuff like a[1..$] (== a[1..a.length]) to get a slice that contains all elements

Re: [Submission] D Slices

2011-05-31 Thread Jesse Phillips
eles Wrote: But what are the advantages of using open range over closed range? I fail to see any advantages. Yes, I see those other people (and quite many), but I fail to see any advantage except the louder talk. Quite simply, there aren't any. But frankly your claims for having a closed

  1   2   >