mikesax

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

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

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.

Where Next?

Popular in Proposals: Ideas Top

munksgaard
I’m copying and pasting this issue from @Terbium-135 here verbatim, because I would be interested in such a feature as well, and because ...
New
Aduril
Hello there, Whenever I setup a new project, there is a small function I always add: reply/1. What does it do? In a LiveView mount, han...
New
dibok
Hi, I’m trying to use phoenix.js in my Qt QML project which has it’s own buildin JavaScript engine. Problem is that (what I googled so f...
New
dvartic
Would there be interest to implement a link/1 that gives to option to operate on other events? So I implemented a simple link/1 function...
New
pelopo
Hi, Oficial docs got this wonderful feature to download the ePub version that we can chuck to our kindles and read it. Now we are in the...
New
victor23k
Hi all! I come with a proposal to create LiveViews inside the shadow DOM. At Doofinder, we have experience building embeddable LiveView a...
New
pinetops
LiveView is by far my favorite web tech, but a few things have been nagging me. So with all the fancy and ill advised elixir tricks I cou...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement