chavenor
chavenor

Reputation: 47

What does the ? or ! at the end of an Elixir function do?

What does the ! or ? mean at the end of Elixir functions mean? Is this something special to the language or just to a particular package?

ExAws.S3.list_buckets() |> ExAws.request!()

Upvotes: 2

Views: 1012

Answers (1)

Minh-Khang
Minh-Khang

Reputation: 444

It is Naming Conventions in Elixir.

! calls Trailing bang

A trailing bang (exclamation mark) signifies a function or macro where failure cases raise an exception.

? calls Trailing question mark

Functions that return a boolean are named with a trailing question mark.

Upvotes: 7

Related Questions