Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Mike James
Got my collectors item delivered today from Amazon UK. Looks good. I like the bonus of being able to download a PDF version of TDPL. Thanks for all the hard work Andrei. -=mike=- Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message news:hu3hq6$2f0...@digitalmars.com... Due to

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Alix Pexton
On 21/06/2010 20:23, Mike James wrote: Got my collectors item delivered today from Amazon UK. Looks good. I like the bonus of being able to download a PDF version of TDPL. Thanks for all the hard work Andrei. -=mike=- Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Mike James
I wondered that too - looking at the footer thats added to the PDF file it doesn't mention that it timeouts after 45 days. I guess only Andrei can tell us for sure ;-) -=mike=- Alix Pexton alix.dot.pex...@gmail.dot.com wrote in message news:hvoep9$2ld...@digitalmars.com... On 21/06/2010

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Adrian Matoga
Alix Pexton pisze: On 21/06/2010 20:23, Mike James wrote: Got my collectors item delivered today from Amazon UK. Looks good. I like the bonus of being able to download a PDF version of TDPL. Where to find this PDF version? I can only see the contents, excerpt from first chapter, and the

Re: Where will D be in 2015 in the programming language ecosphere?

2010-06-21 Thread Rory McGuire
On Sat, 19 Jun 2010 15:04:21 +0200, Justin Johansson n...@spam.com wrote: Me thinks this both a polite question and a question due of realistic answers. How doth thou respond? Not sure, but what I do think is: If D ran on ARM it would be a favorite for mobile devices, often programs

Re: A web server with D

2010-06-21 Thread Rory McGuire
On Sun, 20 Jun 2010 13:54:26 +0200, Mengu menguka...@gmail.com wrote: Hi, I have been interested in and learning D for a while and currently developing a web development IDE with it. I can say that I have a middle level knowledge that I have been trying to increase. Anyway. I want to

Re: main.d(61): Error: temp_[i_] isn't mutable

2010-06-21 Thread Ben Hanson
Hi Andrei, == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 06/20/2010 12:56 PM, Ali Çehreli wrote: Ben Hanson wrote: == Quote from Justin Spahr-Summers (justin.spahrsumm...@gmail.com)'s string is actually an alias for immutable(char)[] (and similarly for

Re: Improving std.regex(p)

2010-06-21 Thread Ben Hanson
== Quote from Ellery Newcomer (ellery-newco...@utulsa.edu)'s article On 06/19/2010 03:35 AM, Ben Hanson wrote: I can't prove what the comlexity is for DFA compilation, but instead, I challenge anyone to show slow compilation times with any DFA compatible regex. As I don't have some D

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread bearophile
Andrei: The intent is to only require a control flow transfer if there is at least one statement after the label. The current switch syntax is already very hairy (even lot of people on this newsgroup are ignorant about some parts of it!) and it contains one or more special cases. So I suggest

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread Don
bearophile wrote: Andrei: The intent is to only require a control flow transfer if there is at least one statement after the label. The current switch syntax is already very hairy (even lot of people on this newsgroup are ignorant about some parts of it!) and it contains one or more

Re: Using Classes as the KeyType (from the Docs)

2010-06-21 Thread Steven Schveighoffer
On Sun, 20 Jun 2010 16:50:04 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Notice I've replaced foo with f Foo is the class, but there's no mention of foo. I'm guessing it was a typo, unless I'm missunderstanding something. Yes, it's a typo. You should file a bug. -Steve

How to erase chars from char[]?

2010-06-21 Thread Ben Hanson
I've changed the code to use CharT[] again, which simplified things substantially. However, I can't find a way to erase characters from a char[]. Can anyone help? See the current code below. Thanks, Ben module main; import std.algorithm; import std.string; template regex(CharT) { struct

Re: How to erase chars from char[]?

2010-06-21 Thread bearophile
Ben Hanson: However, I can't find a way to erase characters from a char[]. Can anyone help? If you need to delete the last chars you can just decrease the length. If you need to delete chars in the middle you can copy items with memmove() and then decrease the length. You can also write a

Stack info

2010-06-21 Thread bearophile
Is is possible to add to Phobos standard functions (intrinsics, if necessary) that give some information about the C stack? Things like: - Available space left on the stack (for a thread) - Total size of the stack at program start - The direction of stack growth (see for example

Re: enforce()?

2010-06-21 Thread Andrei Alexandrescu
On 06/20/2010 11:08 PM, Leandro Lucarella wrote: Walter Bright, el 20 de junio a las 19:32 me escribiste: Leandro Lucarella wrote: Why will you assume I'm so dumb that I won't use your interface correctly? Windows has had major legacy compatibility issues because critical third party

Re: main.d(61): Error: temp_[i_] isn't mutable

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 03:37 AM, Ben Hanson wrote: I'm currently using strings for the regex strings themselves. In lexertl, I use templated free functions what work with iterators, which means input can come from different sources. This sounds like the kind of thing you are talking about? Regards, Ben

Re: How to erase chars from char[]?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 06:43 AM, Ben Hanson wrote: I've changed the code to use CharT[] again, which simplified things substantially. However, I can't find a way to erase characters from a char[]. Can anyone help? http://www.digitalmars.com/d/2.0/phobos/std_array.html#replace Andrei

Re: enforce()?

2010-06-21 Thread Rory McGuire
On Mon, 21 Jun 2010 06:08:01 +0200, Leandro Lucarella l...@llucax.com.ar wrote: Walter Bright, el 20 de junio a las 19:32 me escribiste: Leandro Lucarella wrote: Why will you assume I'm so dumb that I won't use your interface correctly? Windows has had major legacy compatibility issues

Re: enforce()?

2010-06-21 Thread Leandro Lucarella
Andrei Alexandrescu, el 21 de junio a las 08:02 me escribiste: On 06/20/2010 11:08 PM, Leandro Lucarella wrote: Walter Bright, el 20 de junio a las 19:32 me escribiste: Leandro Lucarella wrote: Why will you assume I'm so dumb that I won't use your interface correctly? Windows has had major

Re: Improving std.regex(p)

2010-06-21 Thread Ellery Newcomer
On 06/19/2010 11:27 PM, Ellery Newcomer wrote: On 06/19/2010 10:55 PM, BCS wrote: Hello Nick, BCS n...@anon.com wrote in message news:a6268ff154ca8ccddf1ef51e...@news.digitalmars.com... Hello Ellery, Generally I think D's CT capabilities have a way to go yet before this would be worth

Re: Improving std.regex(p)

2010-06-21 Thread Ellery Newcomer
On 06/21/2010 04:07 AM, Ben Hanson wrote: == Quote from Ellery Newcomer (ellery-newco...@utulsa.edu)'s article On 06/19/2010 03:35 AM, Ben Hanson wrote: I can't prove what the comlexity is for DFA compilation, but instead, I challenge anyone to show slow compilation times with any DFA

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread KennyTM~
On Jun 21, 10 17:52, bearophile wrote: Andrei: The intent is to only require a control flow transfer if there is at least one statement after the label. The current switch syntax is already very hairy (even lot of people on this newsgroup are ignorant about some parts of it!) and it

Re: DMD Backend Long-term

2010-06-21 Thread Sean Kelly
dsimcha dsim...@yahoo.com wrote: What is the long-term plan for the current DMD backend? I've noticed the first steps towards 64-bit support were just checked in today (excitement to the extreme). However, the backend is under such a restrictive license (which I understand Walter is not

Re: Using Classes as the KeyType (from the Docs)

2010-06-21 Thread Andrej Mitrovic
Steven Schveighoffer Wrote: On Sun, 20 Jun 2010 16:50:04 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Notice I've replaced foo with f Foo is the class, but there's no mention of foo. I'm guessing it was a typo, unless I'm missunderstanding something. Yes, it's a

Re: DMD Backend Long-term

2010-06-21 Thread Eldar Insafutdinov
== Quote from dsimcha (dsim...@yahoo.com)'s article What is the long-term plan for the current DMD backend? I've noticed the first steps towards 64-bit support were just checked in today (excitement to the extreme). However, the backend is under such a restrictive license (which I understand

Re: Using Classes as the KeyType (from the Docs)

2010-06-21 Thread Steven Schveighoffer
On Mon, 21 Jun 2010 12:18:47 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Steven Schveighoffer Wrote: On Sun, 20 Jun 2010 16:50:04 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Notice I've replaced foo with f Foo is the class, but there's no mention of foo. I'm

Re: Using Classes as the KeyType (from the Docs)

2010-06-21 Thread Brad Roberts
On 6/21/2010 9:18 AM, Andrej Mitrovic wrote: Steven Schveighoffer Wrote: On Sun, 20 Jun 2010 16:50:04 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Notice I've replaced foo with f Foo is the class, but there's no mention of foo. I'm guessing it was a typo, unless I'm

Re: Using Classes as the KeyType (from the Docs)

2010-06-21 Thread Andrej Mitrovic
Brad Roberts Wrote: On 6/21/2010 9:18 AM, Andrej Mitrovic wrote: Steven Schveighoffer Wrote: On Sun, 20 Jun 2010 16:50:04 -0400, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: Notice I've replaced foo with f Foo is the class, but there's no mention of foo. I'm guessing it

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
KennyTM~ wrote: On Jun 19, 10 07:17, Jonathan M Davis wrote: bearophile wrote: 2) switch cases that don't end with goto or break: void main() { int x, y; switch (x) { case 0: y++; default: y--; } } I, for one, _want_ case statements to be able to

Re: DMD Backend Long-term

2010-06-21 Thread Nick Sabalausky
Eldar Insafutdinov e.insafutdi...@gmail.com wrote in message news:hvo49k$1uk...@digitalmars.com... In the end, Windows is the most popular OS despite our personal preferences, and it's worth spending some time for it. I wish someone could convince LLVM of that...

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread bearophile
KennyTM~: That is just C#'s switch syntax. Some of the C# designers are people with a long experience in implementing (Pascal-like) programming languages. Convergent evolution is a way to confirm my idea was good, then :-) And I don't see how the current switch syntax is hairy. Even if you

Re: enforce()?

2010-06-21 Thread Sean Kelly
Andrei Alexandrescu Wrote: On 06/20/2010 06:18 PM, Vladimir Panteleev wrote: On Mon, 21 Jun 2010 00:17:28 +0300, Walter Bright newshou...@digitalmars.com wrote: An input to a dll is user input, and should be validated (for the sake of security, and other reasons). Validating it is not

Re: enforce()?

2010-06-21 Thread Adrian Matoga
Leandro Lucarella pisze: Walter Bright, el 20 de junio a las 19:32 me escribiste: Leandro Lucarella wrote: Why will you assume I'm so dumb that I won't use your interface correctly? Windows has had major legacy compatibility issues because critical third party applications misused the APIs.

Re: enforce()?

2010-06-21 Thread Sean Kelly
Rory McGuire Wrote: I think perhaps you mis-understood, it is mostly not stupidity that causes people to use undocumented features of an API but rather, it is people being overly clever. Or sometimes simply desperation. There are some classes of apps that require the use of

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Sean Kelly
Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case since it's more explicit and less error

Re: DMD Backend Long-term

2010-06-21 Thread Robert Clipsham
On 21/06/10 16:07, dsimcha wrote: What is the long-term plan for the current DMD backend? I've noticed the first steps towards 64-bit support were just checked in today (excitement to the extreme). However, the backend is under such a restrictive license (which I understand Walter is not free

Re: enforce()?

2010-06-21 Thread bearophile
Sean Kelly: First, what if a library eats its own dogfood? If my library provides a public method to spawn threads and the library itself uses threads internally then I have two different methods of checking the integrity of my own library, each possibly throwing different exceptions (enforce

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread bearophile
Sean Kelly: Having never encountered D before, what would be your interpretation of this code? Unfortunately the continue case; syntax looks about equally unintuitive to me :-( Bye, bearophile

finding a circular dependency

2010-06-21 Thread Steven Schveighoffer
I've been trying to get a modified version of std.process to compile (with Lars K's changes) for windows, and phobos finally compiled. So I built a little test program, compiled it, and I get the following error message: object.Exception: circular dependency in module std.stdio. Great.

Errors in TDPL

2010-06-21 Thread Jonathan M Davis
Okay. I am in no way trying to say anything negative about TDPL. In fact, from what I've read so far, it's absolutely fantastic and quite possibly the most entertaining programming book that I've read in addition to being quite informative about D. However, no one's perfect (Andrei included),

Re: String Literal Docs

2010-06-21 Thread Alix Pexton
On 20/06/2010 22:46, Alix Pexton wrote: On 20/06/2010 21:37, Ellery Newcomer wrote: On 06/20/2010 03:01 PM, Alix Pexton wrote: On 19/06/2010 21:12, Alix Pexton wrote: I've been sketching some grammar diagrams for D2.0, a little like those on JSON.org, and of course I didn't get far before I

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Mike James
Got my collectors item delivered today from Amazon UK. Looks good. I like the bonus of being able to download a PDF version of TDPL. Thanks for all the hard work Andrei. -=mike=- Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message news:hu3hq6$2f0...@digitalmars.com... Due to

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Alix Pexton
On 21/06/2010 20:23, Mike James wrote: Got my collectors item delivered today from Amazon UK. Looks good. I like the bonus of being able to download a PDF version of TDPL. Thanks for all the hard work Andrei. -=mike=- Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message

Re: Errors in TDPL

2010-06-21 Thread bearophile
Jonathan M Davis: An online Errata Corrige will be very useful. and I believe that foreach_reverse has been deprecated in favor of using the combination of foreach and retro. How do you write this? foreach_reverse (i; 0 .. 10) Bye, bearophile

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Mike James
I wondered that too - looking at the footer thats added to the PDF file it doesn't mention that it timeouts after 45 days. I guess only Andrei can tell us for sure ;-) -=mike=- Alix Pexton alix.dot.pex...@gmail.dot.com wrote in message news:hvoep9$2ld...@digitalmars.com... On 21/06/2010

Re: Errors in TDPL

2010-06-21 Thread Alix Pexton
On 21/06/2010 20:09, Jonathan M Davis wrote: Okay. I am in no way trying to say anything negative about TDPL. In fact, from what I've read so far, it's absolutely fantastic and quite possibly the most entertaining programming book that I've read in addition to being quite informative about D.

Re: Errors in TDPL

2010-06-21 Thread Adam Ruppe
On 6/21/10, bearophile bearophileh...@lycos.com wrote: How do you write this? foreach_reverse (i; 0 .. 10) foreach(i; retro(iota(0, 10))) { } ?

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Don
Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. Excellent! I'll make a patch for it when I have time. Walter just

Re: String Literal Docs

2010-06-21 Thread Ellery Newcomer
On 06/21/2010 02:21 PM, Alix Pexton wrote: On 20/06/2010 22:46, Alix Pexton wrote: On 20/06/2010 21:37, Ellery Newcomer wrote: On 06/20/2010 03:01 PM, Alix Pexton wrote: On 19/06/2010 21:12, Alix Pexton wrote: I've been sketching some grammar diagrams for D2.0, a little like those on

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 03:08 PM, Don wrote: Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it. It won't impact TDPL adversely. Excellent! I'll make a patch for

Re: Errors in TDPL

2010-06-21 Thread Ellery Newcomer
I was biting my tongue on the subject, but on page 73 the grammar for the do while loop has a semicolon at the end. AAH THERE IS NOOO SEMICOLON AT THE END. Wow. Sorry. This is a pet peeve of mine.

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread bearophile
Don: I patched my DMD. Quite successful. It caught 8 bugs in Phobos, in code written by at least 4 different people. I think everyone gets stung by that B. Thank you Don. Bye, bearophile

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Sean Kelly
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for

Re: Errors in TDPL

2010-06-21 Thread Tomek Sowiński
Dnia 21-06-2010 o 21:57:49 Alix Pexton alix.dot.pex...@gmail.dot.com napisał(a): There is only one mention of lazy evaluation in the index and it doesn't mention the lazy k/w at all. I seem to remember Andrei dislikes it, but also that there is another way to get function params to be

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Ellery Newcomer
On 06/21/2010 03:46 PM, Sean Kelly wrote: Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to

Re: DMD Backend Long-term

2010-06-21 Thread Leandro Lucarella
Nick Sabalausky, el 21 de junio a las 13:40 me escribiste: Eldar Insafutdinov e.insafutdi...@gmail.com wrote in message news:hvo49k$1uk...@digitalmars.com... In the end, Windows is the most popular OS despite our personal preferences, and it's worth spending some time for it. I

Re: Errors in TDPL

2010-06-21 Thread bearophile
Adam Ruppe: foreach(i; retro(iota(0, 10))) { } Oh, right! Or even just: foreach (i; retro(iota(10))) {} But abstraction has a cost, see below. I have written three test programs. // test1 import std.c.stdio: printf; void main() { enum int N = 100_000_000; int count;

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case since it's more

Re: enforce()?

2010-06-21 Thread Don
Sean Kelly wrote: Rory McGuire Wrote: I think perhaps you mis-understood, it is mostly not stupidity that causes people to use undocumented features of an API but rather, it is people being overly clever. Or sometimes simply desperation. There are some classes of apps that require the

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 03:46 PM, Sean Kelly wrote: Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Don
Jonathan M Davis wrote: Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd prefer continue switch over goto case

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Don wrote: But 'goto case XXX' is an extremely rarely encountered construct, that screams 'Examine this code closely'. So I don't think it needs extra error checking. Oh, I don't think that it's a big issue. We have goto case XXX and goto case, so we could use them to enforce flow control

Calling C function with static array includes length and pointer

2010-06-21 Thread mwarning
Hi, I try to pass a static array to a variadic C function. Looks like the array is passed by values as expected, but the length and pointer are prepended, too. Is this intentional or a bug? http://pastebin.com/6ejFF37j

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread Sean Kelly
Andrei Alexandrescu Wrote: On 06/21/2010 01:27 PM, Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread Ali Çehreli
mwarning wrote: Hi, I try to pass a static array to a variadic C function. Looks like the array is passed by values as expected, but the length and pointer are prepended, too. Is this intentional or a bug? http://pastebin.com/6ejFF37j Fixed sized arrays don't have ptr and length members:

Re: DMD Backend Long-term

2010-06-21 Thread Long Chang
In windows if you want use some lib that is not provide dynamic dll support, you need compile it with dmc. In this case your need deal a lot problem with lack of c head file . if there is a vc++ version backend will be big help for a lot of people who is not familiarity with c/c++ . 2010/6/22

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Sean Kelly
Jonathan M Davis Wrote: Sean Kelly wrote: It's a small thing, but I think continue switch could be misleading. Consider this: switch (getState()) { case X: setState(Z); continue switch; case Y: break; case Z: writeln( done! ); } Having never

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread mwarning
On Mon, 21 Jun 2010 14:38:50 -0700, Ali Çehreli wrote: mwarning wrote: Hi, I try to pass a static array to a variadic C function. Looks like the array is passed by values as expected, but the length and pointer are prepended, too. Is this intentional or a bug?

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread torhu
On 21.06.2010 23:30, mwarning wrote: Hi, I try to pass a static array to a variadic C function. Looks like the array is passed by values as expected, but the length and pointer are prepended, too. Is this intentional or a bug? http://pastebin.com/6ejFF37j I believe this works as intended.

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread mwarning
On Tue, 22 Jun 2010 00:00:27 +0200, torhu wrote: On 21.06.2010 23:30, mwarning wrote: Hi, I try to pass a static array to a variadic C function. Looks like the array is passed by values as expected, but the length and pointer are prepended, too. Is this intentional or a bug?

Re: String Literal Docs

2010-06-21 Thread Alix Pexton
On 21/06/2010 21:20, Ellery Newcomer wrote: Are your diagrams solely concerned with the lexer? Because I have a (messy) parser grammar which I'm a bit more confident about if you're interested. So far I have only covered the lexer, but most of it needs redoing in light of the errors in the

Re: Errors in TDPL

2010-06-21 Thread Spacen Jasset
I am only on page ten, I believe I saw a minor typo somewhere in the preface, that's all so far. I look forward to pondering the rest in the coming days. oh yes. Preface D is a language that attempts to consistently do the right thing within the constraints it choose: sys etc missing

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 02:09 PM, Jonathan M Davis wrote: Okay. I am in no way trying to say anything negative about TDPL. [snip] You are being too kind about this :o). Of course we need an errata list. I was hoping I'd need to set it up later, but hey, that's a sign people actually are reading the

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 04:15 PM, Don wrote: Jonathan M Davis wrote: Sean Kelly wrote: Jonathan M Davis Wrote: In any case, that means that it could be made required to have a control statement at the end of a case block without having to specify a specific destination for fallthrough - though I'd

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 04:06 PM, bearophile wrote: Adam Ruppe: foreach(i; retro(iota(0, 10))) { } Oh, right! Or even just: foreach (i; retro(iota(10))) {} But abstraction has a cost, see below. I have written three test programs. Nice work. iota() currently uses the formula initial + i * step to

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 03:32 PM, Ellery Newcomer wrote: I was biting my tongue on the subject, but on page 73 the grammar for the do while loop has a semicolon at the end. AAH THERE IS NOOO SEMICOLON AT THE END. Wow. Sorry. This is a pet peeve of mine. Can't help that, sorry...

Re: Calling C function with static array includes length and pointer

2010-06-21 Thread Ali Çehreli
mwarning wrote: Anyway, the D spec says: Static arrays are value types, but as in C static arrays are passed to functions by reference and cannot be returned from functions. (http://www.digitalmars.com/d/1.0/arrays.html#static-arrays) I've been thinking D2. :) In D2, fixed-sized arrays are

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 02:57 PM, Alix Pexton wrote: There is only one mention of lazy evaluation in the index and it doesn't mention the lazy k/w at all. I seem to remember Andrei dislikes it, but also that there is another way to get function params to be evaluated lazily without using it. lazy is

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 05:35 PM, Spacen Jasset wrote: I am only on page ten, I believe I saw a minor typo somewhere in the preface, that's all so far. I look forward to pondering the rest in the coming days. oh yes. Preface D is a language that attempts to consistently do the right thing within the

Re: Errors in TDPL

2010-06-21 Thread Spacen Jasset
Andrei Alexandrescu wrote: On 06/21/2010 05:35 PM, Spacen Jasset wrote: I am only on page ten, I believe I saw a minor typo somewhere in the preface, that's all so far. I look forward to pondering the rest in the coming days. oh yes. Preface D is a language that attempts to consistently do

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Andrei Alexandrescu wrote: After Sean's example, goto case XXX is my fave for fallthrough. I don't like unlabeled goto case to mean fall through, it's one of those need to look in the manual features. goto case XXX is generalized fall through. Andrei Well, it definitely works, but then

Re: finding a circular dependency

2010-06-21 Thread Ellery Newcomer
On 06/21/2010 01:51 PM, Steven Schveighoffer wrote: I've been trying to get a modified version of std.process to compile (with Lars K's changes) for windows, and phobos finally compiled. So I built a little test program, compiled it, and I get the following error message: object.Exception:

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Guillaume B.
Got mine today from Amazon Canada: collector's edition too. I'll start reading it soon! Guillaume Mike James wrote: Got my collectors item delivered today from Amazon UK. Looks good. I like the bonus of being able to download a PDF version of TDPL. Thanks for all the hard work Andrei.

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Adrian Matoga
Alix Pexton pisze: On 21/06/2010 20:23, Mike James wrote: Got my collectors item delivered today from Amazon UK. Looks good. I like the bonus of being able to download a PDF version of TDPL. Where to find this PDF version? I can only see the contents, excerpt from first chapter, and the

Re: Errors in TDPL

2010-06-21 Thread Jonathan M Davis
Andrei Alexandrescu wrote: On 06/21/2010 02:09 PM, Jonathan M Davis wrote: Okay. I am in no way trying to say anything negative about TDPL. [snip] You are being too kind about this :o). Well, I didn't want to post on the main D list and come across as saying that the new book is full of

Re: This just in: authorless TDPL becomes collector's edition

2010-06-21 Thread Bill Baxter
I got my collectors edition from Amazon US a few days ago. I browsed it a bit and it looks like an interesting read even for someone who basically knows D already. Which is good, because anyone who knows C or Java basically does already know most of D. I liked that about Stroustrup's book on

Re: Errors in TDPL

2010-06-21 Thread torhu
On 22.06.2010 00:39, Andrei Alexandrescu wrote: I started an errata list in form of a community wiki at http://www.erdani.com/tdpl/errata For those of us who have still only got the pdf version, is that the same text as the printed one? Should we report errors in the pdf version, or wait

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 06:01 PM, Jonathan M Davis wrote: Andrei Alexandrescu wrote: After Sean's example, goto case XXX is my fave for fallthrough. I don't like unlabeled goto case to mean fall through, it's one of those need to look in the manual features. goto case XXX is generalized fall through.

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 06:30 PM, torhu wrote: On 22.06.2010 00:39, Andrei Alexandrescu wrote: I started an errata list in form of a community wiki at http://www.erdani.com/tdpl/errata For those of us who have still only got the pdf version, is that the same text as the printed one? Should we report

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jeff Nowakowski
On 06/21/2010 05:11 PM, Jonathan M Davis wrote: Having something like fallthrough or goto next case would of course be even clearer, but those would require new keywords. I think fallthrough would be a perfect keyword to add here. C programmers will immediately recognize it. Switch/case are

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Jonathan M Davis
Andrei Alexandrescu wrote: [snip] Andrei Well, goto case and goto case XXX both already exist. Both get the job done. So, regardless of which would be better for fallthrough, we can choose to use whichever we want in our code. As it stands, it becomes a matter of preference. I'd love

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread bearophile
Andrei Alexandrescu: The problem is, if Walter sees us bickering too much, he'll use that as pretext to veto out any improvement. You are wrong, Walter is an adult able to understand discussions, not a capricious dictator :-) Syntax and other things require discussions, sometimes even longish

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Bill Baxter
Did anyone suggest continue case instead of continue switch? That sounds less ambiguous to me. --bb On Mon, Jun 21, 2010 at 4:56 PM, Jonathan M Davis jmdavisp...@gmail.com wrote: Andrei Alexandrescu wrote: [snip] Andrei Well, goto case and goto case XXX both already exist. Both get the

Re: Is there ANY chance we can fix the bitwise operator precedence

2010-06-21 Thread Jonathan M Davis
bearophile wrote: Andrei Alexandrescu: The problem is, if Walter sees us bickering too much, he'll use that as pretext to veto out any improvement. You are wrong, Walter is an adult able to understand discussions, not a capricious dictator :-) Syntax and other things require discussions,

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 06:56 PM, Jonathan M Davis wrote: Andrei Alexandrescu wrote: [snip] Andrei Well, goto case and goto case XXX both already exist. Both get the job done. So, regardless of which would be better for fallthrough, we can choose to use whichever we want in our code. As it stands,

Re: Errors in TDPL

2010-06-21 Thread Leandro Lucarella
Andrei Alexandrescu, el 21 de junio a las 17:43 me escribiste: If efficiency is still sub-par, retro could detect that it's working with iota and generate specialized code. That's not too difficult; for integers, retro(iota(a, b)) could actually be a rewrite to iota(b - 1, a, -1). Figuring out

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Leandro Lucarella
Andrei Alexandrescu, el 21 de junio a las 15:31 me escribiste: On 06/21/2010 03:08 PM, Don wrote: Andrei Alexandrescu wrote: On 06/19/2010 06:58 AM, Don wrote: Andrei Alexandrescu wrote: Don wrote: [snip] Or is too late to break backwards compatibility with B ? We can and should do it.

Re: Is there ANY chance we can fix the bitwise operator precedence rules?

2010-06-21 Thread Bill Baxter
On Mon, Jun 21, 2010 at 4:24 PM, Leandro Lucarella l...@llucax.com.ar wrote: goto next case; is a little more verbose but very clear to me :) Maybe just next case; is a shorter alternative... That would be great if next were a D keyword. But I don't think you're going to get Walter to add a

Operator Precedence Table in Online Docs

2010-06-21 Thread Jonathan M Davis
There is not currently an explicit operator precedence table in the online docs. While C/C++ is close enough that you can generally look at a C/C++ operator precedence table and figure it out if you need to, there are definitely folks who would like a D precedence table to look at (the

  1   2   >