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

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: 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 Greatest Bugbear

2012-12-18 Thread Don Clugston
Bearophile has just entered his 1000th bug report into Bugzilla. This is more than the three next most prolific contributers, combined. The top ten bug reporters are (courtesy of Deskzilla): 1002 Bearophile 315 Andrej Mitrovic 308 Don Clugston 282 David Simcha 193 Andrei Alexandrescu 185

Re: half datatype?

2012-11-20 Thread Don Clugston
On 18/11/12 12:21, Manu wrote: I've often wondered about having an official 'half' type. It's very common in rendering/image processing, supported by most video cards (so compression routines interacting with this type are common), and it's also supported in hardware by some cpu's. ARM for insta

Re: A simple question

2012-11-16 Thread Don Clugston
On 16/11/12 05:15, Rob T wrote: On Friday, 16 November 2012 at 03:41:45 UTC, Stugol wrote: Event_t e2;// Will compile! Yeah but that kinda blows, doesn't it? I found it surprising or unintuitive that the !() is required, and I do want to know what is the reasoning behind it, One o

Re: What's the deal with __thread?

2012-11-15 Thread Don Clugston
On 15/11/12 11:54, Walter Bright wrote: On 11/15/2012 2:28 AM, Don Clugston wrote: However, there is one case in the test suite which is unclear to me: extern(C) __thread int x; Is there any other way to do this? extern(C) int x; What about extern(C) variables which are not thread local

Re: What's the deal with __thread?

2012-11-15 Thread Don Clugston
On 14/11/12 23:16, Walter Bright wrote: On 11/14/2012 12:06 PM, Sean Kelly wrote: On Nov 14, 2012, at 6:26 AM, Don Clugston wrote: IIRC it was used prior to 2.030. In the spec, it is in the keyword list, and it's also listed in the "Migrating to shared" article. That's al

What's the deal with __thread?

2012-11-14 Thread Don Clugston
IIRC it was used prior to 2.030. In the spec, it is in the keyword list, and it's also listed in the "Migrating to shared" article. That's all. There are a small number of uses of it in the DMD test suite. Is it still valid? Is it useful? Or has everyone forgotten that it still exists?

Re: hashed array?

2012-11-14 Thread Don Clugston
On 12/11/12 20:42, Jonathan M Davis wrote: On Monday, November 12, 2012 11:36:38 H. S. Teoh wrote: I contend that the problem with built-in AA's is their implementation, not the fact that they're built-in. Oh, I agree, but we, as a group, have obviously failed to handle the implementation of t

Re: a small study of "deprecate"

2012-11-08 Thread Don Clugston
On 07/11/12 14:16, monarch_dodra wrote: There is some talk going on right now of changing "deprecate" into a UDA. There are some people saying that deprecate is broken, and proposing some fixes (myself included). Instead of concentrating on how to "fix" it, and like to first study "what" is broke

Re: deprecate deprecated?

2012-11-08 Thread Don Clugston
On 07/11/12 00:56, Walter Bright wrote: I know there's been some long term unhappiness about the deprecated attribute - it's all-or-nothing approach, poor messages, etc. Each change in it changes the language and the compiler. Perhaps it could be done with a user defined attribute instead? Anyo

Re: One old problem with associative arrays

2012-11-07 Thread Don Clugston
On 07/11/12 05:38, H. S. Teoh wrote: On Wed, Nov 07, 2012 at 05:08:43AM +0100, bearophile wrote: [...] So the associative array is updated before taking its length. I suggest to try to fix this AA behavour before too much D2 code relies on this. I'd like to avoid this to become a permanent wart

Re: Simple implementation of __FUNCTION

2012-11-05 Thread Don Clugston
On 06/11/12 07:09, Rob T wrote: On Friday, 2 November 2012 at 22:33:37 UTC, Rob T wrote: I discovered it fails to compile when inside a function with "auto" as the return type. auto test() { throw new Exception( mixin(__FUNCTION) ); return 0; } Error: forward reference to test but this

Re: D is a cool language!

2012-11-05 Thread Don Clugston
On 04/11/12 15:30, stonemaster wrote: On Thursday, 1 November 2012 at 15:56:24 UTC, Tobias Pankrath wrote: On Thursday, 1 November 2012 at 15:20:11 UTC, Andrei Alexandrescu wrote: On 11/1/12 9:47 AM, Paulo Pinto wrote: Hi everyone, I just saw this online. The German magazine c't kompakt has

Re: A little Py Vs C++

2012-11-02 Thread Don Clugston
On 02/11/12 11:57, Jens Mueller wrote: Peter Alexander wrote: On Friday, 2 November 2012 at 10:24:34 UTC, Jens Mueller wrote: Then I have a serious misunderstanding. I thought D introduced array operations to allow the compiler to generate efficient vector operations (in the long run), i.e. gen

Re: To take a part in development

2012-11-02 Thread Don Clugston
On 02/11/12 14:04, Habibutsu wrote: I would like to take a part in development of D programming language or Phobos library. I opened bugtracker and found some bugs that i could to fix. Maybe I should read something (specifically for development) or you can give me some advice before i create firs

Re: A little Py Vs C++

2012-11-02 Thread Don Clugston
On 02/11/12 10:01, Jens Mueller wrote: Jacob Carlborg wrote: On 2012-11-01 23:51, Walter Bright wrote: What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've g

Re: A little Py Vs C++

2012-11-02 Thread Don Clugston
On 02/11/12 10:12, Jens Mueller wrote: Don Clugston wrote: On 02/11/12 09:07, Jacob Carlborg wrote: On 2012-11-01 23:51, Walter Bright wrote: What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's req

Re: A little Py Vs C++

2012-11-02 Thread Don Clugston
On 02/11/12 09:07, Jacob Carlborg wrote: On 2012-11-01 23:51, Walter Bright wrote: What about all your feature requests? I think you've made more than anyone, by a factor of 10 at least! :-) As for Manu's request http://d.puremagic.com/issues/show_bug.cgi?id=8108 I've gone over with him why

Re: assert(false, "...") doesn't terminate program?!

2012-10-30 Thread Don Clugston
On 29/10/12 18:38, Walter Bright wrote: On 10/29/2012 7:51 AM, Don Clugston wrote:> On 27/10/12 20:39, H. S. Teoh wrote: >> On Sat, Oct 27, 2012 at 08:26:21PM +0200, Andrej Mitrovic wrote: >>> On 10/27/12, H. S. Teoh wrote: >>>> writeln(&

Re: assert(false, "...") doesn't terminate program?!

2012-10-29 Thread Don Clugston
On 27/10/12 20:39, H. S. Teoh wrote: On Sat, Oct 27, 2012 at 08:26:21PM +0200, Andrej Mitrovic wrote: On 10/27/12, H. S. Teoh wrote: writeln("how did the assert not trigger??!!"); // how did we get here?! Maybe related to -release? [...] Haha, you're right, the assert is com

Re: Another day in the ordeal of cartesianProduct

2012-10-29 Thread Don Clugston
On 27/10/12 00:45, H. S. Teoh wrote: http://d.puremagic.com/issues/show_bug.cgi?id=8900 :-( (The code there is called cartesianProd but it's the reduced code, so it doesn't really compute the cartesian product. But that's where it's from.) So far, the outstanding blockers for cartesianProduct

Re: Very simple SIMD programming

2012-10-24 Thread Don Clugston
On 24/10/12 11:33, Timon Gehr wrote: On 10/24/2012 11:24 AM, Don Clugston wrote: On 24/10/12 04:41, bearophile wrote: I have found a nice paper, "Extending a C-like Language for Portable SIMD Programming", (2012), by Roland L., Sebastian Hack and Ingo Wald: http://www.cdl.uni-s

Re: [proposal] version statements with multiple arguments.

2012-10-24 Thread Don Clugston
On 23/10/12 05:17, 1100110 wrote: Looking at std.io (hopefully the right version maybe?) I see this: version(OSX) { do something; } version(Windows) { do the same thing as above; } version(FreeBSD) { ditto; } version(Linux) {finally do something different; } and: version(Windows)

Re: Very simple SIMD programming

2012-10-24 Thread Don Clugston
On 24/10/12 04:41, bearophile wrote: I have found a nice paper, "Extending a C-like Language for Portable SIMD Programming", (2012), by Roland L., Sebastian Hack and Ingo Wald: http://www.cdl.uni-saarland.de/projects/vecimp/vecimp_tr.pdf They present a simple scalar program in C: struct dat

Re: D seems interesting, but...

2012-10-22 Thread Don Clugston
On 15/10/12 13:39, Jacob Carlborg wrote: On 2012-10-15 11:58, Don Clugston wrote: I tried that on both Windows and Ubuntu, and couldn't get it to work on either of them. I posted a couple of bug reports eight months ago, and they still haven't been fixed. Not recommended for any

Re: How mutable is immutable?

2012-10-22 Thread Don Clugston
On 18/10/12 19:43, Timon Gehr wrote: On 10/18/2012 10:08 AM, Don Clugston wrote: On 17/10/12 18:02, Timon Gehr wrote: On 10/17/2012 01:49 PM, Don Clugston wrote: ... That's the point -- *which* checks are missing from @safe? Escaping stack data and arbitrarily freeing memory ar

Re: Regarding hex strings

2012-10-19 Thread Don Clugston
On 19/10/12 16:07, foobar wrote: On Friday, 19 October 2012 at 13:19:09 UTC, Don Clugston wrote: We can still have both (assuming the code points are valid...): string foo = "\ua1\ub2\uc3"; // no .dup That doesn't compile. Error: escape hex sequence has 2 hex digits instead

Re: Regarding hex strings

2012-10-19 Thread Don Clugston
On 18/10/12 17:43, foobar wrote: On Thursday, 18 October 2012 at 14:29:57 UTC, Don Clugston wrote: On 18/10/12 10:58, foobar wrote: On Thursday, 18 October 2012 at 02:47:42 UTC, H. S. Teoh wrote: On Thu, Oct 18, 2012 at 02:45:10AM +0200, bearophile wrote: [...] hex strings are useful, but I

Re: Regarding hex strings

2012-10-18 Thread Don Clugston
On 18/10/12 10:58, foobar wrote: On Thursday, 18 October 2012 at 02:47:42 UTC, H. S. Teoh wrote: On Thu, Oct 18, 2012 at 02:45:10AM +0200, bearophile wrote: [...] hex strings are useful, but I think they were invented in D1 when strings were convertible to char[]. But today they are an array of

Re: Bits rotations

2012-10-18 Thread Don Clugston
On 18/10/12 11:39, Iain Buclaw wrote: On 18 October 2012 09:27, bearophile wrote: Iain Buclaw: In the gdc-4.6 package you have there, it's only naked asm that can't be inlined. Good. However it is worth noting that DIASM is no longer in mainline gdc. What's DIASM? Is it the D synta

Re: How mutable is immutable?

2012-10-18 Thread Don Clugston
On 17/10/12 18:02, Timon Gehr wrote: On 10/17/2012 01:49 PM, Don Clugston wrote: On 01/01/12 13:50, Timon Gehr wrote: On 01/01/2012 10:40 AM, Denis Shelomovskij wrote: So, I'm a function `f`, I have an `immutable(type)[]` argument and I want to store it for my friend `g` in an TLS variab

Re: Tricky semantics of ranges & potentially numerous Phobos bugs

2012-10-18 Thread Don Clugston
On 17/10/12 23:41, H. S. Teoh wrote: On Wed, Oct 17, 2012 at 12:55:56PM -0700, Jonathan M Davis wrote: [...] I'm increasingly convinced that input ranges which are not forward ranges are useless for pretty much anything other than foreach. Far too much requires that you be able to save the curre

Re: How mutable is immutable?

2012-10-17 Thread Don Clugston
On 01/01/12 13:50, Timon Gehr wrote: On 01/01/2012 10:40 AM, Denis Shelomovskij wrote: So, I'm a function `f`, I have an `immutable(type)[]` argument and I want to store it for my friend `g` in an TLS variable `v`: --- string v; debug string sure; void f(string s) { v = s; debug sure = s.idup;

Re: alias A = B; syntax

2012-10-16 Thread Don Clugston
On 16/10/12 05:18, Nick Sabalausky wrote: On Tue, 16 Oct 2012 05:00:56 +0200 "stas" wrote: For me syntax alias int Int; seems unnatural. I'd love to write alias Int = int; alias fptr = void(int)*; This looks much more readable for me and harmonized with int x = 0; template T(alias A = Object)

Re: D seems interesting, but...

2012-10-15 Thread Don Clugston
On 15/10/12 11:14, Jacob Carlborg wrote: Just use DVM, it's also cross-platform: https://bitbucket.org/doob/dvm I tried that on both Windows and Ubuntu, and couldn't get it to work on either of them. I posted a couple of bug reports eight months ago, and they still haven't been fixed. Not re

Re: D seems interesting, but...

2012-10-15 Thread Don Clugston
On 15/10/12 06:42, Jonathan M Davis wrote: On Sunday, October 14, 2012 21:39:42 H. S. Teoh wrote: This looks like what happens if you try to use the latest dmd release with an old version of Phobos, perhaps installed along with gdc. Whoever's doing the .deb packaging really should add a version

Re: Error messages for newbies survey

2012-10-10 Thread Don Clugston
On 10/10/12 14:09, bearophile wrote: From Reddit, a nice survey: http://www.reddit.com/r/coding/comments/118ssp/honours_student_at_my_university_is_doing_a/ For my Computer Science Honours research project, I am currently investigating ways of improving the terse, technical error messages g

Re: What is the case against a struct post-blit default constructor?

2012-10-10 Thread Don Clugston
On 10/10/12 13:27, Timon Gehr wrote: On 10/10/2012 12:45 PM, Don Clugston wrote: On 10/10/12 11:21, Jonathan M Davis wrote: On Monday, October 08, 2012 18:47:43 Malte Skarupke wrote: So I really can't think of a reason for why you wouldn't want this. Yet this discussion has happen

Re: What is the case against a struct post-blit default constructor?

2012-10-10 Thread Don Clugston
On 10/10/12 11:21, Jonathan M Davis wrote: On Monday, October 08, 2012 18:47:43 Malte Skarupke wrote: So I really can't think of a reason for why you wouldn't want this. Yet this discussion has happened several times already. There is clear demand for it and very good reasons, such as those ment

Re: next_permutation and cartesian product for ranges?

2012-10-10 Thread Don Clugston
On 10/10/12 00:22, bearophile wrote: Steven Schveighoffer: Is there any advantage over having a function? I'd think you could easily build a range based on the function, no? Generators (that yield lexicographic permutations, permutation swaps, combinations, etc) are quite more handy, you can

Re: Feature request: extending comma operator's functionality

2012-10-08 Thread Don Clugston
On 05/10/12 18:58, H. S. Teoh wrote: On Fri, Oct 05, 2012 at 05:23:40PM +0200, Don Clugston wrote: [...] My feeling is that do{}while() is a fairly useless concept, and this is part of the reason. In my experience genuine do-while loops are extremely rare, and it only takes a slight change to

Re: Feature request: extending comma operator's functionality

2012-10-05 Thread Don Clugston
On 05/10/12 15:35, monarch_dodra wrote: On Friday, 5 October 2012 at 00:22:04 UTC, Jonathan M Davis wrote: On Friday, October 05, 2012 02:08:14 bearophile wrote: [SNIP] Regarding definition of variables in D language constructs, there is one situation where sometimes I find D not handy. This co

Re: Proposal: clean up semantics of array literals vs string literals

2012-10-04 Thread Don Clugston
On 02/10/12 17:14, Andrei Alexandrescu wrote: On 10/2/12 7:11 AM, Don Clugston wrote: The problem --- String literals in D are a little bit magical; they have a trailing \0. [snip] I don't mean to be Debbie Downer on this because I reckon it addresses an issue that some

Re: Proposal: clean up semantics of array literals vs string literals

2012-10-02 Thread Don Clugston
On 02/10/12 13:18, Tobias Pankrath wrote: On Tuesday, 2 October 2012 at 11:10:46 UTC, Don Clugston wrote: The problem --- String literals in D are a little bit magical; they have a trailing \0. This means that is possible to write, printf("Hello, World!\n"); without i

Re: Proposal: clean up semantics of array literals vs string literals

2012-10-02 Thread Don Clugston
On 02/10/12 13:26, deadalnix wrote: Well the whole mess come from the fact that D conflate C string and D string. The first problem come from the fact that D array are implicitly convertible to pointer. So calling D function that expect a char* is possible with D string even if it is unsafe and

Re: Proposal: clean up semantics of array literals vs string literals

2012-10-02 Thread Don Clugston
On 02/10/12 14:02, Andrej Mitrovic wrote: On 10/2/12, Don Clugston wrote: A proposal to clean up this mess Any compile-time value of type immutable(char)[] or const(char)[], behaves a string literals currently do, and will have a \0 appended when it is stored

Proposal: clean up semantics of array literals vs string literals

2012-10-02 Thread Don Clugston
The problem --- String literals in D are a little bit magical; they have a trailing \0. This means that is possible to write, printf("Hello, World!\n"); without including a trailing \0. This is important for compatibility with C. This trailing \0 is mentioned in the spec but only inc

Re: __ctfe

2012-10-02 Thread Don Clugston
On 01/10/12 21:30, Adam D. Ruppe wrote: On Monday, 1 October 2012 at 19:22:37 UTC, Philippe Sigaud wrote: Something I wanted to ask for a long time: is there any runtime speed penalty in using __ctfe? No. What happens is when it goes to the compile the runtime code, __ctfe is a constant false,

Re: It seems pure ain't so pure after all

2012-10-02 Thread Don Clugston
On 01/10/12 07:40, Tommi wrote: import std.stdio; int pow2(int val) pure { if (__ctfe) return 6; else return val * val; } void main() { assert(pow2(3) == 9); static assert(pow2(3) == 6); writeln("9 = 6 ... I knew it! '6' was faking it all along

Re: std.math.frexp wrong on ARM

2012-09-26 Thread Don Clugston
On 26/09/12 17:13, Johannes Pfau wrote: The frexp test fails on ARM. I think the mask in line 1491 is wrong: https://github.com/D-Programming-Language/phobos/blob/master/std/math.d#L1491 For doubles, the 63 bit is sign, 62-52 are exponent and 51-0 are mantissa. The mask manipulates the bits 63-4

Re: Should this be flagged as a warning?

2012-09-26 Thread Don Clugston
On 26/09/12 14:19, Timon Gehr wrote: On 09/26/2012 11:45 AM, Don Clugston wrote: On 25/09/12 21:30, Bernard Helyer wrote: I tried to post this last night, but the NG wasn't having any of it. I found myself writing a bug that looked like this match(ts, TokenType.Is); mat

Re: Order of evaluation - aka hidden undefined behaviours.

2012-09-26 Thread Don Clugston
On 26/09/12 01:31, H. S. Teoh wrote: On Wed, Sep 26, 2012 at 01:10:00AM +0200, Timon Gehr wrote: On 09/26/2012 12:58 AM, Iain Buclaw wrote: [...] string abc; float[] A() { abc ~= "A"; return []; } float[] B() { abc ~= "B"; return []; } float[] C() { abc ~= "C";

Re: Should this be flagged as a warning?

2012-09-26 Thread Don Clugston
On 25/09/12 21:30, Bernard Helyer wrote: I tried to post this last night, but the NG wasn't having any of it. I found myself writing a bug that looked like this match(ts, TokenType.Is); match(ts, TokenType.OpenParen); isExp.type == parseType(ts); The bug being of course, that a

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-25 Thread Don Clugston
On 24/09/12 17:19, Andrei Alexandrescu wrote: On 9/24/12 4:17 AM, Don Clugston wrote: Regarding the comma operator: I'd love to deprecate it, but even if we don't, could we at least ensure that this kind of rubbish doesn't compile: void main() { int x; x > 0, x += 5; } A

Re: DIP19: Remove comma operator from D and provision better syntactic support for tuples

2012-09-24 Thread Don Clugston
On 23/09/12 22:40, Andrei Alexandrescu wrote: I discussed this with Walter, and we concluded that we could deprecate the comma operator if it helps tuples. So I started with this: http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP19 Unfortunately, I started much cockier than I ended.

Re: no-arg constructor for structs (again)

2012-09-20 Thread Don Clugston
On 20/09/12 11:09, Jonathan M Davis wrote: On Thursday, September 20, 2012 10:11:41 Felix Hufnagel wrote: On Thursday, 20 September 2012 at 00:14:04 UTC, Jonathan M Davis wrote: On Thursday, September 20, 2012 00:12:04 Felix Hufnagel wrote: isn't it even worse? import std.stdio; struct S { i

Re: built-in array ptrEnd

2012-09-18 Thread Don Clugston
On 17/09/12 18:40, bearophile wrote: monarch_dodra: IMO, this should really be built-in, in particular, since, in my understanding, an array is internally represented by the ptr and ptrEnd pair anyways. Currently this is not true, take a look at the ABI part in the D site. Currently it's a po

Re: [OT] Was: totally satisfied :D

2012-09-18 Thread Don Clugston
On 18/09/12 09:29, Walter Bright wrote: I suppose I have a more pragmatic view, due to my background in non-computer engineering. It's all like that. There are a couple of good reasons for that. 1. Not every engineer is a rock star. In fact, very few of them are. I tend to snicker at comp

Re: About default parameters in variadic templates

2012-09-17 Thread Don Clugston
On 17/09/12 14:42, Andrej Mitrovic wrote: Related: http://d.puremagic.com/issues/show_bug.cgi?id=8676 A lot of code could be stripped if there was a way to set an optional last parameter for variadics. lockstep could then be written as: auto newLockstep(Args...)(Args args, StoppingPolicy stop

Re: Struct problems

2012-09-17 Thread Don Clugston
On 17/09/12 20:47, Maxim Fomin wrote: I consider current struct creation one of the confusing parts of the language (may be the most), due to set of incompatible creation semantics masked by same syntax, complicated by couple of semi-bugs (7210, 1310, 4053) and naive default arguments embedding i

Re: LDC

2012-09-13 Thread Don Clugston
On 05/09/12 20:12, Jacob Carlborg wrote: On 2012-09-05 14:32, Piotr Szturmaj wrote: angel wrote: Check out LDC web-page ... In github we see they're up to date - merging 2.060 What's the status of SEH on Windows? It's not looking good, at least not for 32bit. Borland has some kind of patent

Re: Trouble creating a formatted assert wrapper

2012-09-04 Thread Don Clugston
On 04/09/12 11:43, Chris Nicholson-Sauls wrote: On Tuesday, 4 September 2012 at 09:24:26 UTC, Don Clugston wrote: On 03/09/12 23:48, Chris Nicholson-Sauls wrote: I reiterate my impression that magical __FILE__ and __LINE__ should be provided by some other means. It was a special-case hack to

Re: Trouble creating a formatted assert wrapper

2012-09-04 Thread Don Clugston
On 03/09/12 23:48, Chris Nicholson-Sauls wrote: On Monday, 3 September 2012 at 11:17:39 UTC, Chris Nicholson-Sauls wrote: 1) Empty array stands in for empty variadic. [snip] In reality, though, we have neither of these things. [snip] Turns out, I was quite wrong, and I'm happy to be. Empty a

Re: Can DMD be built with g++?

2012-09-04 Thread Don Clugston
On 30/08/12 22:21, Andrej Mitrovic wrote: On 8/30/12, Alex Rønne Petersen wrote: How are you building, what platform, etc... Ah geez I forgot there's a makefile (doh!), I need to look into passing the right flags first. I'm trying this on win32 via MinGW btw. That's a different story. Dunn

Re: alias this

2012-09-03 Thread Don Clugston
On 01/09/12 15:16, Carl Sturtivant wrote: What is the design logic behind 364.d(9): Error: alias this compileme364.number.__anonymous there can be only one alias this --- not a complaint, I'd just like to hear opinion of the basis of the above restriction from experts. This is a limitation in

Re: handful and interval

2012-09-03 Thread Don Clugston
On 02/09/12 22:42, SomeDude wrote: On Sunday, 2 September 2012 at 15:09:50 UTC, deadalnix wrote: Le 02/09/2012 16:51, Jacob Carlborg a écrit : I really don't like the name "handful". What would be the difference compared to a regular set container? To me it sounds like we should have a standard

Re: Function pointers/delegates default args were stealth removed?

2012-08-28 Thread Don Clugston
On 27/08/12 16:16, Steven Schveighoffer wrote: On Sun, 26 Aug 2012 18:26:40 -0400, Manu wrote: I just updated to 2.60 and found errors throughout my code where function pointers default args no longer work. *Every single project* I've written in D, 5 projects, don't work anymore, including my

Re: More on vectorized comparisons

2012-08-27 Thread Don Clugston
On 24/08/12 15:57, bearophile wrote: It's just syntax sugar for a very obscure operation,< It's an operation included in Cilk Plus, I think Intel devs know enough what they are doing. And I think code like this is a common need: if (a[] > 0) { // ... } and it's somewhat ambiguous -- is

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

  1   2   3   >