Re: noob Q: array out-of-range

2010-05-29 Thread Simen kjaeraas
Steven Schveighoffer wrote: I wonder if someone recalls the feature set of the dmd compiler from July, 2005. That would be http://ftp.digitalmars.com/dmd.128.zip Tested the example given with that compiler, and got ArrayBoundsError. Just as expected. -- Simen

Re: noob Q: array out-of-range

2010-05-28 Thread Steven Schveighoffer
On Fri, 28 May 2010 22:42:32 -0400, Duke Normandin wrote: On Sat, 29 May 2010, Simen kjaeraas wrote: Duke Normandin wrote: > So these two paragraphs in the tutorial are flat out wrong? Absolutely. Then I'm done with _that_ site - can't trust it! Any chance that you could suggest a goo

Re: noob Q: array out-of-range

2010-05-28 Thread BCS
Hello Simen, Duke Normandin wrote: So these two paragraphs in the tutorial are flat out wrong? Absolutely. Any idea who owns it so it can get changed? For that matter, who added the link? Being paranoid for the moment (it can be fun sometimes :) that blurb is so wrong that I wonder i

Re: noob Q: array out-of-range

2010-05-28 Thread Duke Normandin
On Sat, 29 May 2010, Simen kjaeraas wrote: > Duke Normandin wrote: > > > So these two paragraphs in the tutorial are flat out wrong? > > Absolutely. Then I'm done with _that_ site - can't trust it! Any chance that you could suggest a good beginner's D tutorial? -- duke

Re: noob Q: array out-of-range

2010-05-28 Thread Simen kjaeraas
Duke Normandin wrote: So these two paragraphs in the tutorial are flat out wrong? Absolutely. -- Simen

Re: noob Q: array out-of-range

2010-05-28 Thread Duke Normandin
On Fri, 28 May 2010, bearophile wrote: > Duke Normandin: > > > This is the site that I'm using to learn D. If you scroll down 3-4 > > screens full, you'll come to the "array" topic. Is this tutorial > > outdated, wrong, or what, because it doesn't deem to sync with what > > you two fine fellows ar

Re: noob Q: array out-of-range

2010-05-28 Thread bearophile
Duke Normandin: > This is the site that I'm using to learn D. If you scroll down 3-4 > screens full, you'll come to the "array" topic. Is this tutorial > outdated, wrong, or what, because it doesn't deem to sync with what > you two fine fellows are telling me about creating dynamic arrays in > the

Re: noob Q: array out-of-range

2010-05-28 Thread Duke Normandin
On Fri, 28 May 2010, bearophile wrote: > Don: > > The array initially has length of zero. > > You need to write something like: > > intArray = new int[3]; > > or > > intArray.length = 3; > > before putting anything into it. > > In some languages (Perl? Maybe Lua and PHP) arrays auto-create empty s

Re: noob Q: array out-of-range

2010-05-28 Thread bearophile
Don: > The array initially has length of zero. > You need to write something like: > intArray = new int[3]; > or > intArray.length = 3; > before putting anything into it. In some languages (Perl? Maybe Lua and PHP) arrays auto-create empty slots as needed, but in many languages you need to tell t

Re: noob Q: array out-of-range

2010-05-28 Thread Don
Duke Normandin wrote: Hey... Compiler is now working as expected! Thank's to a great catch by Michel Fortin! A little further down the tutorial "D_ A Newbie-Oriented Tutorial", there's this code: [code] import std.stdio; void main() { int[] intArray; intArray[0] = 42; intArray[1]

noob Q: array out-of-range

2010-05-28 Thread Duke Normandin
Hey... Compiler is now working as expected! Thank's to a great catch by Michel Fortin! A little further down the tutorial "D_ A Newbie-Oriented Tutorial", there's this code: [code] import std.stdio; void main() { int[] intArray; intArray[0] = 42; intArray[1] = 54; intArray[2] = 9