D - reference modifiers
- imr1984 (2/2) Mar 06 2004 why does D have the reference modifiers in, out, inout, whereas C# has r...
-
Ben Hinkle
(17/17)
Mar 06 2004
"imr1984"
wrote in message - =?ISO-8859-1?Q?Sigbj=F8rn_Lund_Olsen?= (7/28) Mar 08 2004 afaik, in provides a copy of the variable, inout a reference to a
"imr1984" <imr1984_member pathlink.com> wrote in message news:c2cqmc$8nr$1 digitaldaemon.com... what | is the advantage of the D way? from the doc: The reasons to have them are: a.. The function declaration makes it clear what the inputs and outputs to the function are. b.. It eliminates the need for IDL as a separate language. c.. It provides more information to the compiler, enabling more error checking and possibly better code generation. d.. It (perhaps?) eliminates the need for reference (&) declarations. I can't actually find a definition of what in/inout/out do. I guess it's clear from the names and the examples but it would be nice to have more details in there. -Ben
Mar 06 2004
Ben Hinkle wrote:"imr1984" <imr1984_member pathlink.com> wrote in message news:c2cqmc$8nr$1 digitaldaemon.com... what | is the advantage of the D way? from the doc: The reasons to have them are: a.. The function declaration makes it clear what the inputs and outputs to the function are. b.. It eliminates the need for IDL as a separate language. c.. It provides more information to the compiler, enabling more error checking and possibly better code generation. d.. It (perhaps?) eliminates the need for reference (&) declarations. I can't actually find a definition of what in/inout/out do. I guess it's clear from the names and the examples but it would be nice to have more details in there. -Benafaik, in provides a copy of the variable, inout a reference to a variable, and out a reference to a variable that has been set to its default value. But I May Be Wrong. :-o Cheers, Sigbjørn Lund Olsen
Mar 08 2004