May 27, 2004
In article <c95jhs$1n8c$1@digitaldaemon.com>, Kris says...
>
>If I understand you correctly, you could do the same thing using abstract-base-classes and/or Interfaces (via well documented patterns); which would offer far more robustness than what appears to be a bunch of loosely-bound global variables and methods ...
>
>Just my 2 pence worth.
>
>- Kris

It may be cleaner and better for many cases.  But for some cases, looser semantics may be just what the doctor ordered.  I think I need to take some time and play with the feature before I can give a better example.

Kevin



May 27, 2004
Yeah, you may be right.

My post perhaps came across as more negative than was intended, as I have this nagging feeling that unfettered use of mixins may lead to hideous convolutions. Remember those proud competitions that folk used to have for the most convoluted usage of the CPP? Well, the hairs on the back of my neck stand up when I think about how D mixins might enter that ring as a serious contender <g>

- Kris


"Kevin Bealer" <Kevin_member@pathlink.com> wrote in message news:c95o7v$1u4q$1@digitaldaemon.com...
> In article <c95jhs$1n8c$1@digitaldaemon.com>, Kris says...
> >
> >If I understand you correctly, you could do the same thing using abstract-base-classes and/or Interfaces (via well documented patterns); which would offer far more robustness than what appears to be a bunch of loosely-bound global variables and methods ...
> >
> >Just my 2 pence worth.
> >
> >- Kris
>
> It may be cleaner and better for many cases.  But for some cases, looser semantics may be just what the doctor ordered.  I think I need to take
some time
> and play with the feature before I can give a better example.
>
> Kevin
>
>
>


May 27, 2004
>>>I've the same kinda feeling.  It feels like macros with a different syntax.  I mean essentially a mixin is a copy/paste tool.
>>>
>>
>>So are templates. So what?
>>
>>D has a powerful compile-time meta-language. The purpose of this meta-language is to do all kinds of copy-and-paste operations before the real compilation is started.
>>
>>Unlike the CPP, this source-code processing cannot by fully split out of the compiling process. Unlike CPP, it uses the same namespace as the compiler, but it offers most of the power of the CPP.
>>
>>C++ had two steps of "preprocessing": first the CPP, then the template instatiation (which is basically lots of copy-and-paste as well) then the real compilation.
>>
>>Mixins basically *are* macros with a different syntax. But through that syntax, they are far better integrated into the language itself then CPP-macros ever were.
>> 
>>
> Sure but I've a feeling that they may lead to some places where we don't want to go.  I'm not quite sure where yet.

Situations like this, I always like to quote Dr. Graham...

"There is one thing more important than brevity to a hacker: being able to do what you want. In the history of programming languages a surprising amount of effort has gone into preventing programmers from doing things considered to be improper. This is a dangerously presumptuous plan. How can the language designer know what the programmer is going to need to do? I think language designers would do better to consider their target user to be a genius who will need to do things they never anticipated, rather than a bumbler who needs to be protected from himself. The bumbler will shoot himself in the foot anyway. You may save him from referring to variables in another package, but you can't save him from writing a badly designed program to solve the wrong problem, and taking forever to do it."

http://www.paulgraham.com/popular.html

Besides, aren't inline functions a kind of copy/paste tool as well? Not to mention *inheritance*!

-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.
May 28, 2004
Antti Sykäri wrote:

> Besides, aren't inline functions a kind of copy/paste tool as well? Not to mention *inheritance*!

True, but they are rather safe in terms of semantics. They have limited potential compared to mixins, which don't fix much semantics at all.
May 31, 2004
> Yeah, you may be right.
>
> My post perhaps came across as more negative than was intended, as I have this nagging feeling that unfettered use of mixins may lead to hideous convolutions. Remember those proud competitions that folk used to have for the most convoluted usage of the CPP? Well, the hairs on the back of my
neck
> stand up when I think about how D mixins might enter that ring as a
serious
> contender <g>


If one tries not to have convoluted usage of mixins as a major design goal of ones real-life programs perhaps the problem isn't so great. ;-)  Of course there's nothing preventing people from using stuff in a way they're not supposed to but then they must either know what they're doing or learn the hard way. :-)

> - Kris


June 02, 2004
"davepermen" <davepermen@hotmail.com> wrote in message news:c931jl$5hd$1@digitaldaemon.com...
> mixin Addable to get in opAdd, opAddAsign, and such.. mixin Comparable,
for
> opLess, opLEqual, opEqual, opGEqual, opGreater, opGeek..

Er, for D, that would be opNerd, not opGeek.


June 03, 2004
why not support both? :D

i thought always "damn", none reads my idea.

now big WALTER HIMSELF comes, and replies! i thought YEAH YEAH YEAH, and then, he talks about the geek/nerd operator..

oh well.. :D

"Walter" <newshound@digitalmars.com> schrieb im Newsbeitrag news:c9lnl6$eei$1@digitaldaemon.com...
>
> "davepermen" <davepermen@hotmail.com> wrote in message news:c931jl$5hd$1@digitaldaemon.com...
> > mixin Addable to get in opAdd, opAddAsign, and such.. mixin Comparable,
> for
> > opLess, opLEqual, opEqual, opGEqual, opGreater, opGeek..
>
> Er, for D, that would be opNerd, not opGeek.
>
>


June 06, 2004
davepermen wrote:

>why not support both? :D
>
>i thought always "damn", none reads my idea.
>
>now big WALTER HIMSELF comes, and replies! i thought YEAH YEAH YEAH, and
>then, he talks about the geek/nerd operator..
>
>oh well.. :D
>  
>
Pardon, can you speak up ;)

-- 
-Anderson: http://badmama.com.au/~anderson/
June 06, 2004
hm?

"J Anderson" <REMOVEanderson@badmama.com.au> schrieb im Newsbeitrag news:c9uc69$10ct$1@digitaldaemon.com...
> davepermen wrote:
>
> >why not support both? :D
> >
> >i thought always "damn", none reads my idea.
> >
> >now big WALTER HIMSELF comes, and replies! i thought YEAH YEAH YEAH, and then, he talks about the geek/nerd operator..
> >
> >oh well.. :D
> >
> >
> Pardon, can you speak up ;)
>
> -- 
> -Anderson: http://badmama.com.au/~anderson/


1 2 3 4
Next ›   Last »