Hi,
Suppose the Repo query example is wrapped in a function that should return
{:ok, [%User{}]} | {:error, :any},
how would one specify what is returned in the "else" case of a "pipe_if"?
Is nothing returned?
I am not sure if I am missing something but all the use-cases I can think
of can be
Definitely support this! Sure there's c.pid/3 but it would be awesome, if
pid's were copy-paste-able
On Thu, 24 Oct 2019 at 21:54, Allen Madsen wrote:
> I'm +1 for this.
>
> Allen Madsen
> http://www.allenmadsen.com
>
>
> On Thu, Oct 24, 2019 at 3:33 PM Kelvin Raffael Stinghen <
>
> There's also `Kernel.match?/2`, which is awkward to use [...]
It's neither more complex to write nor understand than `if_match`.
I would argue it just seems awkward because you haven't used it a lot? --
At least it felt awkward to me the first few times I used it.
Assuming we ruled out
I would be ok with `fun/1,2` but I prefer Christopher's solution using
`fun/{1,2}` since that notation is already used in the core on various
occasions.
On Tue, 13 Aug 2019 at 06:04, eksperimental
wrote:
> Thanks Fernando for bringing this back to life.
> I'm OK. Let's have an agreement so we
I definitely agree that it's better to import it from an additional module
if need be.
If we ignore the Metaprogramming parts, Elixir has a very easy Syntax and
the &(&1) notation is one of the only non-intuitive things to learn.
Compared to other languages, there are virtually no 'weird' syntax
When talking about simplicity, one should not assume that simpler to write
(e.g. shorter code) automatically equals simpler to understand.
In my opinion, this syntax adds more confusion for a number of reasons:
- As Andrea mentioned, including type definitions in the function header
very likely
I'd personally prefer the syntax proposed by José.
Also, I would argue that allowing for multiple files introduces quite a bit
of unnecessary complexity.
I never had the need to run only specific tests in multiple files but I
think if it is really necessary for
someone, you can always still
Hi,
Assuming you want to receive the same message, wouldn't this only be
slightly shorter than using
```
for _ <- 1..3, do: assert_receive({"msg", _})
```
- Sven
On Thu, 6 Dec 2018 at 14:25 Anastasiya Dyachenko
wrote:
> Hi,
> In tests often face with need to write code like
> ```
>
> Point being, you wouldn't put a function for integers in the `String`
module, so why would you put functions that convert data [...]
Well, Elixir doesn't. The only integer related functions in the String
modules are conversion functions, which convert from/to Strings.
If I want to convert