mikesax
Suggestion: def _unused_function do
I was writing code that included a function I would call later (so it wasn’t called yet). I got a warning, and I thought I could put an underscore before the function name, the way it works for variables, but that didn’t work. While writing @compile :nowarn_unused_functions isn’t a terrible hardship, it would be nice to simply write:
def _unused_function do
end
Most Liked
LostKobrakai
I’m not sure I see the use in this. Not using a variable have legitimate reasons to exist in elixir programs. E.g. a certain parameter might only be used some parts of the branched execution of multiple function heads.
An unused private function has no such reason to exist.
Also it’s just a warning, which can easily be ignored until a chunk of code is completed. E.g. zig actually refuses to compile if you have e.g. unused variables.
sodapopcan
Me too, but I just comment them out. Best solved with your editor, I’d say! Depending on your editor, you could look for something that gives you “comment out function” with a simple key combo.








