On 2011-11-08 03:07, Jesse Phillips wrote:
On Mon, 07 Nov 2011 18:22:07 +, %u wrote:
Hello.
I know D isn't Java, but one trivial thing I liked about Java is the
introduction of 'extends' and 'implements' as keywords as ways to
clarify the class relationships when defining a class. You kno
On 2011-11-07 20:36, Dejan Lekic wrote:
Andrej Mitrovic wrote:
class Rectangle : IShape, Drawable {}
It's pretty common in other languages, I've seen it used in D as well.
I used the same naming convention for interfaces until I saw this
presentation: http://www.infoq.com/presentations/It-Is
On Mon, 07 Nov 2011 18:52:19 +0100, Timon Gehr wrote:
> Expected, s has value semantics.
>
> for(S _s=s; !_s.empty(); _s.popFront()){
> auto i = _s.front();
> // assert(i == s.popCount()); // expected to fail.
> }
Yes thank you. I was just hoping to have access to _s inside the loop.
On Mon, 07 Nov 2011 18:22:07 +, %u wrote:
> Hello.
>
> I know D isn't Java, but one trivial thing I liked about Java is the
> introduction of 'extends' and 'implements' as keywords as ways to
> clarify the class relationships when defining a class. You know:
>
> class Subclass extends Super
On Mon, 07 Nov 2011 20:59:05 +, Richard Webb wrote:
> I have a recollection that i replaced an opAssign with a custom assign
> function when getting Juno to build with D2 a while ago because of
> something like this (was in the MethodProxy struct in com.client). That
> did hit a different DMD
Andrej Mitrovic:
> I did have a bug pop up because I was relying on this new fallthrough
> warning system, but it failed to warn me because I didn't have a
> statement in one of my cases (I forgot to put a break).
-.- This is the consequence of special cases piled on special cases, in the D
desi
On Monday, November 07, 2011 15:38 Andrej Mitrovic wrote:
> import std.stdio;
>
> void main()
> {
> int y;
> switch (y)
> {
> case 0:
> {
> // no warning here on fallthrough
> }
>
> case 1:
> {
> goto case 2;
> }
>
> case 2:
> {
> writeln("2");
> break;
> }
>
> default:
> }
> }
>
> This won't
import std.stdio;
void main()
{
int y;
switch (y)
{
case 0:
{
// no warning here on fallthrough
}
case 1:
{
goto case 2;
}
case 2:
{
writeln("2");
break;
}
On 07/11/2011 20:27, Jesse Phillips wrote:
Came across this when trying to get Juno to work. Is there a good workaround
for it?
http://d.puremagic.com/issues/show_bug.cgi?id=6906
test.d(6): Error: function test.S.opAssign (int i) is not callable using
argument types (S)
void main() {
Came across this when trying to get Juno to work. Is there a good workaround
for it?
http://d.puremagic.com/issues/show_bug.cgi?id=6906
test.d(6): Error: function test.S.opAssign (int i) is not callable using
argument types (S)
void main() {
S[string] ss;
S s;
ss[
Andrej Mitrovic wrote:
> class Rectangle : IShape, Drawable {}
>
> It's pretty common in other languages, I've seen it used in D as well.
I used the same naming convention for interfaces until I saw this
presentation: http://www.infoq.com/presentations/It-Is-Possible-to-Do-OOP-
in-Java (jump to
On Mon, 07 Nov 2011 14:07:56 -0500, %u wrote:
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
On Mon, 07 Nov 2011 13:22:07 -0500, %u wrote:
In order for such a humongously code-breaking change to occur,
there would
have to be dire reasons why this was necessary. Because
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
> On Mon, 07 Nov 2011 13:22:07 -0500, %u wrote:
> In order for such a humongously code-breaking change to occur,
there would
> have to be dire reasons why this was necessary. Because you
liked Java is
> not a qualifying reason.
>
On 11/05/2011 03:23 PM, bearophile wrote:
Tobias Pankrath:
I do like it, just it would be nice to have an alternative in phobos, iff there is
no other way I am not aware of.<
"Type tuples" (that are allowed to contain more than just types) aren't Phobos
constructs, they are built-in in the
You can do this and/or use the convention of extends first, implements
second:
class Rectangle : Drawable, IShape, IOtherInterface {}
It's not a convention, the spec demands that.
http://d-programming-language.org/class.html
If you're really concerned about clarity, use comments:
class Rect
You can do this and/or use the convention of extends first, implements
second:
class Rectangle : Drawable, IShape, IOtherInterface {}
If you're really concerned about clarity, use comments:
class Rectangle : /* extends */ Drawable,
/* implements */ IShape
{
}
Andrej Mitrovic wro
On 07-11-2011 19:22, %u wrote:
Hello.
I know D isn't Java, but one trivial thing I liked about Java is
the introduction of 'extends' and 'implements' as keywords as ways
to clarify the class relationships when defining a class. You
know:
class Subclass extends SuperClass implements AnInterface
If you need some kind of textual information on whether its a class or
an interface, you can name your interfaces with an "I".
interface IShape
{
}
abstract class Drawable
{
}
class Rectangle : IShape, Drawable {}
It's pretty common in other languages, I've seen it used in D as well.
On Mon, 07 Nov 2011 13:22:07 -0500, %u wrote:
Hello.
I know D isn't Java, but one trivial thing I liked about Java is
the introduction of 'extends' and 'implements' as keywords as ways
to clarify the class relationships when defining a class. You
know:
class Subclass extends SuperClass imple
Hello.
I know D isn't Java, but one trivial thing I liked about Java is
the introduction of 'extends' and 'implements' as keywords as ways
to clarify the class relationships when defining a class. You
know:
class Subclass extends SuperClass implements AnInterface {
...
}
Will they ever add this
On 11/07/2011 12:26 AM, Jesse Phillips wrote:
I'm sure if this was changed there would be other interesting behavior,
such as arrays being consumed. And suggestions other than
for(S s; !s.empty, s.popFront())...
Example:
void main() {
S s;
foreach(i; s) {
On 11/7/11, Trass3r wrote:
>> Cool stuff, thanks guys. This thing kicks some serious C++ ass. ^^
>
> How? You can use using in C++ to do the same.
>
My bad. I was a bit over-excited there. :p
Cool stuff, thanks guys. This thing kicks some serious C++ ass. ^^
How? You can use using in C++ to do the same.
Cool stuff, thanks guys. This thing kicks some serious C++ ass. ^^
Regan Heath wrote:
> You've also got std.ascii.digits which is "0123456789" and
> std.string.digits which is an alias of it, so you can say:
>
> import std.ascii; (or std.string)
>
> int x = 5;
> char c = std.ascii.digits[x];
>
I used similar solution to bearophile's before. I must admit i did
On Sun, 06 Nov 2011 23:10:57 -0500, Andrej Mitrovic
wrote:
I've had a simple problem where I've only wanted to override a setter
from a base class:
class Foo
{
@property void test(int) {}
@property int test() { return 1; }
}
class Bar : Foo
{
override @property void test(int) {}
class Foo
{
@property void test(int) {}
@property int test() { return 1; }
}
class Bar : Foo
{
alias super.test test;
override @property void test(int) {}
void bartest() { auto x = test; }
}
And it actually works! Is this a documented feature?
http://d-programming-language.
On 06-11-2011 21:36, Ellery Newcomer wrote:
On 11/06/2011 01:50 PM, Alex Rønne Petersen wrote:
On 06-11-2011 20:43, Ellery Newcomer wrote:
poking about in elfutils headers, I've come across the following idiom
several times
/* Error values. */
enum
{
DW_TAG_invalid = 0
#define DW_TA
On Sun, 06 Nov 2011 04:39:28 -, Jude Young <10equa...@gmail.com> wrote:
Nice. Exactly what I was looking for.
I knew I was missing something tiny.
Now I just need to figure out why that works and I can say I've learned
something!
Thanks guys,
Jude
On Sat, Nov 5, 2011 at 5:38 AM, bearophile
> I use Emacs and replace regexp.
Hi,
I'm looking for a solution that replaces just in the scope. A regexp
replace would change all occurrences :( Also, if you have a function
that is implemented in a module and you call it in another file, it
should be renamed everywhere.
Laszlo
30 matches
Mail list logo