Re: Array indexing/offset inline asm ambiguity

2013-03-17 Thread Paulo Pinto
On 17.03.2013 07:40, deadalnix wrote: On Sunday, 17 March 2013 at 01:54:27 UTC, Walter Bright wrote: On 3/16/2013 5:24 PM, David Nadlinger wrote: But Walter seems to think this issue not worth addressing: http://d.puremagic.com/issues/show_bug.cgi?id=9738 Not exactly. I felt: The inline asse

Re: Help with a DMD patch

2013-03-17 Thread Vladimir Panteleev
On Sunday, 17 March 2013 at 02:35:30 UTC, Daniel Murphy wrote: "Vladimir Panteleev" wrote in message news:pzqxkiigdvvicqkqa...@forum.dlang.org... I'm trying to cut my teeth on DMD hacking with a simple optimization ( http://d.puremagic.com/issues/show_bug.cgi?id=9477 ), but not having much l

Re: Array indexing/offset inline asm ambiguity

2013-03-17 Thread Tobias Pankrath
On Sunday, 17 March 2013 at 00:24:16 UTC, David Nadlinger wrote: Hi all, Another installment in the »What does the following function return« series: --- int[2] foo() { int[2] regs; asm { mov regs[1], 0xdeadbeef; } return regs; } --- If you answered [0, 0xdeadbeef], then congratu

Bug? NVI functions can't call normal interface functions?

2013-03-17 Thread Johannes Pfau
import core.stdc.stdio; interface Timer { final int run() { printf("Timer.run()\n"); fun(); return 1; }; int fun(); } interface Application { final int run() { printf("Application.run()\n"); fun(); return 2; }; int fun(); } class TimedApp : Timer, Application { int fun() {

Re: Bug? NVI functions can't call normal interface functions?

2013-03-17 Thread Maxim Fomin
Yes, this is a bug. The funny thing here is that instead TimedApp.fun(), object.Object.toString() is called due to shift error in virtual table offset jumping. I guess due to interfaces' ABI a class instance isn't passed properly. Using override string toString() { printf("bz

Re: Bug? NVI functions can't call normal interface functions?

2013-03-17 Thread Maxim Fomin
Actually it was http://d.puremagic.com/issues/show_bug.cgi?id=4589

Re: Any takers for http://d.puremagic.com/issues/show_bug.cgi?id=9673?

2013-03-17 Thread Jacob Carlborg
On 2013-03-12 01:09, Vladimir Panteleev wrote: Oops, it looks like -oq is something ldc-specific. It implements your exact suggestion (creates a.b.c.obj instead of c.obj or a/b/c.obj). http://d.puremagic.com/issues/show_bug.cgi?id=3541 -- /Jacob Carlborg

Re: Any takers for http://d.puremagic.com/issues/show_bug.cgi?id=9673?

2013-03-17 Thread Jacob Carlborg
On 2013-03-10 11:27, Rainer Schuetze wrote: The better option would be to pass all source files to update in one invocation of dmd, so it won't get slower than a full rebuild, but this has been plagued with linker errors in the past (undefined and duplicate symbols). If it works, it could identi

Re: Any takers for http://d.puremagic.com/issues/show_bug.cgi?id=9673?

2013-03-17 Thread Jacob Carlborg
On 2013-03-10 16:44, Vladimir Panteleev wrote: I think this is a serious problem. I hadn't thought of it before, but if we are designing our tools to work around implementation issues in the compiler, I think we're doing something wrong. Rather than meddling with a crippled incremental compilati

Re: Any takers for http://d.puremagic.com/issues/show_bug.cgi?id=9673?

2013-03-17 Thread Andrej Mitrovic
On 3/17/13, Jacob Carlborg wrote: > Search for posts by Tomasz Stachowiak (h3r3tic). He tried to implement > incremental compilation a couple of years ago. https://bitbucket.org/h3r3tic/xfbuild/issue/7/make-incremental-building-reliable

Re: static property without return type

2013-03-17 Thread Andrej Mitrovic
On 3/17/13, Peter Alexander wrote: > auto in D actually just means "I don't want to use any other storage class" >From the user's perspective auto means more: int x; ref refRet() { return x; } // ok ref refRet() { return 1; } // disallowed auto ref autoRet() { return x; } // ok auto ref auto

Re: static property without return type

2013-03-17 Thread Alvaro
On Saturday, 16 March 2013 at 22:34:01 UTC, Michael wrote: Why Dmd accepts? class E { @property public static pro(Object v) { } } My guess is this: If it takes an argument (Object v) I assume it is a *setter*, so it does not need to return anything. Then, the non-written type i

Re: static property without return type

2013-03-17 Thread Artur Skawina
On 03/17/13 19:48, Andrej Mitrovic wrote: > On 3/17/13, Peter Alexander wrote: >> auto in D actually just means "I don't want to use any other storage class" > >>From the user's perspective auto means more: > > int x; > ref refRet() { return x; } // ok > ref refRet() { return 1; } // disallowe

Re: Linq and the like

2013-03-17 Thread Ellery Newcomer
On Tuesday, 5 February 2008 at 06:28:04 UTC, Don Clugston wrote: AFAICT, there's nothing in LINQ that D couldn't (in theory*) do with a library -- today implemented using ctfe and mixins, in future with the front end replaced by macros. IMHO, LINQ is a classic example of something that should

Re: Linq and the like

2013-03-17 Thread Walter Bright
On 2/3/2008 1:07 AM, bearophile wrote: LINQ (and its future parallel extensions), with its additional syntax, may be a good thing to add to D: http://www.moserware.com/2008/02/for-loops-using-i-i-enumerators-or-none.html You can use the same syntax to simplify parallel code, DB access code, etc

Policy on trackers in Bugzilla revisited

2013-03-17 Thread Stewart Gordon
There seems to be disagreement between various users on the propriety of trackers. These are bug reports that don't describe a single bug, nor a feature request, but are used to group together related issues. Trackers (also known as meta bugs or umbrella bugs) are used heavily on Mozilla's ow

Re: Linq and the like

2013-03-17 Thread Vladimir Panteleev
On Sunday, 17 March 2013 at 21:00:32 UTC, Walter Bright wrote: On 2/3/2008 1:07 AM, bearophile wrote: LINQ (and its future parallel extensions), with its additional syntax, may be a good thing to add to D: http://www.moserware.com/2008/02/for-loops-using-i-i-enumerators-or-none.html You can us

Re: static property without return type

2013-03-17 Thread Andrej Mitrovic
On 3/17/13, Artur Skawina wrote: > That's because "auto ref" is a hack. > IOW "auto ref" != "auto" + "ref", just as "static if" != "static" + "if". Both auto and auto ref are documented features, type inference with any storage class is not a documented feature.

Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Peter Williams
The current signatures for opCmp/opEqual mean that code like: bool strictly_ordered(T)(in T[] list) { for (auto j = 1; j < list.length; j++) { if (list[j - 1] >= list[j]) return false; } return true; } will fail to compile if T is a class because opCmp cannot be

Re: Linq and the like

2013-03-17 Thread Walter Bright
On 3/17/2013 2:59 PM, Vladimir Panteleev wrote: On Sunday, 17 March 2013 at 21:00:32 UTC, Walter Bright wrote: On 2/3/2008 1:07 AM, bearophile wrote: LINQ (and its future parallel extensions), with its additional syntax, may be a good thing to add to D: http://www.moserware.com/2008/02/for-loop

Re: Linq and the like

2013-03-17 Thread Kapps
On Sunday, 17 March 2013 at 23:55:07 UTC, Walter Bright wrote: On 3/17/2013 2:59 PM, Vladimir Panteleev wrote: On Sunday, 17 March 2013 at 21:00:32 UTC, Walter Bright wrote: On 2/3/2008 1:07 AM, bearophile wrote: LINQ (and its future parallel extensions), with its additional syntax, may be a

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Timon Gehr
On 03/18/2013 12:19 AM, Peter Williams wrote: The current signatures for opCmp/opEqual mean that code like: bool strictly_ordered(T)(in T[] list) { for (auto j = 1; j < list.length; j++) { if (list[j - 1] >= list[j]) return false; } return true; } will fail

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Timon Gehr
On 03/18/2013 01:16 AM, Timon Gehr wrote: On 03/18/2013 12:19 AM, Peter Williams wrote: The current signatures for opCmp/opEqual mean that code like: bool strictly_ordered(T)(in T[] list) { for (auto j = 1; j < list.length; j++) { if (list[j - 1] >= list[j]) return f

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Jonathan M Davis
On Monday, March 18, 2013 01:20:40 Timon Gehr wrote: > >> So my question is "Why are the arguments to opEquals and opCmp (for > >> Objects) not declared in or const?". > > > > Because not all valid implementations can be. They shouldn't be in > > Object anyway. Yeah. It was agreed that opCmp, opE

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Stewart Gordon
On 17/03/2013 23:19, Peter Williams wrote: So my question is "Why are the arguments to opEquals and opCmp (for Objects) not declared in or const?". Known bug. http://d.puremagic.com/issues/show_bug.cgi?id=1824 This was reported 5 years ago, and it's a serious issue, so I don't know why it's

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Peter Williams
On Monday, 18 March 2013 at 00:46:46 UTC, Stewart Gordon wrote: On 17/03/2013 23:19, Peter Williams wrote: So my question is "Why are the arguments to opEquals and opCmp (for Objects) not declared in or const?". Known bug. http://d.puremagic.com/issues/show_bug.cgi?id=1824 I did look in

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Stewart Gordon
On 18/03/2013 00:34, Jonathan M Davis wrote: On Monday, March 18, 2013 01:20:40 Timon Gehr wrote: So my question is "Why are the arguments to opEquals and opCmp (for Objects) not declared in or const?". Because not all valid implementations can be. They shouldn't be in Object anyway. Yeah. I

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Peter Williams
On Monday, 18 March 2013 at 00:16:17 UTC, Timon Gehr wrote: On 03/18/2013 12:19 AM, Peter Williams wrote: The current signatures for opCmp/opEqual mean that code like: bool strictly_ordered(T)(in T[] list) { for (auto j = 1; j < list.length; j++) { if (list[j - 1] >= list[j])

Raising the bar on Phobos unittest coverage

2013-03-17 Thread Walter Bright
With the new -cov=nnn (not pulled yet) and -main, we can now add to the build process a minimum bar for unit test coverage. The current state looks like this, the percentages are the current coverage amounts. It's not bad, but there's a lot of low hanging fruit ready for pull requests! From

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Jonathan M Davis
On Monday, March 18, 2013 00:53:52 Stewart Gordon wrote: > Why would some class want to implement these methods in a way that alters > the object? Because const in D is physical const, not logical const. So, for instance, const prevents caching. And it's quite possible that a type which really ca

Re: Why are opEquals/opCmp arguments not in or const for Objects?

2013-03-17 Thread Jonathan M Davis
On Monday, March 18, 2013 02:00:37 Peter Williams wrote: > Can't those (rare) implementations just do a non constant cast > when they cast Object to their desired class? No. In D, casting away const on an object and mutating it is undefined behavior. - Jonathan M Davis

Re: Linq and the like

2013-03-17 Thread Ellery Newcomer
On 03/17/2013 05:03 PM, Kapps wrote: As for the implementation of lambdas to generate SQL queries and the like, there was a pull request for a __traits(codeof) that could have been used to do such a thing. Unfortunately, there were issues with it in some fundamental way, and it was scrapped. A _

Re: static property without return type

2013-03-17 Thread Maxim Fomin
On Sunday, 17 March 2013 at 22:11:27 UTC, Andrej Mitrovic wrote: On 3/17/13, Artur Skawina wrote: That's because "auto ref" is a hack. IOW "auto ref" != "auto" + "ref", just as "static if" != "static" + "if". Both auto and auto ref are documented features, type inference with any storage

Re: Additional Binary Operators

2013-03-17 Thread Tony
In article , acehr...@yahoo.com says... > > On 03/01/2013 01:51 PM, Paul D. Anderson wrote: > > > In UTF-8 the "middle dot", ('•', \u00B7) and > > "multiplication sign", ('×', \u00D7) > > [...] > > > UTF-16 has many more mathematical symbols > > Sorry to pick on this unrelated issue but UTF