On Sunday, 13 January 2013 at 16:39:22 UTC, bearophile wrote:
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers the current behavour.
I'll have to disagree and it should remain
On Tuesday, 15 January 2013 at 22:03:24 UTC, Era Scarecrow wrote:
On Sunday, 13 January 2013 at 16:39:22 UTC, bearophile wrote:
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers
Hi!
Sorry,if it already was discussed,but
import std.stdio;
struct Foo
{
static void bar()
{
writeln(static);
}
void bar()
{
writeln(non-static);
}
}
int main()
{
Foo gun;
gun.bar();//fails here
}
Is it
On Sunday, 13 January 2013 at 15:58:56 UTC, Zhenya wrote:
Hi!
Sorry,if it already was discussed,but
import std.stdio;
struct Foo
{
static void bar()
{
writeln(static);
}
void bar()
{
writeln(non-static);
}
}
int
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers the current behavour.
Bye,
bearophile
On Sunday, 13 January 2013 at 16:39:22 UTC, bearophile wrote:
Maxim Fomin:
dmd allows to call static functions on instance.
I think that's a D design mistake (and I think Jonathan Davis
agrees with me), but Walter prefers the current behavour.
Bye,
bearophile
Maybe you could suggest
Definitely this is a bad design. Even in PHP you can't call
static functions from class instance. :-)
Having two functions with the same name and argument list within
one class is a bad idea too.
On Sunday, 13 January 2013 at 17:17:54 UTC, Maxim Fomin wrote:
On Sunday, 13 January 2013 at 16:23:27 UTC, Zhenya wrote:
On Sunday, 13 January 2013 at 16:18:36 UTC, Maxim Fomin wrote:
Yes, it is a problem - dmd allows to call static functions on
instance. When both match, it issues ambiguity
Don't know if this will be useful in any manner, but it came this
silly way:
class MyClass {
struct _static {
static void myfun() {
writeln(static myfun);
}
}
void myfun() {
writeln(myfun);
On Sunday, 13 January 2013 at 17:59:28 UTC, Andrey wrote:
Don't know if this will be useful in any manner, but it came
this silly way:
class MyClass {
struct _static {
static void myfun() {
writeln(static myfun);
}
}
On Sunday, 13 January 2013 at 18:16:40 UTC, Zhenya wrote:
On Sunday, 13 January 2013 at 17:59:28 UTC, Andrey wrote:
Don't know if this will be useful in any manner, but it came
this silly way:
class MyClass {
struct _static {
static void myfun() {
On 2013-01-13 16:58, Zhenya wrote:
Hi!
Sorry,if it already was discussed,but
import std.stdio;
struct Foo
{
static void bar()
{
writeln(static);
}
void bar()
{
writeln(non-static);
}
}
int main()
{
Foo gun;
gun.bar();//fails here
}
Is it all right,that compiler dosn't prefer non-static
12 matches
Mail list logo