Re: Unit tests in D

2010-05-06 Thread bearophile
Don: I didn't mean to put my words in your mouth, sorry. I'll try to be more careful. >Also an attribute is a terrible way to implement almost anything -- you need a >really good reason to add a new attribute.< You have noticed that some of the things I have proposed in the last months use att

Re: Unit tests in D

2010-05-06 Thread Leandro Lucarella
Michel Fortin, el 5 de mayo a las 22:12 me escribiste: > On 2010-05-05 21:12:47 -0400, Walter Bright said: > > >Michel Fortin wrote: > >>If even Walter has difficulty figuring out the ! around __traits, > > > >Missing a ! is always a problem. People even do not see the word "not". > > It was an

Re: Unit tests in D

2010-05-06 Thread Don
bearophile wrote: Don: I didn't mean to put my words in your mouth, sorry. I'll try to be more careful. Also an attribute is a terrible way to implement almost anything -- you need a really good reason to add a new attribute.< You have noticed that some of the things I have proposed in the

Re: Unit tests in D

2010-05-06 Thread BCS
Hello Don, My point could be solved with some level of run-time reflection. Or perhaps by allowing unittest{} as a (static) interface member. Might something ad-hoc like this work? interface Foo { ... } class TestFoo(T) if(is(T : Foo)) { unittest { } } -- ... <

Re: // Function parameters, sound, clear and clean //

2010-05-06 Thread Jesse Phillips
Robert Jacques wrote: > On Wed, 05 May 2010 13:10:07 -0400, Jesse Phillips > wrote: >> Robert Jacques Wrote: >> >>> On Tue, 04 May 2010 16:51:57 -0400, Rick Trelles >>> >>> wrote: >>> [snip] >>> >>> I'd recommend reading the D language documentation on the Digital Mars >>> website. >> >> Rob

Re: Unit tests in D

2010-05-06 Thread bearophile
Leandro Lucarella: > Please, remove the leading __ from features that are standard (as oposed > from implementation extensions). I appreciate Walter's decision to use those __names: it allows us to use and try a feature now, it allows to create its implementation progressively, and gives time t

Re: Unit tests in D

2010-05-06 Thread Leandro Lucarella
bearophile, el 6 de mayo a las 12:43 me escribiste: > Leandro Lucarella: > > Please, remove the leading __ from features that are standard (as oposed > > from implementation extensions). > > I appreciate Walter's decision to use those __names: it allows us to use > and try a feature now, it allo

Re: Is [] mandatory for array operations?

2010-05-06 Thread Kagamin
Don Wrote: > Two questions. (1) What happens with functions? For example: > x[] = sin(y[]); > OR > x[] = sin(y[])[]; > Array op is effectively a statement-wide operation (it can be even deemed as a statement itself), braces are the hint which arrays are iterated. Since sin's result is not an ar

Re: Is [] mandatory for array operations?

2010-05-06 Thread bearophile
Kagamin: >Since sin's result is not an array,< I am not sure, but I presume here Don was talking about a dispatch of the sin to all items of an array, so its result is another (new or mutated in place) array. Bye, bearophile

Re: Is [] mandatory for array operations?

2010-05-06 Thread Robert Jacques
On Thu, 06 May 2010 14:40:17 -0400, bearophile wrote: Kagamin: Since sin's result is not an array,< I am not sure, but I presume here Don was talking about a dispatch of the sin to all items of an array, so its result is another (new or mutated in place) array. Bye, bearophile That

Re: Improving Compiler Error Messages

2010-05-06 Thread Jonathan M Davis
Walter Bright wrote: > Nick Sabalausky wrote: >> I'm also another person that finds semicolons magically appearing at the >> end of statements...even when I use a language that doesn't allow them ;) > > It's funny how that works. I was once asked what the key command was for a > particular operat

Re: Is [] mandatory for array operations?

2010-05-06 Thread Johan Granberg
Robert Jacques wrote: > On Thu, 06 May 2010 14:40:17 -0400, bearophile > wrote: >> Kagamin: >>> Since sin's result is not an array,< >> >> I am not sure, but I presume here Don was talking about a dispatch of >> the sin to all items of an array, so its result is another (new or >> mutated in plac

Re: Is [] mandatory for array operations?

2010-05-06 Thread Don
Robert Jacques wrote: On Thu, 06 May 2010 14:40:17 -0400, bearophile wrote: Kagamin: Since sin's result is not an array,< I am not sure, but I presume here Don was talking about a dispatch of the sin to all items of an array, so its result is another (new or mutated in place) array. Bye,

Re: Is [] mandatory for array operations?

2010-05-06 Thread bearophile
Johan Granberg: > Matlab is doing > this in a very nice way and it is far from all uses that requiers optimal > speed. Some parts of the Chapel language are exceptionally well designed, and deserve to be stolen. For numerical computations it looks far better than Fortress. Bye, bearophile

Re: Is [] mandatory for array operations?

2010-05-06 Thread Robert Jacques
On Thu, 06 May 2010 16:48:30 -0400, Don wrote: Robert Jacques wrote: On Thu, 06 May 2010 14:40:17 -0400, bearophile wrote: Kagamin: Since sin's result is not an array,< I am not sure, but I presume here Don was talking about a dispatch of the sin to all items of an array, so its result

Re: Is [] mandatory for array operations?

2010-05-06 Thread Robert Jacques
On Thu, 06 May 2010 16:54:48 -0400, bearophile wrote: Johan Granberg: Matlab is doing this in a very nice way and it is far from all uses that requiers optimal speed. Some parts of the Chapel language are exceptionally well designed, and deserve to be stolen. For numerical computations

Re: Is [] mandatory for array operations?

2010-05-06 Thread bearophile
Robert Jacques: > Do you have some specific examples in mind? I have tons of specific examples in mind :-) I have written some things here, and I'd like to write one more time about this: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=87311 http://www.digita

envy for "Writing Go Packages"

2010-05-06 Thread Graham Fawcett
A screencast overview of the Go package model (writing, publishing, downloading, and installing third-party code): http://www.youtube.com/watch?v=jDWBJOXs_iI Simple and well conceived! I would like this for D please (and am willing to help :)). DSSS covers similar ground, but appears to be mo

Re: envy for "Writing Go Packages"

2010-05-06 Thread Walter Bright
Graham Fawcett wrote: Simple and well conceived! I would like this for D please (and am willing to help :)). Any help in this direction will be most appreciated.

Re: Is [] mandatory for array operations?

2010-05-06 Thread Jason House
Don Wrote: > Walter Bright wrote: > > Don wrote: > >> Walter Bright wrote: > >>> Don wrote: > There are several compiler bugs relating to array operations, and > almost all relate to this issue. I'd like to fix them, but I need to > know which way it is supposed to work. > >>> > >

Re: Is [] mandatory for array operations?

2010-05-06 Thread Robert Jacques
On Thu, 06 May 2010 19:02:03 -0400, Jason House wrote: Don Wrote: Walter Bright wrote: > Don wrote: >> Walter Bright wrote: >>> Don wrote: There are several compiler bugs relating to array operations, and almost all relate to this issue. I'd like to fix them, but I need to

Re: Is [] mandatory for array operations?

2010-05-06 Thread Michel Fortin
On 2010-05-06 19:02:03 -0400, Jason House said: Don Wrote: x[] = sin(y[]); I strongly favor the first syntax since it matches how I'd write it in a for loop. i.e. I'd replace [] with [i]. This is the best way to see array operations I've read up to now: replace [] with [i], i being th

Re: Is [] mandatory for array operations?

2010-05-06 Thread Robert Jacques
On Thu, 06 May 2010 20:57:07 -0400, Michel Fortin wrote: On 2010-05-06 19:02:03 -0400, Jason House said: Don Wrote: x[] = sin(y[]); I strongly favor the first syntax since it matches how I'd write it in a for loop. i.e. I'd replace [] with [i]. This is the best way to see array

Re: envy for "Writing Go Packages"

2010-05-06 Thread BCS
Hello Graham, Simple and well conceived! I would like this for D please (and am willing to help :)). I haven't watched the video (not enough bandwidth) but I'd like a well done package tool as well. Thinking in the direction of a spec, what do you like about the Go system? Some things I'd

Large Address Aware W/ OptLink

2010-05-06 Thread dsimcha
Is there a way to make optlink link D programs in large address aware mode so that I can at least use 4 GB of address space instead of 2 on Win64 until DMD is ported to 64-bit?

Re: Is [] mandatory for array operations?

2010-05-06 Thread Michel Fortin
On 2010-05-06 21:48:09 -0400, "Robert Jacques" said: On Thu, 06 May 2010 20:57:07 -0400, Michel Fortin wrote: On 2010-05-06 19:02:03 -0400, Jason House said: Don Wrote: x[] = sin(y[]); I strongly favor the first syntax since it matches how I'd write it in a for loop. i.e. I'd re

Re: Is [] mandatory for array operations?

2010-05-06 Thread Michel Fortin
On 2010-05-06 22:46:42 -0400, Michel Fortin said: That said, I'd expect the compiler to call sin(y) only once, so it'd be more like that: auto sinY = sin(y); for(int i = 0; i < x.length; i++) { x[i] = sinY[i]; } And I'd expect that because in the expr

Re: Large Address Aware W/ OptLink

2010-05-06 Thread torhu
On 07.05.2010 04:45, dsimcha wrote: Is there a way to make optlink link D programs in large address aware mode so that I can at least use 4 GB of address space instead of 2 on Win64 until DMD is ported to 64-bit? You can supposedly use the editbin tool that comes with msvc to enable large addr

Re: Is [] mandatory for array operations?

2010-05-06 Thread Robert Jacques
On Thu, 06 May 2010 22:46:42 -0400, Michel Fortin wrote: On 2010-05-06 21:48:09 -0400, "Robert Jacques" said: On Thu, 06 May 2010 20:57:07 -0400, Michel Fortin wrote: On 2010-05-06 19:02:03 -0400, Jason House said: Don Wrote: x[] = sin(y[]); I strongly favor the first synta

Re: Is [] mandatory for array operations?

2010-05-06 Thread Jason House
Robert Jacques Wrote: > On Thu, 06 May 2010 22:46:42 -0400, Michel Fortin > wrote: > > > On 2010-05-06 21:48:09 -0400, "Robert Jacques" said: > > > >> On Thu, 06 May 2010 20:57:07 -0400, Michel Fortin > >> wrote: > >> > >>> On 2010-05-06 19:02:03 -0400, Jason House > >>> said: > >>> >

Re: Is [] mandatory for array operations?

2010-05-06 Thread Robert Jacques
On Fri, 07 May 2010 00:13:04 -0400, Jason House wrote: Robert Jacques Wrote: given real foo(real value) {...} and real[] foo(real[] value) {...} what should happen with the follow line of code: x[] = foo(y[]) + z[]; That can be interpreted in either of the following ways: foreach(i) x[i]

Re: Large Address Aware W/ OptLink

2010-05-06 Thread Lionello Lunesu
On 7-5-2010 10:45, dsimcha wrote: > Is there a way to make optlink link D programs in large address aware mode so > that I can at least use 4 GB of address space instead of 2 on Win64 until DMD > is ported to 64-bit? Are you sure DMC's clib and phobos are large address aware? IIRC, there are quite

Re: Large Address Aware W/ OptLink

2010-05-06 Thread Walter Bright
Lionello Lunesu wrote: On 7-5-2010 10:45, dsimcha wrote: Is there a way to make optlink link D programs in large address aware mode so that I can at least use 4 GB of address space instead of 2 on Win64 until DMD is ported to 64-bit? Are you sure DMC's clib and phobos are large address aware?