D - Tuple
- DeadCow (12/12) Sep 13 2003 What about introduction of tuple in D version 2 ?
- Matthew Wilson (4/16) Sep 13 2003 We're certainly going to need some mechanism when freaching (a new term?...
What about introduction of tuple in D version 2 ?
So function/method take a tuple as parameter and return a tuple.
keyword "void" no longer exists, replaced by "()", the empty tuple.
it will solve many common problems.
// iterate over associative array
foreach( ( char[] key ,char[] value ) ; array.pairs )
printf("%.*s -> %.*s\n" , key, value );
// swap
(a,b) = (b,a);
// mutiple return value
(int x,int y) = getCoord();
-- Nicolas Repiquet
Sep 13 2003
We're certainly going to need some mechanism when freaching (a new term?)
associative containers.
"DeadCow" <deadcow-remove-this free.fr> wrote in message
news:bjvfca$1dkf$1 digitaldaemon.com...
What about introduction of tuple in D version 2 ?
So function/method take a tuple as parameter and return a tuple.
keyword "void" no longer exists, replaced by "()", the empty tuple.
it will solve many common problems.
// iterate over associative array
foreach( ( char[] key ,char[] value ) ; array.pairs )
printf("%.*s -> %.*s\n" , key, value );
// swap
(a,b) = (b,a);
// mutiple return value
(int x,int y) = getCoord();
-- Nicolas Repiquet
Sep 13 2003








"Matthew Wilson" <matthew stlsoft.org>