www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Tuple assignment

reply bearophile <bearophileHUGS lycos.com> writes:
Juanjo Alvarez:

 What is exactly false on what I said?

This syntax you have explained doesn't do what you think it does: a, b, c, _ = ('tuple', 'of', 'three') See: http://ideone.com/LG1De The _ is just the name of a normal identifier (in the interactive shell it refers to the last result). Bye, bearophile
Oct 08 2010
next sibling parent Juanjo Alvarez <fake fakeemail.com> writes:
On Fri, 08 Oct 2010 16:11:53 -0400, bearophile 
<bearophileHUGS lycos.com> wrote:
 This syntax you have explained doesn't do what you think it does:
 a, b, c, _ = ('tuple', 'of', 'three')

That was a typo, I meant to write: a, b, _ = ('tuple', 'of', 'three')
Oct 08 2010
prev sibling parent Leandro Lucarella <luca llucax.com.ar> writes:
Juanjo Alvarez, el  9 de octubre a las 04:02 me escribiste:
 On Fri, 08 Oct 2010 16:11:53 -0400, bearophile
 <bearophileHUGS lycos.com> wrote:
This syntax you have explained doesn't do what you think it does:
a, b, c, _ = ('tuple', 'of', 'three')

That was a typo, I meant to write: a, b, _ = ('tuple', 'of', 'three')

Even then, the _ identifier is not special all :) -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- Me encanta el éxito; por eso prefiero el estado de progreso constante, con la meta al frente y no atrás. -- Ricardo Vaporeso. Punta del Este, Enero de 1918.
Oct 08 2010