Re: Raw binary(to work without OS) in D

2012-07-02 Thread Don Clugston
On 28/06/12 18:37, David Nadlinger wrote: On Thursday, 28 June 2012 at 15:28:10 UTC, Don Clugston wrote: There's an oddity, though: the type of X.significand would be dependent on the type of X […] I don't think this is a problem at all – for example, the type of T.init depends on

Re: Raw binary(to work without OS) in D

2012-07-02 Thread Don Clugston
On 28/06/12 18:36, Jens Mueller wrote: Don Clugston wrote: On 28/06/12 17:00, Jens Mueller wrote: Andrei Alexandrescu wrote: On 6/28/12 10:07 AM, Roman D. Boiko wrote: On Thursday, 28 June 2012 at 14:04:37 UTC, Mehrdad wrote: I think just exposing them via .sig and .exp might be the way to

Re: Two Scala annotations

2012-07-02 Thread Don Clugston
On 01/07/12 04:00, Walter Bright wrote: On 6/30/2012 6:05 PM, bearophile wrote: Walter Bright: It's not a bug. It's deliberate, and is there to support mechanical translation of Java code. Is this stuff written somewhere in a D design rationales page? Now that D is several years old, how mu

Re: Two Scala annotations

2012-07-03 Thread Don Clugston
On 02/07/12 23:20, Walter Bright wrote: On 7/2/2012 1:04 PM, bearophile wrote: Walter Bright: Put "final" in front of y, and it will compile. Remember, this was done for D1 that didn't have const. I see. So in D2 are we going to require that y to be immutable? No. I don't agree there's a p

Re: Exquisite code samples

2012-07-10 Thread Don Clugston
On 10/07/12 09:49, renoX wrote: On Monday, 9 July 2012 at 11:40:37 UTC, Gor Gyolchanyan wrote: [cut] You're right. This is a bit advanced code sample, which uses templates,template constraints, contract programming among syntax advantages of D. Hum it show the power of D sure, but IMHO it also

Re: Inherited const when you need to mutate

2012-07-11 Thread Don Clugston
On 10/07/12 19:13, H. S. Teoh wrote: On Tue, Jul 10, 2012 at 06:48:51PM +0200, Timon Gehr wrote: On 07/10/2012 06:45 PM, H. S. Teoh wrote: Yeah, this is logical const. Unfortunately, D doesn't have logical const. Then why on earth is druntime acting as if it does? Y'know, this brings up an

Re: just an idea (!! operator)

2012-07-11 Thread Don Clugston
On 11/07/12 13:47, monarch_dodra wrote: On Wednesday, 11 July 2012 at 11:18:21 UTC, akaz wrote: if needed, the operator !! (double exclamation mark) could be defined. Problem is that operator"!!" is already used asa twin operator"!". This is shorthand for "is valid as bool": I wouldn't be

Re: All right, all right! Interim decision regarding qualified Object methods

2012-07-12 Thread Don Clugston
On 12/07/12 06:15, Andrei Alexandrescu wrote: Required reading prior to this: http://goo.gl/eXpuX You destroyed, we listened. I think Christophe makes a great point. We've been all thinking inside the box but we should question the very existence of the box. Once the necessity of opCmp, opEqual

Re: All right, all right! Interim decision regarding qualified Object methods

2012-07-12 Thread Don Clugston
On 12/07/12 12:00, Paulo Pinto wrote: On Thursday, 12 July 2012 at 08:59:46 UTC, Don Clugston wrote: On 12/07/12 06:15, Andrei Alexandrescu wrote: Required reading prior to this: http://goo.gl/eXpuX You destroyed, we listened. I think Christophe makes a great point. We've been all thi

Re: All right, all right! Interim decision regarding qualified Object methods

2012-07-13 Thread Don Clugston
On 13/07/12 11:02, F i L wrote: I always wondered why toString() wasn't just to!string() in the first place, short of UFCS not being implemented for all types. toString() comes from the days before D had templates.

Re: D versionning

2012-07-13 Thread Don Clugston
On 13/07/12 09:11, Jacob Carlborg wrote: On 2012-07-13 08:52, Adam Wilson wrote: I hope Walter isn't against this, because I'm not seeing much community disagreement with this... If he's not against it, I see know reason why this haven't been done already. It has. It's called D1.

Re: D versionning

2012-07-16 Thread Don Clugston
On 16/07/12 16:51, David Nadlinger wrote: On Monday, 16 July 2012 at 06:00:03 UTC, Walter Bright wrote: Supporting Win64 is absolutely critical for the future of D, and the sooner we get it, the better. The COFF route is the shortest route to doing it, and the most practical for attracting devs,

Re: Why is std.algorithm so complicated to use?

2012-07-16 Thread Don Clugston
On 10/07/12 16:59, Andrei Alexandrescu wrote: On 7/10/12 9:59 AM, H. S. Teoh wrote: On Tue, Jul 10, 2012 at 09:28:51AM -0400, Andrei Alexandrescu wrote: On 7/10/12 2:50 AM, Jacob Carlborg wrote: On 2012-07-09 22:16, Andrei Alexandrescu wrote: So foo is a range of strings, because each elemen

Re: feature request: with(var decl) {}

2012-07-24 Thread Don Clugston
On 23/07/12 17:04, Adam D. Ruppe wrote: On Monday, 23 July 2012 at 14:46:30 UTC, FeepingCreature wrote: The more general form would be to make variable declaration an expression. Right, and that would be pretty amazing, but it would probably be too hard to do in D today... The bizarre thing

Re: Computed gotos on Reddit

2012-07-25 Thread Don Clugston
On 25/07/12 09:37, Walter Bright wrote: On 7/24/2012 11:46 PM, Dmitry Olshansky wrote: It's pc => address because one can first preprocess all of byte code doing opcode => address rewrites. But you can't do it unless taking address of labels is possible. All right, that's the piece that was mi

Re: Computed gotos on Reddit

2012-07-25 Thread Don Clugston
On 25/07/12 09:55, Dmitry Olshansky wrote: On 25-Jul-12 11:51, Don Clugston wrote: On 25/07/12 09:37, Walter Bright wrote: On 7/24/2012 11:46 PM, Dmitry Olshansky wrote: It's pc => address because one can first preprocess all of byte code doing opcode => address rewrites. But you

Re: Troubles with immutable arrays

2012-07-25 Thread Don Clugston
On 23/07/12 15:29, bearophile wrote: After a discussion in D.learn started by someone else, after a suggestion of mine Timon Gehr has added a bug report: http://d.puremagic.com/issues/show_bug.cgi?id=8400 But the bug was fixed in the opposite way of what I was thinking. The problem was that th

Re: Computed gotos on Reddit

2012-07-25 Thread Don Clugston
On 25/07/12 12:11, Walter Bright wrote: On 7/25/2012 12:51 AM, Don Clugston wrote: so that there is no lookup table, just a multiply. Rethinking your idea a bit... Suppose the switch jump_address[] array was really an array of hardcoded jmp instructions, 5 bytes each: jmp_table: jmp

Re: Semantics of postfix ops for classes

2012-07-25 Thread Don Clugston
On 20/07/12 17:12, Andrej Mitrovic wrote: According to TDPL postfix operators are rewritten to call prefix operators, e.g. on this call for some user-type object named a: auto b = a++; // is converted to: auto b = ((ref x) { auto t = x; ++x; return t; })(a); But I don't see how this is reasona

Re: Computed gotos on Reddit

2012-07-26 Thread Don Clugston
On 26/07/12 00:46, Walter Bright wrote: On 7/25/2012 2:55 PM, Dmitry Olshansky wrote: std\regex.d(5118): Error: undefined identifier 'L_jumptable' I was afraid of that. You may have to approximate it by loading the address of L_jumptable into a register and adding it in instead of using the a

Re: std.variant benchmark

2012-07-30 Thread Don Clugston
On 30/07/12 13:24, Andrei Alexandrescu wrote: On 7/30/12 4:34 AM, Dmitry Olshansky wrote: On 30-Jul-12 06:01, Andrei Alexandrescu wrote: In fact memcpy could and should be replaced with word by word copy for almost all of struct sizes up to ~32 bytes (as size is known in advance for this partic

Re: One against binary searches

2012-07-30 Thread Don Clugston
On 30/07/12 17:40, bearophile wrote: This author writes very detailed analyses of low-level computational matters, that appear on Reddit. This blog post he suggests to introduce "offseted binary" or "quaternary search" instead of binary search in Phobos: http://www.pvk.ca/Blog/2012/07/30/binary-

Re: Incomprehensible compiler errors

2012-07-31 Thread Don Clugston
On 31/07/12 00:54, Stuart wrote: On Monday, 30 July 2012 at 21:40:35 UTC, Walter Bright wrote: A ModuleInfo is generated for each compiled module and inserted into its corresponding .obj file. If the linker cannot find it, then it is likely that you need to specify that .obj on the link command

Re: build Ldc2 for win xp 32 bit Error

2012-07-31 Thread Don Clugston
On 26/07/12 09:05, Jacob Carlborg wrote: On 2012-07-25 22:39, Rainer Schuetze wrote: What is the state of the missing exception handling for Windows? I just read an old post on the Clang mailing list, it's not looking good. It seems Microsoft (or someone else) has a patent on SEH, I've hear

Re: Which D features to emphasize for academic review article

2012-08-13 Thread Don Clugston
On 12/08/12 01:31, Walter Bright wrote: On 8/11/2012 3:01 PM, F i L wrote: Walter Bright wrote: I'd rather have a 100 easy to find bugs than 1 unnoticed one that went out in the field. That's just the thing, bugs are arguably easier to hunt down when things default to a consistent, usable val

Re: DMD diagnostic - any way to remove identical lines from final dmd error log?

2012-08-14 Thread Don Clugston
On 13/08/12 18:47, Dmitry Olshansky wrote: I seriously consider writing a simple postprocessor for dmd's output. Once dmd became able to recover from errors and crawl on it started to produce horrific amounts of redundant text on failure. Observe for instance that there are only 6 + 2 = 8 lines

Re: Which D features to emphasize for academic review article

2012-08-14 Thread Don Clugston
On 14/08/12 05:03, TJB wrote: On Monday, 13 August 2012 at 10:11:06 UTC, Don Clugston wrote: ... I have come to believe that there are very few algorithms originally designed for integers, which also work correctly for floating point. Integer code nearly always assumes things like, x + 1

Re: DMD diagnostic - any way to remove identical lines from final dmd error log?

2012-08-14 Thread Don Clugston
On 14/08/12 08:59, Don Clugston wrote: On 13/08/12 18:47, Dmitry Olshansky wrote: I seriously consider writing a simple postprocessor for dmd's output. Once dmd became able to recover from errors and crawl on it started to produce horrific amounts of redundant text on failure. Observ

Re: DMD diagnostic - any way to remove identical lines from final dmd error log?

2012-08-14 Thread Don Clugston
On 14/08/12 11:32, Paulo Pinto wrote: On Tuesday, 14 August 2012 at 08:48:14 UTC, Don Clugston wrote: On 14/08/12 08:59, Don Clugston wrote: On 13/08/12 18:47, Dmitry Olshansky wrote: I seriously consider writing a simple postprocessor for dmd's output. Once dmd became able to recover

Re: Which D features to emphasize for academic review article

2012-08-14 Thread Don Clugston
On 14/08/12 12:31, Mehrdad wrote: On Saturday, 11 August 2012 at 05:41:23 UTC, Walter Bright wrote: On 8/10/2012 9:55 PM, F i L wrote: On the first condition, without an 'else z = ...', or if the condition was removed at a later time, then you'll get a compiler error and be forced to explicitly

Re: Ascii matters

2012-08-23 Thread Don Clugston
On 23/08/12 05:05, bearophile wrote: Sean Kelly: I'm clearly missing something. ASCII and UTF-8 are compatible. What's stopping you from just processing these as if they were UTF-8 strings? std.algorithm is not closed (http://en.wikipedia.org/wiki/Closure_%28mathematics%29 ) on UTF-8, its o

Re: More on vectorized comparisons

2012-08-24 Thread Don Clugston
On 24/08/12 00:13, bearophile wrote: Sean Cavanaugh: Well, right now the binary operators == != >= <= > and < are required to return bool instead of allowing a user defined type, which prevents a lot of the sugar you would want to make the code nice to write. The hypothetical D sugar I was lo

Re: default random object?

2009-02-15 Thread Don Clugston
Andrei Alexandrescu wrote: Don wrote: Andrei Alexandrescu wrote: auto rng = Random(unpredictableSeed); auto a = 0.0, b = 1.0; auto x1 = uniform!("[]")(rng, a, b); auto x2 = uniform!("[)")(rng, a, b); auto x3 = uniform!("(]")(rng, a, b); auto x4 = uniform!("()")(rng, a, b); This is a general i

Re: Exception chaining and collectException

2017-08-18 Thread Don Clugston via Digitalmars-d
On Friday, 18 August 2017 at 03:31:38 UTC, Walter Bright wrote: Chained exceptions are a good idea, but are more or less a disaster: 1. No other language does chained exceptions 2. Attempting to hammer D chained exceptions into other language schemes (such as C++) makes for lots of unfun hour

D's SwitchStatement accepts statements with ridiculous semantics

2017-09-29 Thread Don Clugston via Digitalmars-d
Guess what this prints import std.stdio; void main() { int i = 0; switch (i) for (i = 8; i < 10; ++i) { case 7: writeln(i); return; default: ; } } Why does this even compile? It's because the grammar is: SwitchStatement: switch ( Expression ) Sc

Re: D's SwitchStatement accepts statements with ridiculous semantics

2017-09-29 Thread Don Clugston via Digitalmars-d
On Friday, 29 September 2017 at 10:32:02 UTC, Timon Gehr wrote: On 29.09.2017 11:12, Don Clugston wrote: Guess what this prints import std.stdio; void main() {   int i = 0;   switch (i) for (i = 8; i < 10; ++i)   {     case 7:     writeln(i);     return;     defa

<    1   2   3