Re: enforce()?

2010-06-21 Thread Vladimir Panteleev
On Mon, 21 Jun 2010 04:53:46 +0300, BCS wrote: If I didn't write the DLL I'm calling, I'll assume it doesn't check stuff. If I didn't write the code calling my DLL, I'll assume it doesn't check stuff. Why should I assume that the documentation is right or that people will even read my docu

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

2010-06-21 Thread Don
Adam Ruppe wrote: On 6/21/10, Andrei Alexandrescu wrote: Then why are people using switch and next to nobody uses fall through (provably including Walter, who thinks is using fall through "all the time")? Do you have some stats from the phobos and dmd source? I ran a crude text pattern progra

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

2010-06-21 Thread Adam Ruppe
On 6/22/10, Don wrote: > Did you consider situations where the last thing before the case is > actually a 'goto' ? Walter does that a lot. Yeah, me too. I counted them the same as break (and continue, return, and throw). Here's my source. I know it has some false negatives and some false positiv

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

2010-06-21 Thread Jonathan M Davis
BCS wrote: > Hello Jonathan, > >> "goto case" does seem a bit silly, but I think that it's clearer and >> less error prone for anyone who understands "goto case." > > Say I have some code with a fall through. If I use the goto case X; > version, it allows the cases to be freely reordered. OTOH i

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

2010-06-21 Thread Don
Jeff Nowakowski wrote: 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 r

Re: DMD Backend Long-term

2010-06-21 Thread Robert Jacques
On Mon, 21 Jun 2010 23:55:48 -0400, BCS wrote: Hello Leandro, Nick Sabalausky, el 21 de junio a las 13:40 me escribiste: "Eldar Insafutdinov" 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

Re: Review: std.msgpack

2010-06-21 Thread Robert Jacques
On Mon, 21 Jun 2010 01:22:40 -0400, Masahiro Nakagawa wrote: On Sun, 20 Jun 2010 02:08:07 +0900, Robert Jacques wrote: On Sat, 19 Jun 2010 00:02:28 -0400, Masahiro Nakagawa wrote: mp_Object is based on std.json.JSONValue. Variant can't have mp_pack method. Hmm..., I check Variant agai

Re: DMD Backend Long-term

2010-06-21 Thread BCS
Hello Robert, 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 Wal

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

2010-06-21 Thread Adam Ruppe
On 6/21/10, Andrei Alexandrescu wrote: > Then why are people using switch and next to nobody uses fall through > (provably including Walter, who thinks is using fall through "all the > time")? Do you have some stats from the phobos and dmd source? I ran a crude text pattern program, and it said a

Re: DMD Backend Long-term

2010-06-21 Thread BCS
Hello Leandro, Nick Sabalausky, el 21 de junio a las 13:40 me escribiste: "Eldar Insafutdinov" 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

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 6:31 PM, Leandro Lucarella wrote: > Bill Baxter, el 21 de junio a las 17:13 me escribiste: >> On Mon, Jun 21, 2010 at 4:24 PM, Leandro Lucarella >> wrote: >> > goto next case; is a little more verbose but very clear to me :) >> > >> > Maybe just next case; is a shorter al

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

2010-06-21 Thread BCS
Hello Jonathan, "goto case" does seem a bit silly, but I think that it's clearer and less error prone for anyone who understands "goto case." Say I have some code with a fall through. If I use the goto case X; version, it allows the cases to be freely reordered. OTOH if I use the other option

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 10:01 PM, BCS wrote: On page 6 it say: "the code sample above also introduced the if statement" but none of them do. Could you please add that to the errata? http://erdani.com/tdpl/errata Andrei

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 08:47 PM, Jonathan M Davis wrote: On page 82 of TDPL, it's talking about try/catch/finally statements, and it says that "all controlled statement must be block statements; that is they must be enclosed with braces." However, dmd does not seem to require that try/catch/finally blocks

Re: Errors in TDPL

2010-06-21 Thread Brad Roberts
On 6/21/2010 8:12 PM, Andrei Alexandrescu wrote: > > I optimized things such that the commonly used path (many calls to > empty, front, and popFront) is as fast as possible. The initial work > will be amortized for most loops. > > On my machine, test4 is still 2x slower than foreach_reverse in an

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 08:28 PM, bearophile wrote: Andrei Alexandrescu: That's not too difficult; for integers, retro(iota(a, b)) could actually be a rewrite to iota(b - 1, a, -1).< This is good. In my dlibs the xchain converts xchain(xchain(x, y), z) and similar into xchain(x, y, z). Figuring ou

Re: Errors in TDPL

2010-06-21 Thread BCS
On page 6 it say: "the code sample above also introduced the if statement" but none of them do. -- ... <

Re: Errors in TDPL

2010-06-21 Thread BCS
Hello Tomek, I think the delegate ought to be pure to make the magic happen. That would be a god idea if the feature were strictly for lazy (no cost unless you need it) evaluation but there are other use that need to be able to cause side effects. -- ... <

Re: Review: std.msgpack

2010-06-21 Thread Robert Jacques
On Mon, 21 Jun 2010 22:24:42 -0400, Masahiro Nakagawa wrote: On Sun, 20 Jun 2010 04:27:08 +0900, Jacob Carlborg wrote: Serialization from base class was one of my goals when I implemented Orange. Good. But you need to register a function for that, until D2 fixes the "getMembers" meth

Re: finding a circular dependency

2010-06-21 Thread torhu
On 21.06.2010 20:51, 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: circula

Re: Review: std.msgpack

2010-06-21 Thread Masahiro Nakagawa
On Sun, 20 Jun 2010 04:27:08 +0900, Jacob Carlborg wrote: Serialization from base class was one of my goals when I implemented Orange. Good. But you need to register a function for that, until D2 fixes the "getMembers" method in TypeInfo_Class. You reported this bug? I couldn't find clo

Re: finding a circular dependency

2010-06-21 Thread Robert Jacques
On Mon, 21 Jun 2010 14:51:01 -0400, 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: o

Re: enforce()?

2010-06-21 Thread BCS
Hello Vladimir, On Mon, 21 Jun 2010 07:42:34 +0300, BCS wrote: Why will you assume I'm so dumb that I won't use your interface correctly? First because some people are. And second, because it trivially easy to respond to support calls that start with "Your DLL is throwing a YouAreNotUsingT

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

2010-06-21 Thread Leandro Lucarella
Bill Baxter, el 21 de junio a las 17:13 me escribiste: > On Mon, Jun 21, 2010 at 4:24 PM, Leandro Lucarella 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. Bu

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

2010-06-21 Thread Leandro Lucarella
Jonathan M Davis, el 21 de junio a las 17:03 me escribiste: > 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 discussion

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

2010-06-21 Thread Leandro Lucarella
Adam Ruppe, el 21 de junio a las 20:40 me escribiste: > What's the point of a switch without implicit fallthrough? If you take > that away, it offers nothing that if/elseif doesn't. (Aside from not > retyping the switch(stuff here), which you can bring into a function > anyway, so whoop-de-doo. And

Re: Errors in TDPL

2010-06-21 Thread Jonathan M Davis
On page 82 of TDPL, it's talking about try/catch/finally statements, and it says that "all controlled statement must be block statements; that is they must be enclosed with braces." However, dmd does not seem to require that try/catch/finally blocks have braces, which is what I would expect that

Re: enforce()?

2010-06-21 Thread Vladimir Panteleev
On Mon, 21 Jun 2010 07:42:34 +0300, BCS wrote: Why will you assume I'm so dumb that I won't use your interface correctly? First because some people are. And second, because it trivially easy to respond to support calls that start with "Your DLL is throwing a YouAreNotUsingThisDLLCorrectl

Re: enforce()?

2010-06-21 Thread Vladimir Panteleev
On Mon, 21 Jun 2010 21:15:12 +0300, Adrian Matoga wrote: It was 15 years ago, at the times of 3.x and 95, when Windows behaved like that. More like 10, Windows Millennium was the last 9x-based Windows operating system without strong process isolation. The problem applies not only to Win

Re: enforce()?

2010-06-21 Thread Vladimir Panteleev
On Mon, 21 Jun 2010 16:30:48 +0300, Leandro Lucarella wrote: 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

Re: Errors in TDPL

2010-06-21 Thread bearophile
Andrei Alexandrescu: >That's not too difficult; for integers, retro(iota(a, b)) could actually be a >rewrite to iota(b - 1, a, -1).< This is good. In my dlibs the xchain converts xchain(xchain(x, y), z) and similar into xchain(x, y, z). >Figuring out all corner cases, steps greater than 1, an

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

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 07:40 PM, Adam Ruppe wrote: What's the point of a switch without implicit fallthrough? If you take that away, it offers nothing that if/elseif doesn't. (Aside from not retyping the switch(stuff here), which you can bring into a function anyway, so whoop-de-doo. And I guess some perf

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

2010-06-21 Thread Adam Ruppe
What's the point of a switch without implicit fallthrough? If you take that away, it offers nothing that if/elseif doesn't. (Aside from not retyping the switch(stuff here), which you can bring into a function anyway, so whoop-de-doo. And I guess some performance boosts in rearranging the cases, but

Re: Errors in TDPL

2010-06-21 Thread Andrei Alexandrescu
On 06/21/2010 06:35 PM, Leandro Lucarella wrote: 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 b

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 question

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 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 keyword just fo

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 ? > >>

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

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:25 me escribiste: > 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 > >>d

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: 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 discuss

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 wrote: > Andrei Alexandrescu wrote: > > [snip] >> >> >> Andrei > > Well, "goto case" and "goto case XXX" both already exist. Both get the job

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 longis

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 lo

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

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 er

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 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 un

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 C++,

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

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 i

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 An

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: circ

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,

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 th

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 con

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 pref

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 c

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

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 quit

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 boo

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: 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 DM

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: 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. An

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? >> >> http://paste

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!" )

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 El

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: imp

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 - th

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 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 co

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 Andrei Alexandrescu
On 06/21/2010 03:46 PM, Sean Kelly wrote: 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 destinatio

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 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

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" 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 someon

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 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 destinatio

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: Errors in TDPL

2010-06-21 Thread Tomek Sowiński
Dnia 21-06-2010 o 21:57:49 Alix Pexton 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 evaluated lazily without using i

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

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 fallthro

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: 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 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: 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: 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 JSON.org

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 g

Re: Errors in TDPL

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

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" wrote in message news:hvoep9$2ld...@digitalmars.com... > On 21/06/2010 20:23, Mike James wrote: >> Go

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. How

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 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 Alexandrescu" wrote in message news:hu3hq6$2f0...@digitalmars.co

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 ra

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" wrote in message news:hu3hq6$2f0...@digitalmars.com... > Due to a pretty odd mistake at t

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), an

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. Ho

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

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 (enfo

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 t

  1   2   >