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:

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

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

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!

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

Re: LLVM 2.6 Release!

2009-10-29 Thread Nick B
bearophile wrote: Andrei Alexandrescu: [snip] You can see an example of this from the missing videos/PDFs of the last conference, they were not allowed to show them, because Apple is sometimes even more corporative than Microsoft: http://llvm.org/devmtg/2009-10/ Bye, bearophile

Re: ICE: template.c:806: failed assertion `i parameters-dim'

2009-10-29 Thread Don
grauzone wrote: Don wrote: Jacob Carlborg wrote: On 10/28/09 16:32, Don wrote: Jacob Carlborg wrote: I have quite a big project and when I compile it I get this internal compiler error: template.c:806: failed assertion `i parameters-dim'. I don't know what could cause that error so I

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Lars T. Kyllingstad
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 It's a very pleasant read, and it looks good. I guess I'll have to buy the book. :) I

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Lars T. Kyllingstad
Andrei Alexandrescu wrote: dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article 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

Re: What Does Haskell Have to Do with C++?

2009-10-29 Thread Don
Andrei Alexandrescu wrote: Don wrote: Jeremie Pelletier wrote: http://bartoszmilewski.wordpress.com/2009/10/21/what-does-haskell-have-to-do-with-c/ Bartosz's second part of 'Template Metaprogramming Made Easy (Huh?)', its quite a read :) Yes, it is excellent. Two comments: (1) Bartosz's

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Pelle Månsson
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: Also, I am wondering, why

Re: What Does Haskell Have to Do with C++?

2009-10-29 Thread Kagamin
Don Wrote: I don't know what happens with template mixins, though. I hate template mixins (and I'm not convinced they're useful for anything, either). Sometimes in C macros are used like template mixins in D.

Re: Shared Hell

2009-10-29 Thread Kagamin
Walter Bright Wrote: A function that accesses shared data has to put in fences. There's no way to have the same code deal with shared and unshared code. Shared code perfectly deals with unshared data (it's not guaranteed that shared data is accessed by more than one thread). In other words

Re: Shared Hell

2009-10-29 Thread Kagamin
Kagamin Wrote: Walter Bright Wrote: A function that accesses shared data has to put in fences. There's no way to have the same code deal with shared and unshared code. Shared code perfectly deals with unshared data (it's not guaranteed that shared data is accessed by more than one

Re: Shared Hell

2009-10-29 Thread Kagamin
Christopher Wright Wrote: A function that accesses shared data has to put in fences. There's no way to have the same code deal with shared and unshared code. Acquiring a lock on a non-shared instance is safe, just an unnecessary expense. I would have looked into optimizing this expense

Re: What Does Haskell Have to Do with C++?

2009-10-29 Thread Bill Baxter
On Thu, Oct 29, 2009 at 1:47 AM, Don nos...@nospam.com wrote: Andrei Alexandrescu wrote: Don wrote: Jeremie Pelletier wrote: http://bartoszmilewski.wordpress.com/2009/10/21/what-does-haskell-have-to-do-with-c/ Bartosz's second part of 'Template Metaprogramming Made Easy (Huh?)', its

Re: GC Precision

2009-10-29 Thread bearophile
dsimcha: A moving GC, one that doesn't stop the world on collection, and one that's fully precise including stack would be nice, but they're several orders of magnitude less important and would also have more ripple effects. I agree that here doing something simple now is better than doing

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread bearophile
Andrei Alexandrescu: http://erdani.com/d/thermopylae.pdf Any feedback is welcome. Thanks! So far I've just taken a look, I'll read it when I can. I can see several warnings in red. The look of the text is really nice! Elegant, and the images are good and necessary. Are you going to write a

Re: associative arrays: iteration is finally here

2009-10-29 Thread bearophile
Andrei Alexandrescu: I'll make aa.remove(key) always work and return a bool that tells you whether there was a mapping or not. I think that's a small design mistake. In a high level language you want things to not fail silently. You want them to fail in an explicit way because programmers

Re: Shared Hell

2009-10-29 Thread Christopher Wright
Kagamin wrote: Christopher Wright Wrote: A function that accesses shared data has to put in fences. There's no way to have the same code deal with shared and unshared code. Acquiring a lock on a non-shared instance is safe, just an unnecessary expense. I would have looked into optimizing this

Re: What Does Haskell Have to Do with C++?

2009-10-29 Thread Christopher Wright
Don wrote: Andrei Alexandrescu wrote: Don wrote: Jeremie Pelletier wrote: http://bartoszmilewski.wordpress.com/2009/10/21/what-does-haskell-have-to-do-with-c/ Bartosz's second part of 'Template Metaprogramming Made Easy (Huh?)', its quite a read :) Yes, it is excellent. Two comments:

Re: GC Precision

2009-10-29 Thread Jacob Carlborg
On 10/29/09 11:47, bearophile wrote: dsimcha: A moving GC, one that doesn't stop the world on collection, and one that's fully precise including stack would be nice, but they're several orders of magnitude less important and would also have more ripple effects. I agree that here doing

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Jason House
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! I still think is expressions are a glaring problem. Somewhere in the text, you use

Re: GC Precision

2009-10-29 Thread bearophile
Jacob Carlborg: The current implementation of toHash in Object does that: return cast(hash_t)cast(void*)this; I agree, such things will have to change when D wants a moving GC. Bye, bearophile

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Lars T. Kyllingstad
Jason House 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! I still think is expressions are a glaring problem. Somewhere in the text,

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Denis Koroskin
On Thu, 29 Oct 2009 15:12:51 +0300, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: Jason House 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

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Lars T. Kyllingstad
Denis Koroskin wrote: On Thu, 29 Oct 2009 15:12:51 +0300, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: Jason House wrote: Andrei Alexandrescu Wrote: It's a rough rough draft, but one for the full chapter on arrays, associative arrays, and strings.

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Jason House
Denis Koroskin Wrote: On Thu, 29 Oct 2009 15:12:51 +0300, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: I don't think he uses is(typeof(...)) in the text. The code snippets in question are marked Note: normally the code below would not be included..., and I suppose he's

Re: GC Sentinel

2009-10-29 Thread Steven Schveighoffer
On Tue, 27 Oct 2009 19:41:24 -0400, dsimcha dsim...@yahoo.com wrote: I'm looking at the GC implementation and starting my hacking. I noticed that the ends of blocks are already being used in some creative ways in the sentinel version. This looks like a debugging feature, though I don't

Re: associative arrays: iteration is finally here

2009-10-29 Thread Pelle Månsson
bearophile wrote: Andrei Alexandrescu: I'll make aa.remove(key) always work and return a bool that tells you whether there was a mapping or not. I think that's a small design mistake. In a high level language you want things to not fail silently. You want them to fail in an explicit way

Re: associative arrays: iteration is finally here

2009-10-29 Thread Steven Schveighoffer
On Wed, 28 Oct 2009 20:08:34 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Denis Koroskin wrote: On Wed, 28 Oct 2009 23:18:08 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: I'd also like you to add a few things in an AA interface. First, opIn should

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Denis Koroskin
On Thu, 29 Oct 2009 15:32:51 +0300, Jason House jason.james.ho...@gmail.com wrote: Denis Koroskin Wrote: On Thu, 29 Oct 2009 15:12:51 +0300, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: I don't think he uses is(typeof(...)) in the text. The code snippets in question are

Re: associative arrays: iteration is finally here

2009-10-29 Thread Steven Schveighoffer
On Wed, 28 Oct 2009 10:22:00 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Walter has magically converted his work on T[new] into work on making associative arrays true templates defined in druntime and not considered very special by the compiler. This is very exciting

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Don
Lars T. Kyllingstad wrote: Denis Koroskin wrote: On Thu, 29 Oct 2009 15:12:51 +0300, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: Jason House wrote: Andrei Alexandrescu Wrote: It's a rough rough draft, but one for the full chapter on arrays, associative arrays, and strings.

Re: Shared Hell

2009-10-29 Thread Steven Schveighoffer
On Thu, 29 Oct 2009 07:25:20 -0400, Christopher Wright dhase...@gmail.com wrote: Kagamin wrote: Christopher Wright Wrote: A function that accesses shared data has to put in fences. There's no way to have the same code deal with shared and unshared code. Acquiring a lock on a non-shared

More PC Precision Stuff

2009-10-29 Thread dsimcha
I've gotten underway hacking the GC to add precise heap scanning, but I thought of one really annoying corner case that really would make things an order of magnitude more complicated if it were handled properly: Structs and classes that have large static arrays embedded. For example: class Foo

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Jason House 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! I still think is expressions are a glaring problem. Somewhere in the text,

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: http://erdani.com/d/thermopylae.pdf Any feedback is welcome. Thanks! So far I've just taken a look, I'll read it when I can. I can see several warnings in red. The look of the text is really nice! Elegant, and the images are good and necessary. Are you

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:

Re: What Does Haskell Have to Do with C++?

2009-10-29 Thread Andrei Alexandrescu
Don wrote: Andrei Alexandrescu wrote: Don wrote: Jeremie Pelletier wrote: http://bartoszmilewski.wordpress.com/2009/10/21/what-does-haskell-have-to-do-with-c/ Bartosz's second part of 'Template Metaprogramming Made Easy (Huh?)', its quite a read :) Yes, it is excellent. Two comments:

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Lars T. Kyllingstad wrote: Andrei Alexandrescu wrote: dsimcha wrote: == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article 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

Re: More PC Precision Stuff

2009-10-29 Thread bearophile
dsimcha: Since this is such a rare case in practice, I don't think this is a so uncommon case, I use something similar for my memory pools. But if handling this makes your code too much complex, then it may be acceptable to ignore it anyway. Two persons have shown the need for D benchmarks

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Lars T. Kyllingstad 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 It's a very pleasant read, and it looks good. I guess I'll

Re: associative arrays: iteration is finally here

2009-10-29 Thread bearophile
Pelle Månsson: I agree with this. I usually want exceptions. A problem with this is that currently exceptions are very slow in D compiled with DMD (something like up to 11 times slower than Java exceptions, about 2-4 times slower than Python exceptions. I have a benchmark for this on my site).

Re: More PC Precision Stuff

2009-10-29 Thread dsimcha
== Quote from bearophile (bearophileh...@lycos.com)'s article dsimcha: Since this is such a rare case in practice, I don't think this is a so uncommon case, I use something similar for my memory pools. Why not dynamic arrays? Wouldn't it make more sense to do: class MemoryPool { //

Re: associative arrays: iteration is finally here

2009-10-29 Thread Leandro Lucarella
Andrei Alexandrescu, el 28 de octubre a las 20:29 me escribiste: Your test looks something up and then removes it. Andrei Well, my extended test case looks something up, manipulates the found value, and then possibly removes it. Ok, I understand your points, thanks for explaining.

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread bearophile
Andrei Alexandrescu: I did consider Inconsolata seriously, but I had to reject it (I forgot why; all I can remember was that it was a good reason). A problem with Inconsolata that I have forgotten to tell you is that there isn't a true bold version yet, so the bold characters don't have the

Re: associative arrays: iteration is finally here

2009-10-29 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 28 de octubre a las 20:29 me escribiste: Your test looks something up and then removes it. Andrei Well, my extended test case looks something up, manipulates the found value, and then possibly removes it. Ok, I understand your points, thanks

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: I did consider Inconsolata seriously, but I had to reject it (I forgot why; all I can remember was that it was a good reason). A problem with Inconsolata that I have forgotten to tell you is that there isn't a true bold version yet, so the bold

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

Re: associative arrays: iteration is finally here

2009-10-29 Thread Bill Baxter
On Thu, Oct 29, 2009 at 8:39 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Leandro Lucarella wrote: Andrei Alexandrescu, el 28 de octubre a las 20:29 me escribiste: Your test looks something up and then removes it. Andrei Well, my extended test case looks something up,

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Saaa
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 Makes me want to read the rest! Will we get the electronic version with the paper

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Leandro Lucarella
Andrei Alexandrescu, el 28 de octubre a las 23:38 me escribiste: 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! It looks very nice. A small error in 4.1.7 first code

Re: associative arrays: iteration is finally here

2009-10-29 Thread Kagamin
Andrei Alexandrescu Wrote: Two other iterations are possible: by key and by value (in those cases iter.front just returns a key or a value). Well, AA already has properties keys and values and you can already iterate over them. I think, it's ok to restrict to opApply(int delegate(ref

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Leandro Lucarella
Leandro Lucarella, el 29 de octubre a las 13:21 me escribiste: Andrei Alexandrescu, el 28 de octubre a las 23:38 me escribiste: 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

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
Saaa wrote Also, no mention about .dup not being a deep dup. Sorry, should've been attached to my response

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Bill Baxter
On Thu, Oct 29, 2009 at 9:31 AM, Leandro Lucarella llu...@gmail.com wrote: Leandro Lucarella, el 29 de octubre a las 13:21 me escribiste: Andrei Alexandrescu, el 28 de octubre a las 23:38 me escribiste: It's a rough rough draft, but one for the full chapter on arrays, associative arrays, and

Re: associative arrays: iteration is finally here

2009-10-29 Thread KennyTM~
On Oct 29, 09 23:59, Bill Baxter wrote: On Thu, Oct 29, 2009 at 8:39 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Leandro Lucarella wrote: Andrei Alexandrescu, el 28 de octubre a las 20:29 me escribiste: Your test looks something up and then removes it. Andrei Well, my

Re: The Thermopylae excerpt of TDPL available online

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

Re: associative arrays: iteration is finally here

2009-10-29 Thread bearophile
KennyTM~: Um what? aa[theKey] = 1 doesn't fail, why should aa.remove(theKey) be special? That's a different situation. You probably meant to say: If aa[theKey]++; doesn't fail, why should aa.remove(theKey) be special? void discard(K,V)(ref V[K] aa, in K key) { if (!aa.remove(key))

Re: associative arrays: iteration is finally here

2009-10-29 Thread Bill Baxter
On Thu, Oct 29, 2009 at 9:57 AM, KennyTM~ kenn...@gmail.com wrote: On Oct 29, 09 23:59, Bill Baxter wrote: On Thu, Oct 29, 2009 at 8:39 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org  wrote: Leandro Lucarella wrote: Andrei Alexandrescu, el 28 de octubre a las 20:29 me escribiste:

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Saaa wrote: Will we get the electronic version with the paper version? I'm not exactly sure how things will roll out. Probably yes. p2. typo: eenlists p9. Is it ok to expect the order of an array expression to be like in foreach ? Maybe mention a[] = b. p11. typo: no(t) palindrome

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 28 de octubre a las 23:38 me escribiste: 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! It looks very nice. A small error

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Saaa wrote: Also, no mention about .dup not being a deep dup. I've put this on my todo list, but it's difficult. At this point people only know about statements and expressions, so it would be a bit difficult to introduce the subtleties of shallow vs. deep copying. I guess I'll have to do

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Leandro Lucarella, el 29 de octubre a las 13:21 me escribiste: Andrei Alexandrescu, el 28 de octubre a las 23:38 me escribiste: 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

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

Re: associative arrays: iteration is finally here

2009-10-29 Thread Andrei Alexandrescu
Bill Baxter wrote: On Thu, Oct 29, 2009 at 8:39 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Leandro Lucarella wrote: Andrei Alexandrescu, el 28 de octubre a las 20:29 me escribiste: Your test looks something up and then removes it. Andrei Well, my extended test case looks

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Pelle Månsson
Andrei Alexandrescu wrote: 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å

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Ellery Newcomer wrote: 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

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Robert Jacques
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,

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Leandro Lucarella
Andrei Alexandrescu, el 29 de octubre a las 12:23 me escribiste: Leandro Lucarella wrote: Leandro Lucarella, el 29 de octubre a las 13:21 me escribiste: Andrei Alexandrescu, el 28 de octubre a las 23:38 me escribiste: BTW, it looks like array literals will be dynamic arrays, from the code in

Re: associative arrays: iteration is finally here

2009-10-29 Thread Leandro Lucarella
Andrei Alexandrescu, el 29 de octubre a las 12:33 me escribiste: Bill Baxter wrote: I think bool remove(key) is better than all other designs suggested so far. I agree with the folks who say it's error-prone. I can just see myself now removing a key I know is in the dictionary and being

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!

Re: associative arrays: iteration is finally here

2009-10-29 Thread Bill Baxter
On Thu, Oct 29, 2009 at 10:33 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Bill Baxter wrote: On Thu, Oct 29, 2009 at 8:39 AM, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Leandro Lucarella wrote: Andrei Alexandrescu, el 28 de octubre a las 20:29 me escribiste:

Re: associative arrays: iteration is finally here

2009-10-29 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 29 de octubre a las 12:33 me escribiste: Bill Baxter wrote: I think bool remove(key) is better than all other designs suggested so far. I agree with the folks who say it's error-prone. I can just see myself now removing a key I know is in the

Re: associative arrays: iteration is finally here

2009-10-29 Thread Bill Baxter
On Thu, Oct 29, 2009 at 11:16 AM, Leandro Lucarella llu...@gmail.com wrote: Andrei Alexandrescu, el 29 de octubre a las 12:33 me escribiste: Bill Baxter wrote: I think bool remove(key) is better than all other designs suggested so far. I agree with the folks who say it's error-prone.  I can

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Leandro Lucarella wrote: Andrei Alexandrescu, el 29 de octubre a las 12:23 me escribiste: Leandro Lucarella wrote: Leandro Lucarella, el 29 de octubre a las 13:21 me escribiste: Andrei Alexandrescu, el 28 de octubre a las 23:38 me escribiste: BTW, it looks like array literals will be dynamic

Re: Shared Hell

2009-10-29 Thread Walter Bright
Kagamin wrote: Walter Bright Wrote: A function that accesses shared data has to put in fences. There's no way to have the same code deal with shared and unshared code. Shared code perfectly deals with unshared data (it's not guaranteed that shared data is accessed by more than one thread). In

another stack frame optimization issue

2009-10-29 Thread sprucely
So I have this optimization in which I jump from function to function to avoid the overhead of setting up and tearing down identical stack frames. Now I want to be able to jump from a member function of one object to a member function of another object. I accomplished this with g++ by replacing

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

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Manuel
Andrei Alexandrescu Wrote: Any feedback is welcome. Thanks! Thanks Andrei, that was an excellent read. Some comments: Page 102, line 23. I'm not a native English speaker, but it seems like you're missing a such in the sentence there is a thing as a Page 116, line 13: shouldn't array

Re: associative arrays: iteration is finally here

2009-10-29 Thread rmcguire
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Denis Koroskin wrote: On Wed, 28 Oct 2009 17:22:00 +0300, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Walter has magically converted his work on T[new] into work on making associative arrays true templates defined in

Re: associative arrays: iteration is finally here

2009-10-29 Thread KennyTM~
On Oct 30, 09 01:14, bearophile wrote: KennyTM~: Um what? aa[theKey] = 1 doesn't fail, why should aa.remove(theKey) be special? That's a different situation. You probably meant to say: If aa[theKey]++; doesn't fail, why should aa.remove(theKey) be special? void discard(K,V)(ref V[K] aa,

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Andrei Alexandrescu
Tom S 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! Thanks for the excerpt! I've only had the time to give it a brief skim so far,

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Max Samukha
On Thu, 29 Oct 2009 13:30:35 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: It's me as well. The decision didn't go without a fight (I had your viewpoint and Walter didn't). He convinced me with two arguments. One is that 90% of the time you actually want T[], not T[n]. The

Re: associative arrays: iteration is finally here

2009-10-29 Thread Andrei Alexandrescu
rmcguire wrote: Wouldn't opIn be more useful if it returned a range starting with the element that was found? Thought about that, but it's hard to justify. Items aren't sorted in any particular order, so you'd get pretty much a random bunch of stuff. Andrei

Re: More PC Precision Stuff

2009-10-29 Thread Michel Fortin
On 2009-10-29 09:42:58 -0400, dsimcha dsim...@yahoo.com said: I've gotten underway hacking the GC to add precise heap scanning, but I thought of one really annoying corner case that really would make things an order of magnitude more complicated if it were handled properly: Structs and classes

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Denis Koroskin
On Thu, 29 Oct 2009 21:59:13 +0300, Max Samukha spam...@d-coding.com wrote: On Thu, 29 Oct 2009 13:30:35 -0500, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: It's me as well. The decision didn't go without a fight (I had your viewpoint and Walter didn't). He convinced me with two

Re: associative arrays: iteration is finally here

2009-10-29 Thread Leandro Lucarella
KennyTM~, el 30 de octubre a las 02:55 me escribiste: On Oct 30, 09 01:14, bearophile wrote: KennyTM~: Um what? aa[theKey] = 1 doesn't fail, why should aa.remove(theKey) be special? That's a different situation. You probably meant to say: If aa[theKey]++; doesn't fail, why should

Re: associative arrays: iteration is finally here

2009-10-29 Thread rmcguire
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: rmcguire wrote: Wouldn't opIn be more useful if it returned a range starting with the element that was found? Thought about that, but it's hard to justify. Items aren't sorted in any particular order, so you'd get pretty much a

Re: More PC Precision Stuff

2009-10-29 Thread Lutger
dsimcha wrote: I've gotten underway hacking the GC to add precise heap scanning, but I thought of one really annoying corner case that really would make things an order of magnitude more complicated if it were handled properly: Structs and classes that have large static arrays embedded.

Re: More PC Precision Stuff

2009-10-29 Thread Denis Koroskin
On Thu, 29 Oct 2009 22:32:54 +0300, Lutger lutger.blijdest...@gmail.com wrote: dsimcha wrote: I've gotten underway hacking the GC to add precise heap scanning, but I thought of one really annoying corner case that really would make things an order of magnitude more complicated if it were

Re: associative arrays: iteration is finally here

2009-10-29 Thread Leandro Lucarella
Andrei Alexandrescu, el 29 de octubre a las 13:26 me escribiste: Leandro Lucarella wrote: Andrei Alexandrescu, el 29 de octubre a las 12:33 me escribiste: Bill Baxter wrote: I think bool remove(key) is better than all other designs suggested so far. I agree with the folks who say it's

Re: More PC Precision Stuff

2009-10-29 Thread dsimcha
== Quote from Lutger (lutger.blijdest...@gmail.com)'s article dsimcha wrote: I've gotten underway hacking the GC to add precise heap scanning, but I thought of one really annoying corner case that really would make things an order of magnitude more complicated if it were handled properly:

Re: associative arrays: iteration is finally here

2009-10-29 Thread bearophile
KennyTM~: (Moreover, having .remove() to throw means you can't delete any dictionary items in nothrow functions. Sure you can silent it with try/catch but that's expensive.) In nothrow functions you can use a different method, like discard (or a similar name less intuitive than remove),

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Leandro Lucarella
Andrei Alexandrescu, el 29 de octubre a las 13:30 me escribiste: Leandro Lucarella wrote: Andrei Alexandrescu, el 29 de octubre a las 12:23 me escribiste: Leandro Lucarella wrote: Leandro Lucarella, el 29 de octubre a las 13:21 me escribiste: Andrei Alexandrescu, el 28 de octubre a las 23:38

Re: The Thermopylae excerpt of TDPL available online

2009-10-29 Thread Ellery Newcomer
Andrei Alexandrescu wrote: Ellery Newcomer wrote: 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.

  1   2   >