"Steven Schveighoffer" , dans le message (digitalmars.D:165141), a
> The idea I came up with in my proposal
> (http://d.puremagic.com/issues/show_bug.cgi?id=6579) was to allow aliasing
> the static method into the instance namespace:
+1
On 2012-04-27 07:07, H. S. Teoh wrote:
Is this a bug? Code:
import std.stdio;
struct S {
static int func(int x) { return x+1; }
int func(int x) { return x+2; }
}
void main() {
S s;
writeln(s.func(1)
On Fri, 27 Apr 2012 09:15:31 -0400, so wrote:
On Friday, 27 April 2012 at 12:35:53 UTC, Steven Schveighoffer wrote:
Huh? The main reason of confusion is that the static method is named
in such a way that it looks like an instance method. So we prevent
that, unless the author of the class
On Friday, 27 April 2012 at 12:35:53 UTC, Steven Schveighoffer
wrote:
Huh? The main reason of confusion is that the static method is
named in such a way that it looks like an instance method. So
we prevent that, unless the author of the class (who is
deciding the name of the function) deems
On Fri, 27 Apr 2012 08:11:48 -0400, so wrote:
On Friday, 27 April 2012 at 11:51:40 UTC, Steven Schveighoffer wrote:
The idea I came up with in my proposal
(http://d.puremagic.com/issues/show_bug.cgi?id=6579) was to allow
aliasing the static method into the instance namespace:
struct S1
{
On Friday, 27 April 2012 at 11:51:40 UTC, Steven Schveighoffer
wrote:
The idea I came up with in my proposal
(http://d.puremagic.com/issues/show_bug.cgi?id=6579) was to
allow aliasing the static method into the instance namespace:
struct S1
{
static void foo() {}
alias S1.foo this.foo;
On Friday, 27 April 2012 at 11:49:08 UTC, Kevin Cox wrote:
On Apr 27, 2012 7:34 AM, "so" wrote:
I agree it is ugly. If there is a way out (reason why i
asked), we should
just dump it.
I don't like the idea either because it is confusing. The only
reason I
can imagine is if there was polym
On Fri, 27 Apr 2012 07:31:50 -0400, so wrote:
On Friday, 27 April 2012 at 11:23:39 UTC, Steven Schveighoffer wrote:
On Fri, 27 Apr 2012 07:03:02 -0400, so wrote:
On Friday, 27 April 2012 at 10:48:29 UTC, Steven Schveighoffer wrote:
With the advent of UFCS, this argument has much less teeth
On Apr 27, 2012 7:34 AM, "so" wrote:
>
> I agree it is ugly. If there is a way out (reason why i asked), we should
just dump it.
I don't like the idea either because it is confusing. The only reason I
can imagine is if there was polymorphism on statics which I see as a fairly
useless feature.
On Friday, 27 April 2012 at 11:23:39 UTC, Steven Schveighoffer
wrote:
On Fri, 27 Apr 2012 07:03:02 -0400, so wrote:
On Friday, 27 April 2012 at 10:48:29 UTC, Steven Schveighoffer
wrote:
With the advent of UFCS, this argument has much less teeth.
Maybe it should be revisited...
-Steve
E
On Fri, 27 Apr 2012 07:03:02 -0400, so wrote:
On Friday, 27 April 2012 at 10:48:29 UTC, Steven Schveighoffer wrote:
With the advent of UFCS, this argument has much less teeth. Maybe it
should be revisited...
-Steve
Elaborate please how UFCS would help in that context.
Hm... thinking a
On Friday, 27 April 2012 at 10:48:29 UTC, Steven Schveighoffer
wrote:
With the advent of UFCS, this argument has much less teeth.
Maybe it should be revisited...
-Steve
Elaborate please how UFCS would help in that context.
On Fri, 27 Apr 2012 01:07:03 -0400, H. S. Teoh
wrote:
Is this a bug? Code:
import std.stdio;
struct S {
static int func(int x) { return x+1; }
int func(int x) { return x+2; }
}
void main() {
S s;
On Friday, 27 April 2012 at 06:14:13 UTC, H. S. Teoh wrote:
Is this a bug? Code:
import std.stdio;
struct S {
static int func(int x) { return x+1; }
int func(int x) { return x+2; }
}
void main() {
S s;
Is this a bug? Code:
import std.stdio;
struct S {
static int func(int x) { return x+1; }
int func(int x) { return x+2; }
}
void main() {
S s;
writeln(s.func(1));
}
DMD (latest git) output:
15 matches
Mail list logo