Re: [elixir-core:10735] [Proposal] Conditional pipe

2022-02-02 Thread Sven Gehring
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

Re: [elixir-core:9253] [Proposal] Create a sigil_P for PIDs, and use it for inspection

2019-10-24 Thread Sven Gehring
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 < >

Re: [elixir-core:9221] [Proposal] Kernel.if_match/2 - A happy medium between `if` and `case`

2019-10-18 Thread Sven Gehring
> 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

Re: [elixir-core:9048] Proposal: standardize expression to refer to functions with multiple arities (and ExDoc auto-linking)

2019-08-13 Thread Sven Gehring
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

Re: [elixir-core:8940] Re: [Proposal] identity function

2019-07-12 Thread Sven Gehring
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

Re: [elixir-core:8543] [Proposal] Simplify @spec def and @spec defp for efficiency and maintenance purpose

2019-03-14 Thread Sven Gehring
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

Re: [elixir-core:8436] [Proposal] Shorthand to filter tests by multiple line numbers

2019-01-09 Thread Sven Gehring
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

Re: [elixir-core:8388] [Proporsal] Add argument "count times" to assert_receive

2018-12-06 Thread Sven Gehring
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 > ``` >

Re: [elixir-core:8289] [Proposal] Add tags to Elixir core functions

2018-09-14 Thread Sven Gehring
> 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