March 18, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | No man . Vote for No. syncronized { Aye : 1 Nay : 5 } As I know , in for pass by value , in out for pass by reference , and out is needed for C++ /even Java still need -> D must keep it .( please anyone explain Pass reference by Value I really don't understand about term name Pass-Reference-By-Value in Java ). In article <c3a9ch$7c$2@digitaldaemon.com>, Matthew says... > >I have to say nay, because I don't understand the point of the proposal. Please explain. > >synchronized >{ > Aye: 1 > Nay: 4 >} > >"Andrew Edwards" <remove_ridimz@remove_yahoo.com> wrote in message news:opr40tpklzs6zaqn@news.digitalmars.com... >> On Wed, 17 Mar 2004 11:58:03 -0800, C <dont@respond.com> wrote: >> >> > On Wed, 17 Mar 2004 17:36:23 +0000 (UTC), Jon <Jon_member@pathlink.com> >> > wrote: >> > >> > synchronized { >> > >> > Aye: 1 >> > Nay: 2 >> > >> > } >> > >> > >> > >> >> Aye: 1 >> Nay: 3 > > |
March 18, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | imr1984 wrote: >change the score when you reply: > >Aye: 1 >Nay: 0 > > > > Nay reference is a C++ thing. In/out is much better. -- -Anderson: http://badmama.com.au/~anderson/ |
March 19, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | imr1984 wrote:
> change the score when you reply:
>
> Aye: 1
> Nay: 0
>
>
No. in/out/inout are completely descriptive as to what they can be used for, while 'ref' only tells you what the parameter *is*. Essentially, in/out/inout leads to higher clarity in code. The only good cause for 'ref', as I can see it, is similarity to other languages. That, alone, should never be enough.
Cheers,
Sigbjørn Lund Olsen
|
March 19, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vathix | Vathix wrote:
> imr1984 wrote:
>
>> change the score when you reply:
>>
>> Aye: 1
>> Nay: 0
>>
>>
>
> in/out/inout aid the programmer and possibly allow optimizations. But sometimes you only need an input or output reference depending on runtime values, that's there ref would come in handy. I think it would be nice to add it.
And therefore ... "inout"!
*...and the crowd gasped in amazement*
Cheers,
Sigbjørn Lund Olsen
|
March 19, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Minkov | Ilya Minkov wrote: > Vathix schrieb: > >> in/out/inout aid the programmer and possibly allow optimizations. But sometimes you only need an input or output reference depending on runtime values, that's there ref would come in handy. I think it would be nice to add it. > > > I simply don't get it what for??? We have inout. We have pointer. What else would be ref but an alias to inout???? > > -eye I thought with out and inout the function is forced to set the value, with ref (as a safe alternative to a pointer) you could do it based on runtime values. Sorry, I guess I'm wrong. -- Christopher E. Miller |
March 22, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to imr1984 | Aye: 1
Nay: 6
However, I do miss the constant reference from C++.
Stewart.
--
My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
|
March 22, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | As do I, but it's a no-dicer. DBC helps a lot, but it's still doing runtime checks for compile violations. But I am prepared to defer to Walter's wisdom that the benefit is not worth the cost, and focus on other things. :) "Stewart Gordon" <smjg_1998@yahoo.com> wrote in message news:c3mdfj$21cp$1@digitaldaemon.com... > Aye: 1 > Nay: 6 > > However, I do miss the constant reference from C++. > > Stewart. > > -- > My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit. |
March 22, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | Matthew wrote: >As do I, but it's a no-dicer. DBC helps a lot, but it's still doing runtime >checks for compile violations. > >But I am prepared to defer to Walter's wisdom that the benefit is not worth >the cost, and focus on other things. :) > > I'm undecided about the const issue. It gets really hairy when your forced to use constant functions (ie in function pointers from some other library) when u shouldn't be and then can't call anything else but constant functions (which of course excludes much of c's stl -> many of which could have constant behaviour). Many people don't follow the convention because of issues such as this one which makes the problem worse. -- -Anderson: http://badmama.com.au/~anderson/ |
March 22, 2004 Re: [VOTE]: Should the 'in/out/inout' parameter modifiers be changed to 'ref' | ||||
---|---|---|---|---|
| ||||
Posted in reply to J Anderson | "J Anderson" <REMOVEanderson@badmama.com.au> wrote in message news:c3n4ol$5sk$1@digitaldaemon.com... > Matthew wrote: > > >As do I, but it's a no-dicer. DBC helps a lot, but it's still doing runtime > >checks for compile violations. > > > >But I am prepared to defer to Walter's wisdom that the benefit is not worth > >the cost, and focus on other things. :) > > > > > I'm undecided about the const issue. It gets really hairy when your forced to use constant functions (ie in function pointers from some other library) when u shouldn't be and then can't call anything else but constant functions (which of course excludes much of c's stl -> many of which could have constant behaviour). Many people don't follow the convention because of issues such as this one which makes the problem worse. I'll have to take your word (and that of many other commentators) for it. I've never had any problem with const, and I've never worked with anyone that had any problem with it either. I am still unable to understand what all the fuss is about, and I simply think const is great. |
Copyright © 1999-2021 by the D Language Foundation