Feature Request for 2.0: A way to implement MRV

Downs default_357-line at yahoo.de
Fri Aug 31 10:34:40 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't think this much-longed-for feature (returning tuples) has been
mentioned at DCon, and although I believe it would
be highly useful, I realize it might be too hard to implement (though I
can't exactly see how, if a half-working surrogate can be whipped up
with half a page of 1.0 code).
However, there is an easier way to achieve something sufficiently close
as to be indistuingishable from "real" MRV. This way entails two closely
related features:

First, the redefinition of the comma operator to combine variables into
a new type of tuple: a variable tuple, that being a set of variables
combined under a common name, that a tuple can be assigned to.

Second, and probably more important, the ability to implicit cast a
struct to a tuple.

This would allow us to extend the current solution of returning a
TupleStruct to implicitly assigning that tuple struct to a group of
variables without needing to store their pointers separately, as is
currently done.

Thanks for your consideration.
- --downs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG2FEwpEPJRr05fBERAvxWAJ9zcxnc/Gjn7MgKzAn3r0OQ1iNYzgCfUE8T
h1qoVLIVijYAAdnCHDvpZjg=
=oQjK
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list