I just got and idea, what about allowing to overload methods based on if
they're static or not. This would allow the following code:
class Foo
{
void bar () { writeln("bar"); }
static void bar () { writeln("static bar"); }
}
Foo.bar; // would print "static bar"
auto foo = new Foo;
fo
"Jacob Carlborg" wrote in message
news:j3fi1u$1uge$1...@digitalmars.com...
>I just got and idea, what about allowing to overload methods based on if
>they're static or not.
>From my list of 'Andrei' bugs:
http://d.puremagic.com/issues/show_bug.cgi?id=3345
It sounds like a good idea, but what a
On 2011-08-29 16:10, Daniel Murphy wrote:
"Jacob Carlborg" wrote in message
news:j3fi1u$1uge$1...@digitalmars.com...
I just got and idea, what about allowing to overload methods based on if
they're static or not.
From my list of 'Andrei' bugs:
http://d.puremagic.com/issues/show_bug.cgi?id=33
On Mon, 29 Aug 2011 10:25:18 -0400, Jacob Carlborg wrote:
On 2011-08-29 16:10, Daniel Murphy wrote:
"Jacob Carlborg" wrote in message
news:j3fi1u$1uge$1...@digitalmars.com...
I just got and idea, what about allowing to overload methods based on
if
they're static or not.
From my list of
"Steven Schveighoffer" wrote in message
news:op.v0zckubyeav7ka@localhost.localdomain...
>
> My opinion is that static methods should *not* be callable from an
> instance, you should need typeof(instance).staticMethod. The current
> allowance is misleading.
>
> This should solve some of the iss
On 29-08-2011 16:44, Steven Schveighoffer wrote:
My opinion is that static methods should *not* be callable from an
instance, you should need typeof(instance).staticMethod. The current
allowance is misleading.
+1.
- Alex
On Monday, August 29, 2011 07:44 Steven Schveighoffer wrote:
> My opinion is that static methods should *not* be callable from an
> instance, you should need typeof(instance).staticMethod. The current
> allowance is misleading.
Yeah. I don't know why it's allowed. I think that C++, Java, and C# al
Jonathan M Davis:
> Yeah. I don't know why it's allowed. I think that C++, Java, and C# all allow
> it too, but I've always thought that it was a bad idea in all of those
> languages.
> ...
> but it strikes me as very lax to allow a static
> method to be called with an instance. That's definite
On 29-08-2011 19:47, Jonathan M Davis wrote:
On Monday, August 29, 2011 07:44 Steven Schveighoffer wrote:
My opinion is that static methods should *not* be callable from an
instance, you should need typeof(instance).staticMethod. The current
allowance is misleading.
Yeah. I don't know why it's
On Monday, August 29, 2011 12:53 Alex Rønne Petersen wrote:
> On 29-08-2011 19:47, Jonathan M Davis wrote:
> > On Monday, August 29, 2011 07:44 Steven Schveighoffer wrote:
> >> My opinion is that static methods should *not* be callable from an
> >> instance, you should need typeof(instance).staticM
On Mon, 29 Aug 2011 10:59:22 -0400, Daniel Murphy
wrote:
"Steven Schveighoffer" wrote in message
news:op.v0zckubyeav7ka@localhost.localdomain...
My opinion is that static methods should *not* be callable from an
instance, you should need typeof(instance).staticMethod. The current
allowanc
On Tue, 30 Aug 2011 07:53:15 -0400, Steven Schveighoffer
wrote:
On Mon, 29 Aug 2011 10:59:22 -0400, Daniel Murphy
wrote:
"Steven Schveighoffer" wrote in message
news:op.v0zckubyeav7ka@localhost.localdomain...
My opinion is that static methods should *not* be callable from an
instance,
Am 29.08.2011, 22:24 Uhr, schrieb Jonathan M Davis :
On Monday, August 29, 2011 12:53 Alex Rønne Petersen wrote:
On 29-08-2011 19:47, Jonathan M Davis wrote:
> On Monday, August 29, 2011 07:44 Steven Schveighoffer wrote:
>> My opinion is that static methods should *not* be callable from an
>> i
On 2011-08-30 14:34, Steven Schveighoffer wrote:
On Tue, 30 Aug 2011 07:53:15 -0400, Steven Schveighoffer
wrote:
On Mon, 29 Aug 2011 10:59:22 -0400, Daniel Murphy
wrote:
"Steven Schveighoffer" wrote in message
news:op.v0zckubyeav7ka@localhost.localdomain...
My opinion is that static meth
On Tue, 30 Aug 2011 10:19:27 -0400, Jacob Carlborg wrote:
On 2011-08-30 14:34, Steven Schveighoffer wrote:
On Tue, 30 Aug 2011 07:53:15 -0400, Steven Schveighoffer
wrote:
On Mon, 29 Aug 2011 10:59:22 -0400, Daniel Murphy
wrote:
"Steven Schveighoffer" wrote in message
news:op.v0zckubyeav
On 2011-08-30 16:28, Steven Schveighoffer wrote:
It's different. 3345 is asking to allow overloading of static and
instance methods with the same signature. The new bug is asking to
*require* using the type when accessing static methods/fields.
You might notice in the bug report that I mention t
On 8/30/11 7:34 AM, Steven Schveighoffer wrote:
On Tue, 30 Aug 2011 07:53:15 -0400, Steven Schveighoffer
wrote:
On Mon, 29 Aug 2011 10:59:22 -0400, Daniel Murphy
wrote:
"Steven Schveighoffer" wrote in message
news:op.v0zckubyeav7ka@localhost.localdomain...
My opinion is that static metho
On 8/30/11 7:40 AM, Marco Leise wrote:
Am 29.08.2011, 22:24 Uhr, schrieb Jonathan M Davis :
On Monday, August 29, 2011 12:53 Alex Rønne Petersen wrote:
On 29-08-2011 19:47, Jonathan M Davis wrote:
> On Monday, August 29, 2011 07:44 Steven Schveighoffer wrote:
>> My opinion is that static metho
On Tue, 30 Aug 2011 11:38:54 -0400, Andrei Alexandrescu
wrote:
On 8/30/11 7:34 AM, Steven Schveighoffer wrote:
On Tue, 30 Aug 2011 07:53:15 -0400, Steven Schveighoffer
wrote:
On Mon, 29 Aug 2011 10:59:22 -0400, Daniel Murphy
wrote:
"Steven Schveighoffer" wrote in message
news:op.v0zck
On Tue, 30 Aug 2011 11:58:20 -0400, Steven Schveighoffer
wrote:
On Tue, 30 Aug 2011 11:38:54 -0400, Andrei Alexandrescu
wrote:
We don't have as big a problem in D due to introspection. I fear,
however, that we'll need to add static if (...) obj.method(); else
typeof(obj).method();
I
On Tue, 30 Aug 2011 11:58:20 -0400, Steven Schveighoffer
wrote:
On Tue, 30 Aug 2011 11:38:54 -0400, Andrei Alexandrescu
wrote:
On 8/30/11 7:34 AM, Steven Schveighoffer wrote:
We don't have as big a problem in D due to introspection. I fear,
however, that we'll need to add static if (..
"Steven Schveighoffer" wrote in message
> struct S2
> {
>static void foo();
>alias foo this.foo;
> }
or
alias typeof(this).foo foo;
Quote: Steven Schveighoffer
> An example I gave in the bug report just now is File. Imagine you have
> a File struct, and want to have an open method:
>
> struct File
> {
>static File open(string fname);
> }
>
> However, now this is valid code:
>
> File f; // < here's the problem!
>
On Sat, 24 Sep 2011 16:26:34 -0400, mta`chrono
wrote:
Quote: Steven Schveighoffer
An example I gave in the bug report just now is File. Imagine you have
a File struct, and want to have an open method:
struct File
{
static File open(string fname);
}
However, now this is valid code:
Fil
24 matches
Mail list logo