Thread overview
in, out, and inout parameters
Mar 03, 2005
Matthew Gordon
Mar 03, 2005
Walter
Mar 03, 2005
Nick Sabalausky
Mar 03, 2005
Walter
Mar 03, 2005
Lionello Lunesu
Mar 10, 2005
Walter
March 03, 2005
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
It's been suggested. Many like it.


March 03, 2005
"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
"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
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
"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.