# \#basics

**URL:** https://forum.elixirforum.com/tag/basics/2153.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [How are functions scoped within ExUnit describe blocks?](https://forum.elixirforum.com/t/how-are-functions-scoped-within-exunit-describe-blocks/37655)

<div class="topic-metadata">

**Author:** [@soullpoint](https://forum.elixirforum.com/u/soullpoint)\
**Replies:** 4\
**Last updated:** [May 4, 2023, 12:38pm UTC](https://forum.elixirforum.com/t/how-are-functions-scoped-within-exunit-describe-blocks/37655 "2023-05-04T12:38:28Z")

</div>

Hi, I was wondering if anyone could help clarify something for me. This is more due to my lack of understanding than anything else. Suppose I had a module for testing, with two describe blocks. I declare a function wit…

---

## [Adding new function to model module: Undefined function: Expected MyModule to define such a function or for it to be imported, but none are available](https://forum.elixirforum.com/t/adding-new-function-to-model-module-undefined-function-expected-mymodule-to-define-such-a-function-or-for-it-to-be-imported-but-none-are-available/54285)

<div class="topic-metadata">

**Author:** [@chrisdel101](https://forum.elixirforum.com/u/chrisdel101)\
**Replies:** 4\
**Last updated:** [March 3, 2023, 5:06pm UTC](https://forum.elixirforum.com/t/adding-new-function-to-model-module-undefined-function-expected-mymodule-to-define-such-a-function-or-for-it-to-be-imported-but-none-are-available/54285 "2023-03-03T17:06:27Z")

</div>

I’ve use the generators to create a project. Inside the project schema when I add a new function to the others that exist I get an error. In registration\_changeset I call validate\_email (given by the generartor) and co…

---

## [Calling function from within same module it's declared is undefined/is not available](https://forum.elixirforum.com/t/calling-function-from-within-same-module-its-declared-is-undefined-is-not-available/54198)

<div class="topic-metadata">

**Author:** [@chrisdel101](https://forum.elixirforum.com/u/chrisdel101)\
**Replies:** 10\
**Last updated:** [March 1, 2023, 4:17pm UTC](https://forum.elixirforum.com/t/calling-function-from-within-same-module-its-declared-is-undefined-is-not-available/54198 "2023-03-01T16:17:08Z")

</div>

Redoing this to be more clear: Question How can I call a function inside a module? File: test.exs defmodule MyModule do def sum(a, b) do a + b end MyModule.sum(1,1) # or sum(1,1) end elixir test.exs : \*…

---

## [How to use conditional inside Enum iterator - error:cannot invoke remote function Kernel.elem/2 inside a match](https://forum.elixirforum.com/t/how-to-use-conditional-inside-enum-iterator-error-cannot-invoke-remote-function-kernel-elem-2-inside-a-match/54175)

<div class="topic-metadata">

**Author:** [@chrisdel101](https://forum.elixirforum.com/u/chrisdel101)\
**Replies:** 5\
**Last updated:** [February 27, 2023, 11:30pm UTC](https://forum.elixirforum.com/t/how-to-use-conditional-inside-enum-iterator-error-cannot-invoke-remote-function-kernel-elem-2-inside-a-match/54175 "2023-02-27T23:30:48Z")

</div>

When first or last item in list is found, do something. Even simply trying to check for this fails with error. How can I do it? Below is checking if item tuple index 1 is 0 (first item in list). l = \[owner: 0, develope…

---

## [Handling different Joken error messages with json()](https://forum.elixirforum.com/t/handling-different-joken-error-messages-with-json/53770)

<div class="topic-metadata">

**Author:** [@ghenry](https://forum.elixirforum.com/u/ghenry)\
**Replies:** 5\
**Last updated:** [February 8, 2023, 10:14pm UTC](https://forum.elixirforum.com/t/handling-different-joken-error-messages-with-json/53770 "2023-02-08T22:14:06Z")

</div>

Hi all, A beginner here. I have the following plug code from an example Auth0 repo: def call(conn, \_default) do with {:ok, token} when is\_binary(token) \<- get\_token(conn), {:ok, claims} \<- Token.verify\_an…

---

## [Enum.drop\_every - make it make sense](https://forum.elixirforum.com/t/enum-drop-every-make-it-make-sense/49504)

<div class="topic-metadata">

**Author:** [@frellus](https://forum.elixirforum.com/u/frellus)\
**Replies:** 5\
**Last updated:** [August 11, 2022, 5:32pm UTC](https://forum.elixirforum.com/t/enum-drop-every-make-it-make-sense/49504 "2022-08-11T17:32:33Z")

</div>

So Enum.drop makes perfect sense to me - it drops the element at the exact position I think it should and returns a list. Enum.drop\_every has me tearing my hair out, so there’s something I’m meant to understand which I’…

---

## [Using Enum or Stream to pass through first n elements and map the rest](https://forum.elixirforum.com/t/using-enum-or-stream-to-pass-through-first-n-elements-and-map-the-rest/35261)

<div class="topic-metadata">

**Author:** [@stevensonmt](https://forum.elixirforum.com/u/stevensonmt)\
**Replies:** 5\
**Last updated:** [November 1, 2020, 4:48pm UTC](https://forum.elixirforum.com/t/using-enum-or-stream-to-pass-through-first-n-elements-and-map-the-rest/35261 "2020-11-01T16:48:31Z")

</div>

I’m used to Rust where iterators have a ton of handy functions. What I’d like to do is equivalent to the following Rust code: my\_iterator.iter() .skip(n) .map(|x| my\_fun(x)) .collect() I…

---

## [How to check if result of division is a whole number?](https://forum.elixirforum.com/t/how-to-check-if-result-of-division-is-a-whole-number/29464)

<div class="topic-metadata">

**Author:** [@Palindrome](https://forum.elixirforum.com/u/Palindrome)\
**Replies:** 1\
**Last updated:** [February 27, 2020, 11:15pm UTC](https://forum.elixirforum.com/t/how-to-check-if-result-of-division-is-a-whole-number/29464 "2020-02-27T23:15:56Z")

</div>

Howdy :slight\_smile: How do I check if a result of a division is a whole number? For example: 2 / 1 = 1 (A whole number). Or another example: 1 / 2 = 0,5 (Not a whole number). The first thing I tried was is\_float and…

---

## [Getting Started with Elixir 1.10](https://forum.elixirforum.com/t/getting-started-with-elixir-1-10/28989)

<div class="topic-metadata">

**Author:** [@tmartin8080](https://forum.elixirforum.com/u/tmartin8080)\
**Replies:** 2\
**Last updated:** [February 10, 2020, 8:03pm UTC](https://forum.elixirforum.com/t/getting-started-with-elixir-1-10/28989 "2020-02-10T20:03:55Z")

</div>

An 8-Part Series on Getting Started with Elixir: Overview Elixir Data Types Variables and Operators Pattern Matching Elixir Functions Elixir Control Flow Pipe Operator Modules
