bodhilogic
An Observation of Unexpected Results
This is not a question, just an observation that is worth noting…
I was getting ‘incorrect’ information on one of my web pages and I discovered this anomoly in Elixir:
iex(1)> 1 > nil
false
iex(2)> 1 < nil
true
iex(3)> -1 > nil
false
iex(4)> -1 < nil
true
I was expecting any non-null value to be greater than null (nil). Apparently that isn’t the case, so just be careful when your code requires a comparison against null (nil).
Most Liked
benwilson512
Author of Craft GraphQL APIs in Elixir with Absinthe
Notably, this is covered in the operator docs: Operators reference — Elixir v1.20.2
4
NobbZ
nil is just an atom as every other atom, with the exception that you can leave off the colon. Nothing more, nothing less.
3
Popular in Discussions
It seems that the more I read, the more I find Elixir users speaking about all the ways that Elixir is not good for x, y, and z use cases...
New
It would be nice to be able to define a redirect from one route to another from the router.ex file. E.g.:
redirect "/", UserController, ...
New
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
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
Just a little information upfront. Generally speaking, if I feel like I need to either break a pipe chain or use an anonymous function in...
New
This is a post to discuss the new Phoenix LiveView functionality.
From Chris’s talk, it appears that they generate all HTML on the serve...
New
Hello everyone,
Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
Another point that Dave drives home in his course is that applications really are components, and you should treat them as such. Not as “...
New
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages.
It also goes on to call Elix...
New
It’s been a while since we’ve had a thread like this, so what better way to kick off the year with :003:
What does being an Elixir user ...
New
Other popular topics
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch.
This project took far...
New
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
Hello everyone,
I try to use an Javascript Event Handler in my root.html.leex file.
Therefore I created a function in the app.js file: ...
New
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: )
Hello all, this is ...
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
Good day to you all.
I have been struggling to get a query involving like and ilike to work.
Can anyone assist me on this, please?
pro...
New
Hi everyone,
One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
Hey,
Just curious what are the main benefits of Elixir compared to Clojure?
When is Elixir more useful than Clojure and vice versa?
Th...
New
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









