Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Jerome BENOIT
On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33:25 Jerome BENOIT wrote: And I cannot figure why :-( http://d.puremagic.com/issues/show_bug.cgi?id=1528 As a workaround, templatize the last function by changing its signature to int[] find()(int[] longer,

Re: Pure functions and delegates

2012-01-18 Thread Timon Gehr
On 01/18/2012 04:40 AM, H. S. Teoh wrote: So, I was quite impressed with D's pureness system, and was experimenting a bit with it. Then I discovered that delegates are impure, which seems reasonable since there's no way to know what a delegate might do. But *if* the compiler verifies that a

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Timon Gehr
On 01/18/2012 02:32 PM, Jerome BENOIT wrote: On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33:25 Jerome BENOIT wrote: And I cannot figure why :-( http://d.puremagic.com/issues/show_bug.cgi?id=1528 As a workaround, templatize the last function by changing its

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Timon Gehr
On 01/18/2012 04:57 PM, Timon Gehr wrote: On 01/18/2012 02:32 PM, Jerome BENOIT wrote: On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33:25 Jerome BENOIT wrote: And I cannot figure why :-( http://d.puremagic.com/issues/show_bug.cgi?id=1528 As a workaround,

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Jerome BENOIT
On 18/01/12 17:07, Timon Gehr wrote: On 01/18/2012 04:57 PM, Timon Gehr wrote: On 01/18/2012 02:32 PM, Jerome BENOIT wrote: On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33:25 Jerome BENOIT wrote: And I cannot figure why :-(

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Timon Gehr
On 01/18/2012 05:40 PM, Jerome BENOIT wrote: On 18/01/12 17:07, Timon Gehr wrote: On 01/18/2012 04:57 PM, Timon Gehr wrote: On 01/18/2012 02:32 PM, Jerome BENOIT wrote: On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012 02:33:25 Jerome BENOIT wrote: And I cannot

strings and endianness

2012-01-18 Thread Johannes Pfau
I'm currently finishing std.uuid (see http://prowiki.org/wiki4d/wiki.cgi?ReviewQueue ). For name based hashes, a name string is passed to a hash function and I need to make sure that the resulting hash is the same on both little endian and big endian systems. So what's needed to convert a

Re: strings and endianness

2012-01-18 Thread Jonathan M Davis
On Wednesday, January 18, 2012 20:40:33 Johannes Pfau wrote: I'm currently finishing std.uuid (see http://prowiki.org/wiki4d/wiki.cgi?ReviewQueue ). For name based hashes, a name string is passed to a hash function and I need to make sure that the resulting hash is the same on both little

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Jerome BENOIT
On 18/01/12 18:05, Timon Gehr wrote: On 01/18/2012 05:40 PM, Jerome BENOIT wrote: On 18/01/12 17:07, Timon Gehr wrote: On 01/18/2012 04:57 PM, Timon Gehr wrote: On 01/18/2012 02:32 PM, Jerome BENOIT wrote: On 18/01/12 04:36, Jonathan M Davis wrote: On Wednesday, January 18, 2012

Re: strings and endianness

2012-01-18 Thread Johannes Pfau
Jonathan M Davis wrote: On Wednesday, January 18, 2012 20:40:33 Johannes Pfau wrote: I'm currently finishing std.uuid (see http://prowiki.org/wiki4d/wiki.cgi?ReviewQueue ). For name based hashes, a name string is passed to a hash function and I need to make sure that the resulting hash is

Re: lambda template literals?

2012-01-18 Thread Philippe Sigaud
On Wed, Jan 18, 2012 at 02:06, bearophile bearophileh...@lycos.com wrote: template ID(alias a){alias a ID;} void main(){      alias ID!(x = x ^^ 2) sqrTemplate; } Thank you Timon, you are often good :-) I'll add it as enhancement request. This limitation (not being able to alias a lambda)

Re: tdpl: partial ordering of functions: conflict error

2012-01-18 Thread Jonathan M Davis
On Wednesday, January 18, 2012 21:35:44 Jerome BENOIT wrote: Thanks for the precision. So I will move to the next section and come back to this part when the compiler is fix: I guess it will be fixed for the next release as it sounds as an important bug. I don't know. It's been a bug for a

Re: strings and endianness

2012-01-18 Thread Jonathan M Davis
On Wednesday, January 18, 2012 21:42:51 Johannes Pfau wrote: Jonathan M Davis wrote: Section 4.1.2. indeed says that it uses big endian. However, I should still be able to use a ubyte[16] representation and just make sure that those bytes are equal to the big endian representation. Thinking

Re: lambda template literals?

2012-01-18 Thread bearophile
Philippe Sigaud: This limitation (not being able to alias a lambda) is quite irksome. If you do an enhancement request, could you also add one for: alias __traits(whatever, whatever) some Result; Right now, the alias grammar doesn't allow this and I find this limitation jarring. It's

Re: Could assertThrown be made safe/trusted?

2012-01-18 Thread bearophile
H. S. Teoh: But since this is apparently not yet implemented, just what *is* implemented currently when you specify 'pure'? Common subexpression factorization? Hoisting? Not (yet) memoization, apparently. Common subexpression factorization for strongly pure functions that return integral