Why is everything in court?

So, I found out that any variable or constant in swift is a tuple. For example, the variable x below is a tuple

var x = 15

and the following statement is valid and evaluates the value of x as the first element of the tuple

x.0.0.0.0.0.0.0.0.0.0.0           // outputs 15

I wonder why the language was built for this. Any known (or extraterrestrial) use case?

+4
source share
1 answer

I do not know if this might be the correct answer , but it gives some information and shows that this is a known thing. Check out this 2 sections:

Special: 1-tuple

Bonus track: tuples all the way

0
source

Source: https://habr.com/ru/post/1616164/


All Articles