Re: C# Language Proposal for 'out' Parameters
From: Bruno Jouhier [MVP] (bjouhier_at_club-internet.fr)
Date: 04/14/04
- Next message: Dana: "XML reading database null value as an empty string """
- Previous message: cs: "Re: network stream"
- In reply to: Jon Skeet [C# MVP]: "Re: C# Language Proposal for 'out' Parameters"
- Next in thread: Daniel O'Connell [C# MVP]: "Re: C# Language Proposal for 'out' Parameters"
- Reply: Daniel O'Connell [C# MVP]: "Re: C# Language Proposal for 'out' Parameters"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Apr 2004 21:13:10 +0200
> If the assignment isn't made because an exception has been thrown, I
> think that's fine - that's what copyout means (as I understand it) -
> not that every time the assignment is made, the property is written.
I agree, and I don't fully understand Daniel's point.
a call like
Foo(inout expression) // copyin/copyout semantics
behaves "exactly" like:
expression = Foo(expression)
and a call like
Bar(out expression) // copyout semantics
behaves "exactly" like:
expression = Bar()
We write this all the time, and we don't have any real issue with these
constructs. So, I don't see why copyin/copyout argument passing would create
a new problem (Daniel, I don't understand if your issue is on the caller or
callee's side but I don't see any real issue on the callee's side either).
On the other hand, I think that copyin/copyout would be slightly simpler to
explain than "ref" semantics and we would not get all these posts from
people who get confused between "passing by reference" and "passing the
reference" (fortunately Jon has a very good page on this one).
Bruno.
- Next message: Dana: "XML reading database null value as an empty string """
- Previous message: cs: "Re: network stream"
- In reply to: Jon Skeet [C# MVP]: "Re: C# Language Proposal for 'out' Parameters"
- Next in thread: Daniel O'Connell [C# MVP]: "Re: C# Language Proposal for 'out' Parameters"
- Reply: Daniel O'Connell [C# MVP]: "Re: C# Language Proposal for 'out' Parameters"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|