digitalmars.D - DMD 0.91 release
- Walter (2/2) May 28 2004 Mainly more bug fixes.
- Ant (4/8) May 28 2004 bad idea, bad sintax.
- MarkT (4/11) May 29 2004 agreed (bad syntax) - don't overload every word until it becomes meaning...
- Russ Lewis (5/22) Jun 04 2004 What about this syntax?
- J Anderson (4/7) May 28 2004 Wow, you implemented my typeof(this) idea, thanks.
- Walter (7/14) May 28 2004 It was inevitable, because this had to work, too:
- hellcatv hotmail.com (7/16) May 28 2004 isn't typeof(this) a pointer?
- J Anderson (10/18) May 28 2004 Your living in C++ land. Remember in C++ you had to use -> if it was a
- Ivan Senji (23/25) May 29 2004 Great: "Allow functions that return void to return expressions. "
- Walter (3/33) May 29 2004 Yes, any type can be implicitly converted to void. -Walter
- Sean Kelly (4/5) May 29 2004 And any type can also be implicitly converted to Object as well,
- Walter (4/10) May 29 2004 No, only objects derived from Object.
- Antti =?iso-8859-1?Q?Syk=E4ri?= (7/10) May 30 2004 Why would you want to? Unless its type is void, of course, but then you
- Walter (3/9) May 31 2004 I'm not sure if it was a good idea or not :-(
- Arcane Jill (10/25) May 31 2004 This is what's needed. You need to imagine the concept of an expression ...
- Ivan Senji (4/47) May 29 2004 Thanks! By the way: is there any way to convert it void to
- Walter (3/8) May 29 2004 No.
Mainly more bug fixes. http://www.digitalmars.com/d/changelog.html
May 28 2004
On Fri, 28 May 2004 16:52:45 -0700, Walter wrote:Mainly more bug fixes. http://www.digitalmars.com/d/changelog.htmlfrom the change log:typeof(this).member() now does non-virtual call to member().bad idea, bad sintax. Ant
May 28 2004
In article <pan.2004.05.29.02.07.33.528199 yahoo.ca>, Ant says...On Fri, 28 May 2004 16:52:45 -0700, Walter wrote:agreed (bad syntax) - don't overload every word until it becomes meaningless What is with void returning expressions? void is for procedures create an "any" type or something similarMainly more bug fixes. http://www.digitalmars.com/d/changelog.htmlfrom the change log:typeof(this).member() now does non-virtual call to member().bad idea, bad sintax.
May 29 2004
Ant wrote:On Fri, 28 May 2004 16:52:45 -0700, Walter wrote:What about this syntax? this.(ClassName.member)() I know that it doesn't look right, but it does express exactly what you intend: call this specific implementation using the 'this' pointer.Mainly more bug fixes. http://www.digitalmars.com/d/changelog.htmlfrom the change log:typeof(this).member() now does non-virtual call to member().bad idea, bad sintax. Ant
Jun 04 2004
Walter wrote:Mainly more bug fixes. http://www.digitalmars.com/d/changelog.htmlWow, you implemented my typeof(this) idea, thanks. -- -Anderson: http://badmama.com.au/~anderson/
May 28 2004
"J Anderson" <REMOVEanderson badmama.com.au> wrote in message news:c98uut$g4r$1 digitaldaemon.com...Walter wrote:It was inevitable, because this had to work, too: class A { void foo() { } void bar() { A.foo(); } }Mainly more bug fixes. http://www.digitalmars.com/d/changelog.htmlWow, you implemented my typeof(this) idea, thanks.
May 28 2004
isn't typeof(this) a pointer? shouldn't it be typeof(*this) ? or am I silly or in C++ land does this mean if I do (MyClass*).happy() it will call the MyClass happy func? In article <c98uut$g4r$1 digitaldaemon.com>, J Anderson says...Walter wrote:Mainly more bug fixes. http://www.digitalmars.com/d/changelog.htmlWow, you implemented my typeof(this) idea, thanks. -- -Anderson: http://badmama.com.au/~anderson/
May 28 2004
hellcatv hotmail.com wrote:isn't typeof(this) a pointer? shouldn't it be typeof(*this) ? or am I silly or in C++ landYour living in C++ land. Remember in C++ you had to use -> if it was a pointer to access a member. Also remember that all classes in D are pointers.does this mean if I do (MyClass*).happy() it will call the MyClass happy func?I think you mean: (*MyClass).happy(); which will not work as D hides the fact that classes are pointers (actually they are more like references in some respects). -- -Anderson: http://badmama.com.au/~anderson/
May 28 2004
Great: "Allow functions that return void to return expressions. " I was for this too BUT: import std.c.stdio; class A{} void F1(int x) { printf("F1(%d)\n",x); return new A(); } void F2(int x) { printf("F2(%d)\n",x); return F1(x); } int main ( char [] [] args ) { F2(100); } This code compiles ok. It seams that a function returning void can now return anything, is it the expected behaviour? I would expect the return in F1 not to work and the one in F2 to work? "Walter" <newshound digitalmars.com> wrote in message news:c98ju4$17o$1 digitaldaemon.com...Mainly more bug fixes. http://www.digitalmars.com/d/changelog.html
May 29 2004
Yes, any type can be implicitly converted to void. -Walter "Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:c99hap$1f97$1 digitaldaemon.com...Great: "Allow functions that return void to return expressions. " I was for this too BUT: import std.c.stdio; class A{} void F1(int x) { printf("F1(%d)\n",x); return new A(); } void F2(int x) { printf("F2(%d)\n",x); return F1(x); } int main ( char [] [] args ) { F2(100); } This code compiles ok. It seams that a function returning void can now return anything, is it the expected behaviour? I would expect the return in F1 not to work and the one in F2 to work? "Walter" <newshound digitalmars.com> wrote in message news:c98ju4$17o$1 digitaldaemon.com...Mainly more bug fixes. http://www.digitalmars.com/d/changelog.html
May 29 2004
Walter wrote:Yes, any type can be implicitly converted to void. -WalterAnd any type can also be implicitly converted to Object as well, correct? Why the addition of implicit void conversions? Sean
May 29 2004
"Sean Kelly" <sean f4.ca> wrote in message news:c9ammk$1ri$1 digitaldaemon.com...Walter wrote:No, only objects derived from Object.Yes, any type can be implicitly converted to void. -WalterAnd any type can also be implicitly converted to Object as well, correct?Why the addition of implicit void conversions?To make it easy to return an expression from a void function.Sean
May 29 2004
In article <c9aq9h$79m$1 digitaldaemon.com>, Walter wrote:Why would you want to? Unless its type is void, of course, but then you don't need an implicit void conversion in the first place. -Antti -- I will not be using Plan 9 in the creation of weapons of mass destruction to be used by nations other than the US.Why the addition of implicit void conversions?To make it easy to return an expression from a void function.
May 30 2004
"Antti Sykäri" <jsykari gamma.hut.fi> wrote in message news:slrncbl07d.o2l.jsykari pulu.hut.fi...In article <c9aq9h$79m$1 digitaldaemon.com>, Walter wrote:I'm not sure if it was a good idea or not :-(Why would you want to? Unless its type is void, of course, but then you don't need an implicit void conversion in the first place.Why the addition of implicit void conversions?To make it easy to return an expression from a void function.
May 31 2004
In article <c9elv9$2e5f$1 digitaldaemon.com>, Walter says..."Antti Sykäri" <jsykari gamma.hut.fi> wrote in message news:slrncbl07d.o2l.jsykari pulu.hut.fi...This is what's needed. You need to imagine the concept of an expression with type void. There should be *only* two ways to create such an expression; (1) return; // returns an expression of type void; (2) return expr; // see below The second possibility returns an expression of type void IF AND ONLY IF expr is itself an expression of type void, otherwise it's a compile error. It's that simple. PS. C allows the following. I don't think we should copy it.In article <c9aq9h$79m$1 digitaldaemon.com>, Walter wrote:I'm not sure if it was a good idea or not :-(Why would you want to? Unless its type is void, of course, but then you don't need an implicit void conversion in the first place.Why the addition of implicit void conversions?To make it easy to return an expression from a void function.int f(int x) { (void) x; /* stuff */ }The intent here is to disable compiler warnings about x not being used.
May 31 2004
"Walter" <newshound digitalmars.com> wrote in message news:c9aj4e$2ukl$1 digitaldaemon.com...Yes, any type can be implicitly converted to void. -WalterThanks! By the way: is there any way to convert it void to another type?"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:c99hap$1f97$1 digitaldaemon.com...Great: "Allow functions that return void to return expressions. " I was for this too BUT: import std.c.stdio; class A{} void F1(int x) { printf("F1(%d)\n",x); return new A(); } void F2(int x) { printf("F2(%d)\n",x); return F1(x); } int main ( char [] [] args ) { F2(100); } This code compiles ok. It seams that a function returning void can now return anything, is it the expected behaviour? I would expect the return in F1 not to work and the one in F2 to work? "Walter" <newshound digitalmars.com> wrote in message news:c98ju4$17o$1 digitaldaemon.com...Mainly more bug fixes. http://www.digitalmars.com/d/changelog.html
May 29 2004
"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:c9atft$bld$1 digitaldaemon.com..."Walter" <newshound digitalmars.com> wrote in message news:c9aj4e$2ukl$1 digitaldaemon.com...No.Yes, any type can be implicitly converted to void. -WalterThanks! By the way: is there any way to convert it void to another type?
May 29 2004