Article on Tuples
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Sat Nov 18 10:25:21 PST 2006
Walter Bright wrote:
> http://www.digitalmars.com/d/tuple.html
You have the misspell "evaluatible" there.
Also, for what I see in this article, the
http://www.digitalmars.com/d/template.html spec doc is a bit incomplete.
No mention that Tuples can be used to "declare variables", only
parameters. I also found the statement "A Tuple is not a type," a bit
misleading since it seems Tuples are heading in a direction that makes
them *somewhat* a type (you can declare variables with them, and even
return them from functions).
Another potentially misleading statement is the:
"Tuples are static compile time entities, there is no way to dynamically
change, add, or remove elements."
It's true for most tuples, but not quite so for a tuple-variable, since
you can change the elements of a tuple-variable.
Speaking of tuple variables, man, that is deep stuff :P . It took me a
while to grok that and to come up with a conceptualization that made
sense and fit adequately. I'm thinking that tuple-variables are somewhat
like anonymous structs, they are tuples of values, which happen to be
Lvalues too, unlike the other expression/value templates.
--
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d-announce
mailing list