digitalmars.D - DMD 0.98 release
- Walter (2/2) Aug 05 2004 Focussed on eliminating compiler hangs, gpf's and internal errors.
- Ivan Senji (10/12) Aug 05 2004 Why don't scalar constructors take parametars?
- Matthias Becker (1/8) Aug 05 2004 Well, structs don't have constructors. Scalar types seem not to have the...
- Daniel Horn (7/21) Aug 05 2004 but you can overload OpCall for a struct and for a class to do the same
- pragma (38/44) Aug 05 2004 I, too was wondering why you can't simply go "new int(42)", when its pre...
- Walter (4/12) Aug 05 2004 I'm not sure what the case is for it. The reason for adding the current
- Matthew (4/19) Aug 05 2004 That's great, but I agree with the others that one should be able to par...
- Stewart Gordon (10/26) Aug 06 2004 Would I be right to figure that this is just syntactic sugar for
- Walter (4/26) Aug 06 2004 Yes.
- Russ Lewis (2/5) Aug 05 2004 The changelog doesn't include 0.98. Otherwise, thanks much for the rele...
- Lars Ivar Igesund (4/14) Aug 05 2004 Yes, it do (and it did). Maybe your browser had a problem that made it
- Stewart Gordon (8/9) Aug 10 2004 "Fixed Internal error: ..\ztc\cgcod.c 1464"
Focussed on eliminating compiler hangs, gpf's and internal errors. http://www.digitalmars.com/d/changelog.html
Aug 05 2004
Why don't scalar constructors take parametars? int* ip = new int; *ip == 0; int* ip = new int(5); *ip still == 0; int* ip = new int(5,5,"HA"); *ip still == 0; ? "Walter" <newshound digitalmars.com> wrote in message news:cesu05$1bmc$1 digitaldaemon.com...Focussed on eliminating compiler hangs, gpf's and internal errors. http://www.digitalmars.com/d/changelog.html
Aug 05 2004
Why don't scalar constructors take parametars? int* ip = new int; *ip == 0; int* ip = new int(5); *ip still == 0; int* ip = new int(5,5,"HA"); *ip still == 0;Well, structs don't have constructors. Scalar types seem not to have them, too.
Aug 05 2004
but you can overload OpCall for a struct and for a class to do the same thing you cannot, however, overload OpCall for int unless I'm mistaken so while you could make a common way to create either structs or classes , you have to specialize for all the basic types--and woe to you if you should encounter typedefs. Matthias Becker wrote:Why don't scalar constructors take parametars? int* ip = new int; *ip == 0; int* ip = new int(5); *ip still == 0; int* ip = new int(5,5,"HA"); *ip still == 0;Well, structs don't have constructors. Scalar types seem not to have them, too.
Aug 05 2004
In article <ceu40a$2355$1 digitaldaemon.com>, Daniel Horn says...but you can overload OpCall for a struct and for a class to do the same thing you cannot, however, overload OpCall for int unless I'm mistaken so while you could make a common way to create either structs or classes , you have to specialize for all the basic types--and woe to you if you should encounter typedefs.I, too was wondering why you can't simply go "new int(42)", when its pretty much the most obvious constructor a scalar type could have (IMO). Granted, it's pretty useless outside of templates, but it *looks* correct, right? Frustrating. Now if global operators were overload-able, I suppose this would be the equivalent of simulating a constructor on a built-in scalar type: Which doesn't get us very close: I wouldn't even begin to know how to roll a static 'new' operator for type int. Every time I try, the syntax folds up into something ambiguous. :( Now, not to beat a dead horse, but is this something that a "typedef block" (or "extended typedef" i guess) could help solve? At least then you have something that will /cast/ to an int with no trouble at all: Now what would really do the job is if we were allowed something like this in addition to the aforementioned sytnax: Any thoughts from the crowd? - Pragma
Aug 05 2004
"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cet2hu$1fbm$1 digitaldaemon.com...Why don't scalar constructors take parametars? int* ip = new int; *ip == 0; int* ip = new int(5); *ip still == 0; int* ip = new int(5,5,"HA"); *ip still == 0; ?I'm not sure what the case is for it. The reason for adding the current method is for Matthew's DTL.
Aug 05 2004
"Walter" <newshound digitalmars.com> wrote in message news:cettf5$1u0m$1 digitaldaemon.com..."Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cet2hu$1fbm$1 digitaldaemon.com...That's great, but I agree with the others that one should be able to parameterise the construction. :) I also think structs should have ctors, but that's another issue. (Since we have faux-ctors by opCall, why not acecpt reality and give proper ctors?)Why don't scalar constructors take parametars? int* ip = new int; *ip == 0; int* ip = new int(5); *ip still == 0; int* ip = new int(5,5,"HA"); *ip still == 0; ?I'm not sure what the case is for it. The reason for adding the current method is for Matthew's DTL.
Aug 05 2004
Walter wrote:"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cet2hu$1fbm$1 digitaldaemon.com...Would I be right to figure that this is just syntactic sugar for int* ip = new int[1]; albeit with some generic programming advantage I'm not sure I see?Why don't scalar constructors take parametars? int* ip = new int; *ip == 0;Then what _does_ new int(5) mean at the moment? Or is it just a bug that the compiler accepts it? Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.int* ip = new int(5); *ip still == 0; int* ip = new int(5,5,"HA"); *ip still == 0; ?I'm not sure what the case is for it. The reason for adding the current method is for Matthew's DTL.
Aug 06 2004
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:cevvae$b09$1 digitaldaemon.com...Walter wrote:Yes."Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cet2hu$1fbm$1 digitaldaemon.com...Would I be right to figure that this is just syntactic sugar for int* ip = new int[1]; albeit with some generic programming advantage I'm not sure I see?Why don't scalar constructors take parametars? int* ip = new int; *ip == 0;At the moment, the compiler calls it an error <g>.Then what _does_ new int(5) mean at the moment? Or is it just a bug that the compiler accepts it?int* ip = new int(5); *ip still == 0; int* ip = new int(5,5,"HA"); *ip still == 0; ?I'm not sure what the case is for it. The reason for adding the current method is for Matthew's DTL.
Aug 06 2004
Walter wrote:Focussed on eliminating compiler hangs, gpf's and internal errors. http://www.digitalmars.com/d/changelog.htmlThe changelog doesn't include 0.98. Otherwise, thanks much for the release!
Aug 05 2004
Russ Lewis wrote:Walter wrote:Yes, it do (and it did). Maybe your browser had a problem that made it use the cache? Lars Ivar IgesundFocussed on eliminating compiler hangs, gpf's and internal errors. http://www.digitalmars.com/d/changelog.htmlThe changelog doesn't include 0.98. Otherwise, thanks much for the release!
Aug 05 2004
Walter wrote:Focussed on eliminating compiler hangs, gpf's and internal errors."Fixed Internal error: ..\ztc\cgcod.c 1464" There's more than one cause of this error. The one I posted still fails: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/500 Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 10 2004