4 ms·
‘y_’ is too strict in my opinion. You declare lots of variables like y_1 or y_ans when you write any sort of numerical calculation code (like in games or physic
by cyber_kinetist 4y ago
‘y_’ is too strict in my opinion. You declare lots of variables like y_1 or y_ans when you write any sort of numerical calculation code (like in games or physics simulations).
- gavinhoward 4y agoIt seems too strict, but I should clarify: these rules only apply to the C ABI. Declaring variables with those names actually will not conflict if they are done in pure Yao. There's a special way to access the C symbols of functions and types, and it's deliberately different, for this very purpose.
- cyber_kinetist 4y agoAh if that’s only for the C ABI then that’s much better. I still see someone writing numerical algorithms might use y_* as one of the arguments, though the probability is a lot more slim.
- gavinhoward 4y agoThat's true, so I should clarify even further. The restriction isn't on `y[c]_`. It's actually on `y[c]___`. This is because `y` is the package name for the standard library, and the standard library name will always be separated from the rest of the name by 3 or more underscores. Really, the restriction is on 3 or more consecutive underscores in C names, and you can't have have a package name that is either `y`, `yc`, or `YC`. I apologize for the confusion. I was in a hurry and on mobile with the original post.