Re: Fully dynamic d by opDotExp overloading

2009-11-28 Thread Walter Bright
Simen kjaeraas wrote: Just tested it - it does not seem to allow template parameters beyond just the function name. Is this something we can expect in the future? The use case I have is this: struct foo { void opDispatch( string name, T )( T value ) { static if ( is( T == float ) ) {

Re: Fully dynamic d by opDotExp overloading

2009-11-28 Thread Walter Bright
bearophile wrote: Can someone show me a small example of how to use it with runtime method names? class C { void dynamic(string s, int i) { ... } void opDispatch(string s)(int i) { dynamic(s, i); } }

Re: Fully dynamic d by opDotExp overloading

2009-11-28 Thread Simen kjaeraas
On Sun, 29 Nov 2009 00:37:34 +0100, Walter Bright wrote: davidl wrote: Any comments? Do you like this feature? And here it is (called opDispatch, Michel Fortin's suggestion): http://www.dsource.org/projects/dmd/changeset?new=trunk%2f...@268&old=trunk%2f...@267 Just tested it - it does n

Re: Fully dynamic d by opDotExp overloading

2009-11-28 Thread bearophile
Walter Bright: > opDispatch can be written to do runtime method names, no language > changes needed. Very good. Then the opDynamic name wasn't wrong. Can someone show me a small example of how to use it with runtime method names? Bye, bearophile

Re: Fully dynamic d by opDotExp overloading

2009-11-28 Thread Walter Bright
bearophile wrote: Walter Bright: And here it is (called opDispatch, Michel Fortin's suggestion):< That's short code. Do you like my related suggestion of opDynamic (that works with run-time method names)? opDispatch can be written to do runtime method names, no language changes needed.

Re: Fully dynamic d by opDotExp overloading

2009-11-28 Thread bearophile
Walter Bright: > And here it is (called opDispatch, Michel Fortin's suggestion):< That's short code. Do you like my related suggestion of opDynamic (that works with run-time method names)? Bye, bearophile

Re: Fully dynamic d by opDotExp overloading

2009-11-28 Thread Walter Bright
davidl wrote: Any comments? Do you like this feature? And here it is (called opDispatch, Michel Fortin's suggestion): http://www.dsource.org/projects/dmd/changeset?new=trunk%2f...@268&old=trunk%2f...@267

Re: dynamic classes and duck typing

2009-11-28 Thread Walter Bright
And here it is (called opDispatch, Michel Fortin's suggestion): http://www.dsource.org/projects/dmd/changeset?new=trunk%2f...@268&old=trunk%2f...@267

Re: dynamic classes and duck typing

2009-11-28 Thread Andrei Alexandrescu
KennyTM~ wrote: On Nov 28, 09 22:00, bearophile wrote: Walter Bright: and then s.foo(3), if foo is not a compile time member of s, is rewritten as: s.opDynamic!("foo")(3); I don't understand, isn't this the right translation? s.opDynamic("foo", 3); If the "foo" name is known at compile t

Re: Should operator overload methods be virtual?

2009-11-28 Thread Walter Bright
retard wrote: Is this again one of those features that is supposed to hide the fact that dmd & optlink toolchain sucks? At least gcc can optimize the calls in most cases where the operator is defined to be virtual, but is used in non-polymorphic manner. The gnu linker (ld) does not do any opt

Re: Should operator overload methods be virtual?

2009-11-28 Thread Walter Bright
Denis Koroskin wrote: I thought operator overloading was going to be implemented via templates. As such, they are non-virtual by default, which is okay, in my opinion. Yes, that's the rationale. I'm looking for a hole in it.

Re: new version

2009-11-28 Thread Denis Koroskin
On Sat, 28 Nov 2009 23:28:51 +0300, l8night wrote: Too many bugs - no way my superiors allow some program with that bug list and the open date for version 2. worst is the slow bugfixes. What bugs are you talking about? Mark it as a blocker if that's a known one, or submit a bugreport if it

Re: new version

2009-11-28 Thread l8night
Too many bugs - no way my superiors allow some program with that bug list and the open date for version 2. worst is the slow bugfixes.

Re: 1.044 download does not work

2009-11-28 Thread Denis Koroskin
On Sat, 28 Nov 2009 22:03:07 +0300, Walter Bright wrote: Michael P. wrote: http://ftp.digitalmars.com/dmd.1.044.zip seems to be dead. There isn't one with that version. There is one in changelog: http://www.digitalmars.com/d/1.0/changelog.html#new1_044

Re: 1.044 download does not work

2009-11-28 Thread Walter Bright
Michael P. wrote: http://ftp.digitalmars.com/dmd.1.044.zip seems to be dead. There isn't one with that version.

1.044 download does not work

2009-11-28 Thread Michael P.
http://ftp.digitalmars.com/dmd.1.044.zip seems to be dead.

Re: Should pure nothrow ---> @pure @nothrow ?

2009-11-28 Thread retard
Fri, 27 Nov 2009 14:10:34 +0100, Danny Wilson wrote: > Op Fri, 27 Nov 2009 11:58:59 +0100 schreef Don : > >>> void foo() >>> @naked body >>> { >> >> LOL! Spam filters would love that!! > > I can already imagine the jokes spreading over the internets: > > @safe public double penetration(of a) @n

Re: Is there any fancy "R.I.P. C++" D banner out there?

2009-11-28 Thread Mike Parker
Trass3r wrote: I like to use a "R.I.P. C++" D signature in forums, but it would be much cooler if I had a fancy banner for that with a gravestone etc., is there something like that or is there somebody here in the community who could create one? :) Oh, please. I'd love to put one up on The On

Is there any fancy "R.I.P. C++" D banner out there?

2009-11-28 Thread Trass3r
I like to use a "R.I.P. C++" D signature in forums, but it would be much cooler if I had a fancy banner for that with a gravestone etc., is there something like that or is there somebody here in the community who could create one? :)

Re: new version

2009-11-28 Thread KennyTM~
On Nov 28, 09 16:16, l8night wrote: hi walter, when will the next bugfix version be released? You could always use the svn version.

Re: dynamic classes and duck typing

2009-11-28 Thread KennyTM~
On Nov 28, 09 22:00, bearophile wrote: Walter Bright: and then s.foo(3), if foo is not a compile time member of s, is rewritten as: s.opDynamic!("foo")(3); I don't understand, isn't this the right translation? s.opDynamic("foo", 3); If the "foo" name is known at compile time only (as in a

Re: dynamic classes and duck typing

2009-11-28 Thread div0
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 dsimcha wrote: > == Quote from Walter Bright (newshou...@digitalmars.com)'s article >> dsimcha wrote: >>> Sometimes I feel like there should be a law similar to Greenspun's Law for > > Having never done it before, I really cannot imagine how people ge

Re: dynamic classes and duck typing

2009-11-28 Thread bearophile
> It can have that signature shown by Walter: > T opDispatch(s : string)(args...); Or, to keep its name simpler to remember beside the opDynamic: T opStatic(s : string)(args...); Bye, bearophile

Re: dynamic classes and duck typing

2009-11-28 Thread bearophile
Don: > You mean, if it's known at run-time only? Yes, sorry. > What Walter has written is definitely the correct one. I am not saying that what Walter has written is wrong or useless :-) I am saying that it's not dynamic. This means that: 1) The name of that operator "opDynamic" is wrong, it nee

Re: Should pure nothrow ---> @pure @nothrow ?

2009-11-28 Thread grauzone
Lutger wrote: I tend to think attributes in .NET are a regular means of abstraction, much like classes or generics. In part, they make up for lack of other metaprogramming features in some .NET languages. I agree; I think they are best for associating arbitrary information with arbitrary type

Re: Should operator overload methods be virtual?

2009-11-28 Thread dsimcha
== Quote from retard (r...@tard.com.invalid)'s article > Sat, 28 Nov 2009 08:16:33 -0500, bearophile wrote: > > dsimcha: > >> but it would introduce an > >> inconsistency into the language relative to "regular" methods. > > > > Right, it's an exception to a rule of the language, so it increases the

Re: dynamic classes and duck typing

2009-11-28 Thread Don
bearophile wrote: Walter Bright: and then s.foo(3), if foo is not a compile time member of s, is rewritten as: s.opDynamic!("foo")(3); I don't understand, isn't this the right translation? s.opDynamic("foo", 3); If the "foo" name is known at compile time only (as in all C# examples and in

Re: Should operator overload methods be virtual?

2009-11-28 Thread retard
Sat, 28 Nov 2009 08:16:33 -0500, bearophile wrote: > dsimcha: >> but it would introduce an >> inconsistency into the language relative to "regular" methods. > > Right, it's an exception to a rule of the language, so it increases the > language complexity. I guess the systems programming language

Re: dynamic classes and duck typing

2009-11-28 Thread bearophile
bearophile: > If the "foo" name is known at compile time only I meant at "run-time only", that's what defines it as dynamic. Otherwise, as Michel Fortin says, there's nothing dynamic in it. Bye, bearophile

Re: dynamic classes and duck typing

2009-11-28 Thread bearophile
Walter Bright: > and then s.foo(3), if foo is not a compile time member of s, is > rewritten as: > s.opDynamic!("foo")(3); I don't understand, isn't this the right translation? s.opDynamic("foo", 3); If the "foo" name is known at compile time only (as in all C# examples and in Python) you ca

Re: dynamic classes and duck typing

2009-11-28 Thread Michel Fortin
On 2009-11-27 18:30:14 -0500, Walter Bright said: But with a small feature, we can make this work: struct S { ... T opDynamic(s : string)(args...); } and then s.foo(3), if foo is not a compile time member of s, is rewritten as: s.opDynamic!("foo")(3); and op

Re: Short list with things to finish for D2

2009-11-28 Thread bearophile
Stewart Gordon: > Only for built-in linear arrays. Half the point is: What if somebody > creates a type for which the lower bound is something different? This can be useful. For example an array with indices in a .. z+1 :-) > maybe we need some symbol like ^ to denote the lower > bound, and o

Re: Should operator overload methods be virtual?

2009-11-28 Thread bearophile
dsimcha: > but it would introduce an > inconsistency into the language relative to "regular" methods. Right, it's an exception to a rule of the language, so it increases the language complexity. Bye, bearophile

Re: new version

2009-11-28 Thread Denis Koroskin
On Sat, 28 Nov 2009 11:16:22 +0300, l8night wrote: hi walter, when will the next bugfix version be released? Why would you ask? Any specific bug is blocking your development?

Re: dynamic classes and duck typing

2009-11-28 Thread Denis Koroskin
On Sat, 28 Nov 2009 10:16:33 +0300, Chris Nicholson-Sauls wrote: Walter Bright wrote: One thing Java and Python, Ruby, etc., still hold over D is dynamic classes, i.e. classes that are only known at runtime, not compile time. In D, this: s.foo(3); could be emulated with: s.dynam

Re: Should pure nothrow ---> @pure @nothrow ?

2009-11-28 Thread Lutger
Don wrote: > Ary Borenszweig wrote: >> Don wrote: >>> #ponce wrote: > Definitely. And what about @deprecated and @override? As override is now required, i don't think it should be an attribute. >>> >>> As I understand it, one of the characteristics of attributes is that >>> you shoul

new version

2009-11-28 Thread l8night
hi walter, when will the next bugfix version be released?