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

martosaur
TL;DR Logger.Translator acts as a global filter and swallows structure of some OTP reports, which some logger handlers could benefit from...
New
kip
Sumary of proposal DateTime.from_iso8601/3 adjusted to: set all numeric fields to the values as parsed (not shifted to UTC), preservi...
New
tristan
This is a cross post from the Erlang Forums. ETS table `select_take` - Proposals: Ideas - Erlang Programming Language Forum - Erlang Foru...
New
pdgonzalez872
Hi! There has been some discussion about hiring/jobs on here and I thought about running this by everyone. I wanted to try to help recr...
New
mikesax
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 u...
New
dli
Ecto currently supports some data-modifying WITH statements / CTEs for Postgres: Options: […] :operation - one of :all , :update_all ,...
New
RobinBoers
Hi. We had a few issues in our project regarding mix tasks, where we expected the items in the @requirements module tag to have been exec...
New
7rans
I implemented Access behavior for a struct today. Pseudo-code… defmodule MyStruct do defstruct data: %{} @behaviour Access # ... ...
New
Oliver
One common problem we face in constructing lists is that there is (AFAIK) no support for conditionally inserting members into list declar...
New
pejrich
I propose adding compact_map/2 to the Enum module. What is it? Sometimes you want to map over a collection, but sometimes you want to ma...
New

Other popular topics Top

JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement