axelson

axelson

Scenic Core Team

ElixirConf US 2018 Lightning Talk – Kernel functions you’ll want to start using – Moxley Stratton (@moxley)

All talks are available in the ElixirConf US 2018 Talks List or via the elixirconf2018 tag

Showing Posts 1 to 2

AstonJ

AstonJ

Nice talk!

I wonder how many people opt to use shortcuts like those mentioned?

Such as:

List.first(items)

vs

hd(items)

and:

Enum.count(items)

vs

length(items)
OvermindDL1

OvermindDL1

Depends on the types. List.first([]) will return nil but hd([]) will throw an error, and Enum.count(...) works on any enumerable and length/1 only works on lists (byte_size or bit_size for binaries and map_size for maps). Plus hd/length work in guards where the others do not.

But I use the type-specific forms when at all possible to help ensure proper types. :slight_smile:

— All posts loaded —

Where Next? Top

Trending in Talks Top

Other Trending Topics Top

KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews