odin-lang / odin-lang.org

http://odin-lang.org
19 stars 80 forks source link

Update overview.md #187

Closed Poryg1 closed 4 months ago

Poryg1 commented 4 months ago

I aim to make the "type switches" section clearer to a newbie.

As it stands: Variable 'v' changes types in a messy way: 'union' chapter uses: 'v := Value' 'type switches' then uses: 'value := Value' and 'switch v in value'. Then in the #no-nil tag, the v jumps back to "v := Value". In two instances, 'v' is an instance of Value. In the third one, it's not an instance of Value, but actually value of an instance of Value. The type discrepancy can be confusing, so I unified the types.

It's also not 100% clear what exactly the "v" even is in the type switches section. The description spoke about "types, not values", which may make it look like "v" is a type representation when it's actually value. So I:

gingerBill commented 4 months ago

All you have done is changed the name of variable and changed text in parentheses into a subclause.

This does not clear anything up whatsoever.