digitalmars.D - Q 4 W: Declarative M.I, for concepts
- Matthew (11/11) Feb 06 2006 Just wondered whether there's a technical reason why D could not support
- Kris (4/16) Feb 06 2006 I'm not sure how far you want to take it, but is it not possible to do m...
- Matthew (9/29) Feb 06 2006 Can interfaces declare member constants?
- Kris (11/13) Feb 06 2006 I think so. Both const and enum can be used. Static-finals seems to be o...
- Sean Kelly (10/12) Feb 06 2006 I proposed concepts recently but didn't get a reply. Here's a link:
- Matthew (7/18) Feb 06 2006 C++.
- Walter Bright (4/5) Feb 06 2006 I haven't studied the issue, and so don't have anything intelligent to s...
Just wondered whether there's a technical reason why D could not support multiple inheritance for the sole purpose of declaring concepts, a la C++. I'm *NOT* talking about any implementation of any sort here, only type and possibly member constants (which would be resolved at compile-time; no reflection-like complexities suggested). I'm not interested, at this stage, in whether anyone thinks it's a good or bad idea. I just want to know whether it's possible within the current object model of D, or whether it would be possible to add it without disturbing anything or bringing along any of the nasty baggage from "full" M.I. Walter?
Feb 06 2006
I'm not sure how far you want to take it, but is it not possible to do much of that (right now) via multiple interfaces? "Matthew" <matthew hat.stlsoft.dot.org> wrote in message news:ds8j7h$q2i$1 digitaldaemon.com...Just wondered whether there's a technical reason why D could not support multiple inheritance for the sole purpose of declaring concepts, a la C++. I'm *NOT* talking about any implementation of any sort here, only type and possibly member constants (which would be resolved at compile-time; no reflection-like complexities suggested). I'm not interested, at this stage, in whether anyone thinks it's a good or bad idea. I just want to know whether it's possible within the current object model of D, or whether it would be possible to add it without disturbing anything or bringing along any of the nasty baggage from "full" M.I. Walter?
Feb 06 2006
Can interfaces declare member constants? Also, don't they grow the objects footprint? (There are not rhetorical. I've been moi D for so long I have no idea.) "Kris" <fu bar.com> wrote in message news:ds8jjd$qel$1 digitaldaemon.com...I'm not sure how far you want to take it, but is it not possible to domuchof that (right now) via multiple interfaces? "Matthew" <matthew hat.stlsoft.dot.org> wrote in message news:ds8j7h$q2i$1 digitaldaemon.com...C++.Just wondered whether there's a technical reason why D could not support multiple inheritance for the sole purpose of declaring concepts, a laandI'm *NOT* talking about any implementation of any sort here, only typeorpossibly member constants (which would be resolved at compile-time; no reflection-like complexities suggested). I'm not interested, at this stage, in whether anyone thinks it's a good"full"bad idea. I just want to know whether it's possible within the current object model of D, or whether it would be possible to add it without disturbing anything or bringing along any of the nasty baggage fromM.I. Walter?
Feb 06 2006
"Matthew" <matthew hat.stlsoft.dot.org> wrote...Can interfaces declare member constants?I think so. Both const and enum can be used. Static-finals seems to be ok too.Also, don't they grow the objects footprint?I've seen some odd results in this regard. It seems that deep Object hierarchies combined with interfaces generates notable baggage. I switched 3 of the key Mango interfaces to abstract-classes instead, and noted a sizeable difference in the resultant executables. I suspect there's a relationship to the extent of the interfaces, but don't really know. The upshot is that small interfaces in shallow hierarchies are probably nothing to be bothered about. Perhaps Walter might look into this?
Feb 06 2006
Matthew wrote:Just wondered whether there's a technical reason why D could not support multiple inheritance for the sole purpose of declaring concepts, a la C++.I proposed concepts recently but didn't get a reply. Here's a link: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/32178 Basically, I'm not sure whether the best approach is to shoehorn concept support into the MI model, particularly since it seems a lot more common to use scoped templates than to use class templates. Rather, I would like to see an actual language extension that ties into the specialization mechanism, much like the C++ 0x proposals suggest. I think this would make for a cleaner and more flexible design. Sean
Feb 06 2006
"Sean Kelly" <sean f4.ca> wrote in message news:ds8nac$t0v$1 digitaldaemon.com...Matthew wrote:C++.Just wondered whether there's a technical reason why D could not support multiple inheritance for the sole purpose of declaring concepts, a laI proposed concepts recently but didn't get a reply. Here's a link: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/32178I know. It's marked unread and in red in my newsreader; I'm yet to get to a point where I can make a sensible reply.Basically, I'm not sure whether the best approach is to shoehorn concept support into the MI model, particularly since it seems a lot more common to use scoped templates than to use class templates. Rather, I would like to see an actual language extension that ties into the specialization mechanism, much like the C++ 0x proposals suggest. I think this would make for a cleaner and more flexible design.Sure. I'm just weighing options at the moment. (Anything but work on the last 4 difficult chapters of my sodding book <g>)
Feb 06 2006
"Matthew" <matthew hat.stlsoft.dot.org> wrote in message news:ds8j7h$q2i$1 digitaldaemon.com...Walter?I haven't studied the issue, and so don't have anything intelligent to say about it. I can say, though, that this would be very unlikely to get in 1.0.
Feb 06 2006