Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
boywitharupee
on Sept 7, 2022
|
parent
|
context
|
favorite
| on:
Zig, the Small Language
For unused vars you can do this and the compiler will ignore it.
_ = my_unsed_var;
unclad5968
on Sept 8, 2022
[–]
Doesn't that entirely defeat the purpose of having the compiler not allow unused variables.
dolmen
on Sept 12, 2022
|
parent
|
next
[–]
Add a pre-commit hook to forbid use of '_ ='.
grep '$ *_ ?=' *
pverghese
on Sept 9, 2022
|
parent
|
prev
[–]
Not exactly. Because a quick grep of _ = gives you the variables which are needed to be checked before whether used or unused
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
_ = my_unsed_var;