Re: Short list with things to finish for D2

2009-11-25 Thread Don
aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just using strings. Of course you can define a where clause using strings. (I'm not sure when you'd

Re: Short list with things to finish for D2

2009-11-25 Thread Don
Don wrote: aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just using strings. Of course you can define a where clause using strings. Even today,

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 00:46:39 +0300, Travis Boucher boucher.tra...@gmail.com wrote: Denis Koroskin wrote: On Tue, 24 Nov 2009 14:00:18 +0300, Gerrit Wichert g...@green-stores.de wrote: how about opLimit ? I recall that Visual Basic has UBound function that returns upper bound of a

Re: News/info on Go and Java

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 03:03:59 +0300, bearophile bearophileh...@lycos.com wrote: Found on Reddit: This looks a lot like D: http://research.swtch.com/2009/11/go-data-structures.html New features in Java, some of them look like D: http://code.joejag.com/2009/new-language-features-in-java-7/

Re: News/info on Go and Java

2009-11-25 Thread Andrei Alexandrescu
Denis Koroskin wrote: On Wed, 25 Nov 2009 03:03:59 +0300, bearophile bearophileh...@lycos.com wrote: Found on Reddit: This looks a lot like D: http://research.swtch.com/2009/11/go-data-structures.html New features in Java, some of them look like D:

Re: removal of cruft from D

2009-11-25 Thread Walter Bright
Bill Baxter wrote: version(int) is like a programming language with one variable. It's ridiculous. One variable, and one operator, =. To be fair, it was clearly intended to refer to the version of the final user's app, not a library version or platform version or anything else. But to assume

Re: Design by Contract - most requested Java feature!

2009-11-25 Thread Nick Sabalausky
bearophile bearophileh...@lycos.com wrote in message news:heibbs$1q2...@digitalmars.com... One of the most important ones is to be able to see the number and names of the unit tests that have failed. Shameless plug:

Re: Non-enum manifest constants: Pie in the sky?

2009-11-25 Thread Nick Sabalausky
bearophile bearophileh...@lycos.com wrote in message news:heiaea$1oc...@digitalmars.com... Jason House: IMHO, enum is a patchwork collection of features... manifest constants, enumerated lists, and bitmasks are all conflated into something rather ugly. Manifest constants defined with

Re: removal of cruft from D

2009-11-25 Thread Nick Sabalausky
BCS n...@anon.com wrote in message news:a6268ffd62c8cc3b5a3ae2d...@news.digitalmars.com... Hello KennyTM~, What's the point of using bases other than 2, 8, 10, 16, 36 and 64? Base 13 is useful in literature. Also, base 4 is very useful on Parallax's Propeller microcontroller because it's

Re: Non-enum manifest constants: Pie in the sky?

2009-11-25 Thread bearophile
Nick Sabalausky: rename the current const to readonly (since that's what it *really* is anyway, the current const is nearly as poorly-named as the current enum), and then change enum to const. I like something like that. There's another couple of proposals. Let's see if Walter is willing

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Steven Schveighoffer
Bartosz Milewski Wrote: Steven Schveighoffer Wrote: Bottom line: if a function isn't supposed to change the buffer, the signature should be const for that parameter. It's one of the principles of const, and why it's in D2 in the first place. I'd explain to the coder that he

Re: removal of cruft from D

2009-11-25 Thread Don
Walter Bright wrote: Bill Baxter wrote: version(int) is like a programming language with one variable. It's ridiculous. One variable, and one operator, =. To be fair, it was clearly intended to refer to the version of the final user's app, not a library version or platform version or

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Simen kjaeraas
Steven Schveighoffer schvei...@yahoo.com wrote: You are again resorting to implementation. I guess in the current implementation it's true that the compiler will indeed insert a call to its internal function. But the language spec does not proscribe that. Sure it does. It says that

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 11:42:53 +0300, Don nos...@nospam.com wrote: Don wrote: aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just using strings. Of

Re: Short list with things to finish for D2

2009-11-25 Thread Don
Denis Koroskin wrote: On Wed, 25 Nov 2009 11:42:53 +0300, Don nos...@nospam.com wrote: Don wrote: aarti_pl wrote: Don pisze: Additionally in my framework you can pass around parts of SQL e.g. : WhereExpression exp = Where(More(visitcards.id, 100)); You basically *CAN NOT* do it when just

Re: removal of cruft from D

2009-11-25 Thread Don
Don wrote: Walter Bright wrote: Bill Baxter wrote: version(int) is like a programming language with one variable. It's ridiculous. One variable, and one operator, =. To be fair, it was clearly intended to refer to the version of the final user's app, not a library version or platform

Re: Non-enum manifest constants: Pie in the sky?

2009-11-25 Thread Nick Sabalausky
bearophile bearophileh...@lycos.com wrote in message news:hej7tb$k2...@digitalmars.com... Nick Sabalausky: Another good idea is like yigal said, just improve the optimizer so that any immutables whose value is known at compile-time ends up effectively being treated as a manifest constant.

Re: Non-enum manifest constants: Pie in the sky?

2009-11-25 Thread bearophile
Nick Sabalausky: then attempting to evaluate blahExpression at compile-time (which I believe it already does) and if it succeeds, then treat it as a manifest constant in any place where it's used (except for the places where it's pointer or reference is taken). I think this is not so easy

D compiler layers

2009-11-25 Thread bearophile
(This comes from things that Lindquist has vaguely said, but I am not sure). I am very ignorant about this topic still, so I can be quite wrong, but I think it can be positive to split the D2 front-end in two layers, to simplify the creation of D compilers: 1) A true front-end layer that's

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Steven Schveighoffer
Simen kjaeraas Wrote: Steven Schveighoffer schvei...@yahoo.com wrote: You are again resorting to implementation. I guess in the current implementation it's true that the compiler will indeed insert a call to its internal function. But the language spec does not proscribe that.

Re: Non-enum manifest constants: Pie in the sky?

2009-11-25 Thread Leandro Lucarella
bearophile, el 25 de noviembre a las 07:28 me escribiste: Another good idea is like yigal said, just improve the optimizer so that any immutables whose value is known at compile-time ends up effectively being treated as a manifest constant. Then rip out enum's enum x = 7; syntax and

Re: Non-enum manifest constants: Pie in the sky?

2009-11-25 Thread retard
Wed, 25 Nov 2009 09:29:10 -0500, bearophile wrote: Nick Sabalausky: then attempting to evaluate blahExpression at compile-time (which I believe it already does) and if it succeeds, then treat it as a manifest constant in any place where it's used (except for the places where it's pointer

Re: Short list with things to finish for D2

2009-11-25 Thread Don
Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100 UBound(a, 2) - 5 UBound(a, 3) - 4 Works for single-dimensional arrays, too: Dim b(8) As Byte UBound(b) - 8 I brought a

Re: Short list with things to finish for D2

2009-11-25 Thread Ellery Newcomer
On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100 UBound(a, 2) - 5 UBound(a, 3) - 4 Works for single-dimensional arrays, too: Dim b(8) As Byte

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 21:11:48 +0300, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100

Re: Short list with things to finish for D2

2009-11-25 Thread Denis Koroskin
On Wed, 25 Nov 2009 21:11:48 +0300, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte UBound(a, 1) - 100

Sort enum values, please

2009-11-25 Thread Tomek Sowiñski
Quick one: could the compiler enforce that enum values in order of appearance are sorted? It could neatly guarantee no surprises with case ranges, like this one: enum Weird { One=1, Two=4, Three=3 } Now, case Weird.One: .. case Weird.Three: won't match Weird.Two. I'd agree that you don't see

Re: Short list with things to finish for D2

2009-11-25 Thread Pelle Månsson
Denis Koroskin wrote: On Wed, 25 Nov 2009 21:11:48 +0300, Ellery Newcomer ellery-newco...@utulsa.edu wrote: On 11/25/2009 10:46 AM, Don wrote: Denis Koroskin wrote: I recall that Visual Basic has UBound function that returns upper bound of a multi-dimensional array: Dim a(100, 5, 4) As Byte

Re: Sort enum values, please

2009-11-25 Thread dsimcha
== Quote from Tomek_Sowi�ski (j...@ask.me)'s article Quick one: could the compiler enforce that enum values in order of appearance are sorted? It could neatly guarantee no surprises with case ranges, like this one: enum Weird { One=1, Two=4, Three=3 } Now, case Weird.One: .. case Weird.Three:

Re: removal of cruft from D

2009-11-25 Thread Yigal Chripun
Don wrote: bearophile wrote: Don: There seems to be no point in having a *single* integer value, shared between the app and all libraries! It's just reducing future flexibility. It doesn't reduce flexibility at all, I meant future D flexibility. because if you need something more

D1: Member function delegate issues

2009-11-25 Thread klickverbot
(This would probably fit better on bugzilla, but for whatever reason I cannot access it at the moment. Please feel free to move this to the tracker and CC me if it is really a bug.) As you might remember from #d and d.D.learn, I want to check if a given member function has been overridden (at

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Bartosz Milewski
Steven Schveighoffer Wrote: As long as the spec says changing length may expand the array to hold enough space, the optimizer can't, because the optimization would change the side effects of the function. An optimizer should not change the outcome or side effects of a function. It's not

Re: Sort enum values, please

2009-11-25 Thread Nick Sabalausky
Tomek Sowiñski j...@ask.me wrote in message news:hek1nv$2d6...@digitalmars.com... Quick one: could the compiler enforce that enum values in order of appearance are sorted? It could neatly guarantee no surprises with case ranges, like this one: enum Weird { One=1, Two=4, Three=3 } Now,

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Andrei Alexandrescu
Bartosz Milewski wrote: Steven Schveighoffer Wrote: As long as the spec says changing length may expand the array to hold enough space, the optimizer can't, because the optimization would change the side effects of the function. An optimizer should not change the outcome or side effects of

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Bartosz Milewski
Steven Schveighoffer Wrote: Bartosz Milewski Wrote: Steven Schveighoffer Wrote: Bottom line: if a function isn't supposed to change the buffer, the signature should be const for that parameter. It's one of the principles of const, and why it's in D2 in the first

Re: Sort enum values, please

2009-11-25 Thread Tomek Sowiñski
dsimcha Wrote: Have you ever seen this issue come up in practice in a real program? I'd be hesitant to add even a small amount of complexity and restrictions to a language to prevent some class of bugs that's only a theoretical possibility and almost never occurs in real-world code. It's

Re: Short list with things to finish for D2

2009-11-25 Thread Ellery Newcomer
On 11/25/2009 01:40 PM, Denis Koroskin wrote: IIRC lower bound is 1 by default in VB and therefore b(0) is illegal. Nope. Dim b(8) as String is equivalent to Dim b(0 to 8) as String and therefore b(0) is very legal.

Re: Pure, Nothrow in Generic Programming

2009-11-25 Thread Simen kjaeraas
On Sun, 22 Nov 2009 20:34:21 +0100, dsimcha dsim...@yahoo.com wrote: One issue that should ideally be resolved before D2 is finalized that I meant to bring up here a long time ago is how to handle pure and nothrow in generic functions. For example: T max(T)(T lhs, T rhs) { return (lhs

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Bartosz Milewski
Andrei Alexandrescu Wrote: Bartosz Milewski wrote: Steven Schveighoffer Wrote: As long as the spec says changing length may expand the array to hold enough space, the optimizer can't, because the optimization would change the side effects of the function. An optimizer should not

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Andrei Alexandrescu
Bartosz Milewski wrote: Andrei Alexandrescu Wrote: Bartosz Milewski wrote: Steven Schveighoffer Wrote: As long as the spec says changing length may expand the array to hold enough space, the optimizer can't, because the optimization would change the side effects of the function. An

Re: D compiler layers

2009-11-25 Thread Tim Matthews
bearophile wrote: (This comes from things that Lindquist has vaguely said, but I am not sure). I am very ignorant about this topic still, so I can be quite wrong, but I think it can be positive to split the D2 front-end in two layers, to simplify the creation of D compilers: 1) A true

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Bartosz Milewski
Andrei Alexandrescu Wrote: How about creating a struct Value!T that transforms T (be it an array or a class) into a value type? Then if you use Value!(int[]), you're effectively dealing with values throughout (even though internally they might be COWed). Sometimes I also see a need for

Re: Pure, Nothrow in Generic Programming

2009-11-25 Thread Don
dsimcha wrote: One issue that should ideally be resolved before D2 is finalized that I meant to bring up here a long time ago is how to handle pure and nothrow in generic functions. For example: T max(T)(T lhs, T rhs) { return (lhs rhs) ? lhs : rhs; } Obviously, if T is an int, max can

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Steven Schveighoffer
Bartosz Milewski Wrote: Steven Schveighoffer Wrote: As long as the spec says changing length may expand the array to hold enough space, the optimizer can't, because the optimization would change the side effects of the function. An optimizer should not change the outcome or side

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Steven Schveighoffer
Bartosz Milewski Wrote: The problem here is that the guy is sort of right. Indeed quote() expands the slice before overwriting it and that requires re-allocation to avoid stomping over the original buffer. There is however a boundary case, when the whole buffer matches the pattern. Then

Re: D array expansion and non-deterministic re-allocation

2009-11-25 Thread Andrei Alexandrescu
Bartosz Milewski wrote: Andrei Alexandrescu Wrote: How about creating a struct Value!T that transforms T (be it an array or a class) into a value type? Then if you use Value!(int[]), you're effectively dealing with values throughout (even though internally they might be COWed). Sometimes I

Re: why can't structs implement interfaces?

2009-11-25 Thread Don
bearophile wrote: Bill Baxter: The good thing is that since most of the machinery is there, the actual compiler changes required would mostly be just rewrites of new syntax in terms of existing functionality. I agree, this looks like something that can be added to D even after D2 comes out

Re: why can't structs implement interfaces?

2009-11-25 Thread Lars T. Kyllingstad
Don wrote: bearophile wrote: Bill Baxter: The good thing is that since most of the machinery is there, the actual compiler changes required would mostly be just rewrites of new syntax in terms of existing functionality. I agree, this looks like something that can be added to D even after

Re: why can't structs implement interfaces?

2009-11-25 Thread Rory McGuire
Saaa em...@needmail.com wrote: struct S : Pos {} Why is this not possible? Why do you want to use a struct for that, rather than a class?

Re: reading files from a directory

2009-11-25 Thread Rory McGuire
miriac 1234...@gmail.com wrote: Jesse Phillips Wrote: miriac Wrote: I'm trying to get my program to read all the files in a directory. dmd gives an errer that theis imports dont exist: tango.io.FileSystem, tango.io.FileRoots, Can someone please help me and tell me what i use to

Re: why can't structs implement interfaces?

2009-11-25 Thread bearophile
Don: That's been requested many times. I posted a patch to Walter to do exactly that. It was beautiful. It detected recursive template expansions, and gave really nice error messages. Silently rejected. Sigh. If your patch is well done, works with LDC too, I see no reason to refuse this

Re: why can't structs implement interfaces?

2009-11-25 Thread bearophile
Lars T. Kyllingstad: What's the bugzilla number? Should be upvoted. I think he refers to this one (searching something in Bugzilla seems a good way to spend a morning): http://d.puremagic.com/issues/show_bug.cgi?id=2816 In the comment 9, instead of: bug.d(2): Error: static assert (0) is

Re: why can't structs implement interfaces?

2009-11-25 Thread Don
bearophile wrote: Don: That's been requested many times. I posted a patch to Walter to do exactly that. It was beautiful. It detected recursive template expansions, and gave really nice error messages. Silently rejected. Sigh. If your patch is well done, works with LDC too, I see no reason

Re: why can't structs implement interfaces?

2009-11-25 Thread bearophile
Don: Please don't do that just yet. It's something that can wait until the D2 stuff is finished. It can be added at any time. Some of the other things are urgent. OK :-) You are right, as usual. Bye, bearophile

[Issue 3549] Bypassing initializers with goto -- Is this a bug?

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3549 Matti Niemenmaa matti.niemenmaa+dbugzi...@iki.fi changed: What|Removed |Added Status|NEW

[Issue 602] Compiler allows a goto statement to skip an initalization

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=602 Matti Niemenmaa matti.niemenmaa+dbugzi...@iki.fi changed: What|Removed |Added CC|

Re: [Issue 3549] Bypassing initializers with goto -- Is this a bug?

2009-11-25 Thread Rory McGuire
d-bugm...@puremagic.com wrote: http://d.puremagic.com/issues/show_bug.cgi?id=3549 Don clugd...@yahoo.com.au changed: What|Removed |Added CC|

Re: [Issue 3549] Bypassing initializers with goto -- Is this a bug?

2009-11-25 Thread Don
Rory McGuire wrote: d-bugm...@puremagic.com wrote: http://d.puremagic.com/issues/show_bug.cgi?id=3549 Don clugd...@yahoo.com.au changed: What|Removed |Added CC|

[Issue 3551] New: nested struct = dmd adds a hidden pointer

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3551 Summary: nested struct = dmd adds a hidden pointer Product: D Version: 2.036 Platform: Other OS/Version: All Status: NEW Keywords: wrong-code Severity: regression

[Issue 3551] nested struct = dmd adds a hidden pointer

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3551 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au ---

[Issue 1439] Optlink segfault with long template string arguments

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1439 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 3544] optlink termination 0041338f with recursive nested functions

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3544 Don clugd...@yahoo.com.au changed: What|Removed |Added Summary|optlink unexpected |optlink termination

[Issue 3544] optlink termination 0041338f with recursive nested functions

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3544 --- Comment #9 from Don clugd...@yahoo.com.au 2009-11-25 05:29:15 PST --- Even smaller test case. Seems it happens with a depth around 512; it's probably exceeding the maximum symbol length. --- char[] foo(int n) { return void abcde() { ~ (

[Issue 3523] Fiber is not garbage collected properly

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3523 --- Comment #5 from Witold Baryluk bary...@smp.if.uj.edu.pl 2009-11-25 06:11:41 PST --- Ok, i now i solved it using kind of hack: /** This class is written because Fiber's are not correctly garbage collected */ class GenWrap(T : AGenerator,

[Issue 3552] New: Compile time assertion error with associative arrays of class types

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3552 Summary: Compile time assertion error with associative arrays of class types Product: D Version: 2.036 Platform: x86_64 OS/Version: Windows Status: NEW

[Issue 3552] ICE(mtype.c): associative arrays of class types

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3552 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||ice-on-valid-code

[Issue 3552] Compile time assertion error with associative arrays of class types

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3552 --- Comment #1 from Justin Greenwood justin.greenw...@gmail.com 2009-11-25 07:36:28 PST --- Created an attachment (id=519) The simple example that doesn't fail because I removed the use of the variant module. -- Configure issuemail:

[Issue 3552] ICE(mtype.c): declaring a variable called 'AssociativeArray' then using an AA.

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3552 Don clugd...@yahoo.com.au changed: What|Removed |Added Summary|ICE(mtype.c): associative |ICE(mtype.c): declaring a

[Issue 3552] ICE(mtype.c): declaring a variable called 'AssociativeArray' then using an AA.

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3552 --- Comment #3 from Justin Greenwood justin.greenw...@gmail.com 2009-11-25 19:24:56 PST --- FYI - For anyone that needs to work around this temporarily, just copy the std.variant module to a different module location. Change the module

[Issue 2029] Typesafe variadic functions don't work in CTFE

2009-11-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2029 --- Comment #8 from Don clugd...@yahoo.com.au 2009-11-25 21:23:48 PST --- Thanks, this is helpful. The problem is, that this isn't an isolated bug: the struct constructor bug has the same root cause. I think we need to fix both of them at once.