On Mar 23, 2007, at 10:13 PM, Chris Little wrote:

> As long as the first return values is an array RB is only going to  
> let you
> assign it or pass it to another method/function with the same type.  
> If the
> return values are something else though it will let assignment/ 
> passing take
> place through conversion. If I had to change one of these multi-return
> functions I probably have to manually search each call out instead of
> letting the compiler do the work for me. I like RB being strongly  
> typed. If
> the function returns multiple values then you should have to do  
> something
> with each one.

I'm afraid I'm confused. The first return type can be auto-converted.  
I'm not sure why this is a problem. And any conversion issue applies  
also to a single return function. A multi-return function given only  
a single lvalue behaves in all ways like a single return function.  
That's what makes these semantics work without any ambiguity.

I'd also like to state that any developer who for some religious  
reason didn't like multiple return values wouldn't have to use them,  
any more than they have to use ByRef now. But insofar as we live in a  
world where we *have* ByRef, perhaps those of you opposed to it on  
for said weird religious reason would at least acquiesce to it as a  
better alternative to ByRef.

The closest I've seen to an actual stated objection is that the  
multiple return types are not self-documenting. To this, I would say  
that a developer who uses the feature with care would not present  
their users with a serious problem. Any tool can be abused.

Once again, an excellent use case is Events. Currently, we have  
ListBox.CompareRows, in which you have to set a value in a ByRef  
argument to indicate whether you actually intend to override the  
default behavior. Seems to me it would be better if you would just be  
allowed to return a second Boolean result in that case. Used with  
restraint in such situations, this seems clearly better than ByRef.

If you can pass multiple values *in* to a method, why should you not  
be allowed to pass multiple values out? What is privileged about  
passing only one value back?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to