View mode: basic / threaded / horizontal-split · Log in · Help
March 03, 2005
in, out, and inout parameters
Have you considered the following perl-inspired syntax for function calls:

( d, e ) = foo( a, b, c );

Where a,b,c are in parameters and d, e are out parameters? Inout parameters
would not be needed 
because you could just write:

( b, c ) = foo( a, b );

This effectively makes b inout. 

This is effectively returning a struct from the function, but saves needing a
separate declaration. This 
style of syntax makes it clear which functions are in and out but putting the
out parameters on the 
other side of the assignment opperator.
March 03, 2005
Re: in, out, and inout parameters
It's been suggested. Many like it.
March 03, 2005
Re: in, out, and inout parameters
"Walter" <newshound@digitalmars.com> wrote in message 
news:d05nki$1ads$2@digitaldaemon.com...
> It's been suggested. Many like it.
>

Heheh, I take it that means you don't?
March 03, 2005
Re: in, out, and inout parameters
"Nick Sabalausky" <z@a.a> wrote in message
news:d05um4$1gcn$1@digitaldaemon.com...
> "Walter" <newshound@digitalmars.com> wrote in message
> news:d05nki$1ads$2@digitaldaemon.com...
> > It's been suggested. Many like it.
> >
>
> Heheh, I take it that means you don't?

I'm not too comfortable with it <g>.
March 03, 2005
Re: in, out, and inout parameters
Hi..

>> Heheh, I take it that means you don't?
> I'm not too comfortable with it <g>.

From a compiler programmer point-of-view? (I mean, would it parse terribly?)

L.
March 10, 2005
Re: in, out, and inout parameters
"Lionello Lunesu" <lio@lunesu.removethis.com> wrote in message
news:d06ho5$255n$1@digitaldaemon.com...
> Hi..
>
> >> Heheh, I take it that means you don't?
> > I'm not too comfortable with it <g>.
>
> From a compiler programmer point-of-view? (I mean, would it parse
terribly?)

(exp, exp) already has a meaning in D, and this would change that in a
context, dependent way. Not impossible, but kinda kludgy. I also just can't
escape a wince looking at it. It just doesn't look right.
Top | Discussion index | About this forum | D home