reddit.com: first Chapter of TDPL available for free

2009-08-03 Thread Andrei Alexandrescu
http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei

Re: reddit.com: first Chapter of TDPL available for free

2009-08-03 Thread Lionello Lunesu
Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei "...and floating-point constants have type double." I thought they had type 'real'! Seems I've learned something

Re: reddit.com: first Chapter of TDPL available for free

2009-08-03 Thread The Anh Tran
Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei Typo spotted, sir! The paragraph before "1.7 Values vs. References": "In C++ lingo, member functions are virtual

Re: reddit.com: first Chapter of TDPL available for free

2009-08-03 Thread Andrei Alexandrescu
The Anh Tran wrote: Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei Typo spotted, sir! The paragraph before "1.7 Values vs. References": "In C++ lingo, member f

Re: reddit.com: first Chapter of TDPL available for free

2009-08-03 Thread KennyTM~
Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei What's a "so-called IEEE 754 double-extended 79-bit format"? :p

Re: reddit.com: first Chapter of TDPL available for free

2009-08-03 Thread Andrei Alexandrescu
KennyTM~ wrote: Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei What's a "so-called IEEE 754 double-extended 79-bit format"? :p Heck, I didn't know until I goo

Re: reddit.com: first Chapter of TDPL available for free

2009-08-03 Thread Daniel Keep
Andrei Alexandrescu wrote: > http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ > > > (Don't tell anyone, but I plan to rewrite it.) > > Andrei Dump of thoughts as I read it: -- Personally, I've replaced "Hello, World!" in my own code with "Don't

Re: reddit.com: first Chapter of TDPL available for free

2009-08-04 Thread Sam Hu
Sorry for my stepping in,but as a beginner in D ,I think maybe you( all of you experts) have interest to hear what he think after he read the book:This is really really great!Thank you so much for your great job! Here a couple of questions regarding first chapter: 1.foreach (line; stdin.byLine)

Re: reddit.com: first Chapter of TDPL available for free

2009-08-04 Thread Michiel Helvensteijn
"The compiler allows omitting type declarations only when types can be unambiguously inferred from context." That's not exactly true, is it? A small non-negative integer literal could be an integer of any width or signedness. Yet 'int' is arbitrarily chosen for some reason. There are also multiple

Re: reddit.com: first Chapter of TDPL available for free

2009-08-04 Thread Andrei Alexandrescu
Sam Hu wrote: Sorry for my stepping in,but as a beginner in D ,I think maybe you( all of you experts) have interest to hear what he think after he read the book:This is really really great!Thank you so much for your great job! Thanks, Sam. I saved your comments and will modify the book accord

Re: reddit.com: first Chapter of TDPL available for free

2009-08-04 Thread Andrei Alexandrescu
Michiel Helvensteijn wrote: "The compiler allows omitting type declarations only when types can be unambiguously inferred from context." That's not exactly true, is it? A small non-negative integer literal could be an integer of any width or signedness. Yet 'int' is arbitrarily chosen for some r

Re: reddit.com: first Chapter of TDPL available for free

2009-08-04 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > KennyTM~ wrote: > > Andrei Alexandrescu wrote: > >> http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ > >> > >> > >> > >> (Don't tell anyone, but I plan to rewrite it.) > >> > >> Andrei > > > > What's a "so-called IEEE 7

Re: reddit.com: first Chapter of TDPL available for free

2009-08-04 Thread bearophile
Jeremie Pelletier: >And I always thought it was double-extended 80-bit. The IEEE standard actually >specifies >= 79 bits and Intel implements it as 80bits.< But it seems there are weird differences across operating systems regarding how much memory is allocated to represent such numbers, like 10

Re: reddit.com: first Chapter of TDPL available for free

2009-08-05 Thread Andrei Alexandrescu
Daniel Keep wrote: Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei Dump of thoughts as I read it: Awesome! Recorded. Hey I thought you gave up on D ;o). Than

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Jos van Uden
Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei This doesn't compile: string[] words = split(strip(line)); it has to be string[] words = split(strip(line.idup)

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Jos van Uden
Jos van Uden wrote: Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei This doesn't compile: string[] words = split(strip(line)); it has to be string[] words = s

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Andrei Alexandrescu
Jos van Uden wrote: Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei This doesn't compile: string[] words = split(strip(line)); it has to be string[] words = s

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Jarrett Billingsley
On Sun, Aug 9, 2009 at 9:34 AM, Andrei Alexandrescu wrote: > Jos van Uden wrote: >> >> Andrei Alexandrescu wrote: >>> >>> >>> http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ >>> >>> (Don't tell anyone, but I plan to rewrite it.) >>> >>> Andrei >> >> T

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: On Sun, Aug 9, 2009 at 9:34 AM, Andrei Alexandrescu wrote: Jos van Uden wrote: Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei This do

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Michel Fortin
On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu said: It's also arguable that all functions in std.string should take const(char)[]. Or, you know, const(T)[], since D supports encodings other than UTF-8, despite what std.string leads you to believe. Yah, I think they should all be paramete

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Johan Granberg
Michel Fortin wrote: > On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu > said: > >>> It's also arguable that all functions in std.string should take >>> const(char)[]. Or, you know, const(T)[], since D supports encodings >>> other than UTF-8, despite what std.string leads you to believe. >> >

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu said: It's also arguable that all functions in std.string should take const(char)[]. Or, you know, const(T)[], since D supports encodings other than UTF-8, despite what std.string leads you to believe. Yah, I think they

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Andrei Alexandrescu
Johan Granberg wrote: Michel Fortin wrote: On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu said: It's also arguable that all functions in std.string should take const(char)[]. Or, you know, const(T)[], since D supports encodings other than UTF-8, despite what std.string leads you to believ

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Michel Fortin
On 2009-08-09 14:10:10 -0400, Andrei Alexandrescu said: But shouldn't they work with *ranges* in general, a string being only a specific case? That's true as well! In my dreams, me and the famous actress... oh wait, wrong dream. In my dreams, I eliminate std.string and put all of its algor

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2009-08-09 14:10:10 -0400, Andrei Alexandrescu said: But shouldn't they work with *ranges* in general, a string being only a specific case? That's true as well! In my dreams, me and the famous actress... oh wait, wrong dream. In my dreams, I eliminate std.string and

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Daniel Keep
Andrei Alexandrescu wrote: > Michel Fortin wrote: >> On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu >> said: >> It's also arguable that all functions in std.string should take const(char)[]. Or, you know, const(T)[], since D supports encodings other than UTF-8, despite what std

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Jeremie Pelletier
Daniel Keep Wrote: > > > Andrei Alexandrescu wrote: > > Michel Fortin wrote: > >> On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu > >> said: > >> > It's also arguable that all functions in std.string should take > const(char)[]. Or, you know, const(T)[], since D supports encodings >

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Andrei Alexandrescu
Daniel Keep wrote: Andrei Alexandrescu wrote: Michel Fortin wrote: On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu said: It's also arguable that all functions in std.string should take const(char)[]. Or, you know, const(T)[], since D supports encodings other than UTF-8, despite what std.s

Re: reddit.com: first Chapter of TDPL available for free

2009-08-09 Thread Rainer Deyke
Daniel Keep wrote: > How do you define 'tolower' on non-characters? How do you define it for characters? I -> ı or I -> i? 'tolower' is a complicated, locale-dependent operation, not at all analogous to finding a substring. It belongs in a different part of the library or in a different library

Re: reddit.com: first Chapter of TDPL available for free

2009-08-10 Thread Sergey Gromov
Sun, 09 Aug 2009 16:10:38 -0500, Andrei Alexandrescu wrote: > Michel Fortin wrote: >> On 2009-08-09 14:10:10 -0400, Andrei Alexandrescu >> said: >> But shouldn't they work with *ranges* in general, a string being only a specific case? >>> >>> That's true as well! In my dreams, me and

Re: reddit.com: first Chapter of TDPL available for free

2009-08-10 Thread Steven Schveighoffer
On Mon, 03 Aug 2009 18:00:59 -0400, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei Wow, my head's spinning :) That's a lot of data/concepts in one chapter. H

Re: reddit.com: first Chapter of TDPL available for free

2009-08-10 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Mon, 03 Aug 2009 18:00:59 -0400, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't tell anyone, but I plan to rewrite it.) Andrei Wow, my head's spinning :) That's a lot of da

Re: reddit.com: first Chapter of TDPL available for free

2009-08-10 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: > Steven Schveighoffer wrote: > > On Mon, 03 Aug 2009 18:00:59 -0400, Andrei Alexandrescu > > wrote: > > > >> http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ > >> > >> > >> > >> (Don't tell anyone, but I plan to rewrit

Re: reddit.com: first Chapter of TDPL available for free

2009-08-10 Thread Benji Smith
Andrei Alexandrescu wrote: Daniel Keep wrote: Andrei Alexandrescu wrote: Michel Fortin wrote: On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu said: It's also arguable that all functions in std.string should take const(char)[]. Or, you know, const(T)[], since D supports encodings other th

Re: reddit.com: first Chapter of TDPL available for free

2009-08-10 Thread Andrei Alexandrescu
Benji Smith wrote: Andrei Alexandrescu wrote: Daniel Keep wrote: Andrei Alexandrescu wrote: Michel Fortin wrote: On 2009-08-09 11:10:48 -0400, Andrei Alexandrescu said: It's also arguable that all functions in std.string should take const(char)[]. Or, you know, const(T)[], since D support

Re: reddit.com: first Chapter of TDPL available for free

2009-08-11 Thread Daniel Keep
Jeremie Pelletier wrote: > Andrei Alexandrescu Wrote: > >> Steven Schveighoffer wrote: >>> On Mon, 03 Aug 2009 18:00:59 -0400, Andrei Alexandrescu >>> wrote: >>> http://www.reddit.com/r/programming/comments/975ng/diving_into_the_d_programming_language_tdpl/ (Don't te

Re: reddit.com: first Chapter of TDPL available for free

2009-08-11 Thread language_fan
Tue, 11 Aug 2009 19:04:50 +1000, Daniel Keep thusly wrote: > I'm personally of the mindset that beginners should most definitely not > be attempting to learn D as their first language. Languages like D, C, > C++ are horribly unsuitable because they force you to understand how the > machine works

Re: reddit.com: first Chapter of TDPL available for free

2009-08-11 Thread Daniel Keep
language_fan wrote: > Tue, 11 Aug 2009 19:04:50 +1000, Daniel Keep thusly wrote: > >> I'm personally of the mindset that beginners should most definitely not >> be attempting to learn D as their first language. Languages like D, C, >> C++ are horribly unsuitable because they force you to unders

Re: reddit.com: first Chapter of TDPL available for free

2009-08-11 Thread language_fan
Wed, 12 Aug 2009 00:06:03 +1000, Daniel Keep thusly wrote: > It sounds good in theory, but it doesn't seem to hold up in practice. Why? Has there been any non-successful attemps in this direction? Many constructs of D for which semantics can be defined with a collection of simpler constructs co

Re: reddit.com: first Chapter of TDPL available for free

2009-08-11 Thread Andrei Alexandrescu
language_fan wrote: Wed, 12 Aug 2009 00:06:03 +1000, Daniel Keep thusly wrote: It sounds good in theory, but it doesn't seem to hold up in practice. Why? Has there been any non-successful attemps in this direction? Many constructs of D for which semantics can be defined with a collection of

Re: reddit.com: first Chapter of TDPL available for free

2009-08-16 Thread Ali Cehreli
language_fan Wrote: > One way to teach languages with both high and low level concepts is to > start bottom-up. Surely the high level concepts are usually built from > atomic low level artifacts. I agree. I am writing an online D tutorial that targets the novice programmer, where the concepts