Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu

Pelle Månsson wrote:

Andrei Alexandrescu wrote:
It's a rough rough draft, but one for the full chapter on arrays, 
associative arrays, and strings.


http://erdani.com/d/thermopylae.pdf

Any feedback is welcome. Thanks!


Andrei


Your Hallå Värd! should be Hallå Värld!, to be Swedish. D:


Thanks! Ouch, two mistakes in one word. Also, should I put a comma in 
between the words?


Also, I am wondering, why is the undefined behavior of opCatAssign kept? 
Couldn't every T[] know if it is the owner of the memory in question? 
Sorry if I bring outdated discussions up unnecessarily.


We don't know how to do that cheaply.


Andrei


Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu

Ellery Newcomer wrote:

Andrei Alexandrescu wrote:

It's a rough rough draft, but one for the full chapter on arrays,
associative arrays, and strings.

http://erdani.com/d/thermopylae.pdf

Any feedback is welcome. Thanks!


Andrei


Maybe I haven't been paying attention lately, but shouldn't

assert(x == 0)

be

assert(x[] == 0)

?


Where does the former occur?

Thanks,

Andrei


Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Saaa
Also, no mention about .dup not being a deep dup. 




Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Saaa
crp
 p20. 40 words? 
those  where for myself, to check 




Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Ellery Newcomer
Andrei Alexandrescu wrote:
 Ellery Newcomer wrote:
 Andrei Alexandrescu wrote:
 It's a rough rough draft, but one for the full chapter on arrays,
 associative arrays, and strings.

 http://erdani.com/d/thermopylae.pdf

 Any feedback is welcome. Thanks!


 Andrei

 Maybe I haven't been paying attention lately, but shouldn't

 assert(x == 0)

 be

 assert(x[] == 0)

 ?
 
 Where does the former occur?
 
 Thanks,
 
 Andrei

top of page 102


Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu

Robert Jacques wrote:
On Thu, 29 Oct 2009 00:38:33 -0400, Andrei Alexandrescu 
seewebsiteforem...@erdani.org wrote:


It's a rough rough draft, but one for the full chapter on arrays, 
associative arrays, and strings.


http://erdani.com/d/thermopylae.pdf

Any feedback is welcome. Thanks!


Andrei


Still reading, but here's a quick comment. I found it odd that the 
syntax for element-wise copying (4.1.7) comes sections after the section 
on copying (4.1.4). Perhaps a sentence mentioning where element-wise 
copying can be found would be appropriate. (Props though on including a 
memory layout figure. It may not seem like much, but I've seen Java 
students have no idea what an array is in memory.)


Good point, thanks.

Andrei


Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Tom S

Andrei Alexandrescu wrote:
It's a rough rough draft, but one for the full chapter on arrays, 
associative arrays, and strings.


http://erdani.com/d/thermopylae.pdf

Any feedback is welcome. Thanks!


Thanks for the excerpt! I've only had the time to give it a brief skim 
so far, but it's looking good. This is what I found:


p16: int quadrupeds[100], int legs[4 * quadrupeds.length]  -  is the 
C-style array declaration syntax intended?

p20: No mention of the new T[][](rows, cols) syntax?
p26 (User-Defined Types as Keys): No need for opEquals?


--
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode