Re: [elixir-core:10529] Is `@__struct__` an implementation detail or a public API?

2021-11-19 Thread 'eksperimental' via elixir-lang-core
Hi Marten, You will find this PR interesting https://github.com/elixir-lang/elixir/issues/10352 Cheers, - Eks On Fri, 19 Nov 2021 14:00:40 -0800 (PST) "w...@resilia.nl" wrote: > Hi all! > > I recently needed to check what fields for a struct were defined (if > any) for a particular module, at

Re: [elixir-core:10530] Is `@__struct__` an implementation detail or a public API?

2021-11-19 Thread 'eksperimental' via elixir-lang-core
Sorry, that was the issue. This is the actual PR https://github.com/elixir-lang/elixir/pull/10354 On Fri, 19 Nov 2021 17:09:55 -0500 "'eksperimental' via elixir-lang-core" wrote: > Hi Marten, > You will find this PR interesting > https://github.com/elixir-lang/el

[elixir-core:10566] Proposal: disable doctests per doc entry

2021-12-09 Thread 'eksperimental' via elixir-lang-core
Hi list, documenting functions made me realize the need to be able to disable doctests per documentation entry. So I would like to propose the addition of support for: `@doc doctest: false` `@moduledoc doctest: false` `@typedoc doctest: false` (In the same fashion as we declare guard

Re: [elixir-core:10574] Re: Proposal: disable doctests per doc entry

2021-12-10 Thread 'eksperimental' via elixir-lang-core
That's a nice trick Eric. I didn't now about it, it formats well in ExDoc, with the exception that ">" is not hightlighted and it is selectable., but I can create a feature request for MakeUp. So far the only way I knew to disable it is not to use `iex>` altogether. Thank you On Fri, 10 Dec 2021

Re: [elixir-core:10576] Proposal: disable doctests per doc entry

2021-12-10 Thread 'eksperimental' via elixir-lang-core
That is pretty much what I was using (it is what we use in Elixir core when an exception is raised), the issue with that is the it does not play out well with multi-line return values, which was my use case, and therefore this proposal. On Fri, 10 Dec 2021 14:42:51 +0100 Wojtek Mach wrote: > A

[elixir-core:10631] Proposal: Emit warning on public functions without a proper function signature

2021-12-19 Thread 'eksperimental' via elixir-lang-core
Hi all, Since documentation is taken seriously in Elixir, I would like to propose to emit a warning when a public function does not a have a proper/complete function signature. I describe an improper fucntion signature would look like this in your IEx/ExDoc documenation: your_function_name(arg

Re: [elixir-core:10635] Proposal: Emit warning on public functions without a proper function signature

2021-12-20 Thread 'eksperimental' via elixir-lang-core
s being useful for libraries, I think it is a > > very strong imposition for applications and I don’t think it should > > be the job of the compiler to enforce it. > > > > So my suggestion is to implement this as linter/credo check. > > > > On Sun, De

Re: [elixir-core:10637] Proposal: Emit warning on public functions without a proper function signature

2021-12-20 Thread 'eksperimental' via elixir-lang-core
ey are always enabled. Or they are not always useful and > therefore it should not be the responsibility of the compiler to > enforce it. > > On Mon, Dec 20, 2021 at 2:31 PM 'eksperimental' via elixir-lang-core < > elixir-lang-core@googlegroups.com> wrote: > > >

Re: [elixir-core:10641] Introduce let and reduce qualifiers to for

2021-12-20 Thread &#x27;eksperimental&#x27; via elixir-lang-core
The proposal is very concise, the only thing that would be problematic is the use of `reduce` for two different things, for <>, x in ?a..?z, reduce: %{} do acc -> Map.update(acc, <>, 1, & &1 + 1) end {sum, count} = for reduce({sum, count} = {0, 0}), i <- [1, 2, 3] do sum = sum + i cou

Re: [elixir-core:10643] Introduce let and reduce qualifiers to for

2021-12-20 Thread &#x27;eksperimental&#x27; via elixir-lang-core
t; Good point. I forgot to mention the :reduce option will be deprecated > in the long term. > > On Mon, Dec 20, 2021 at 7:53 PM 'eksperimental' via elixir-lang-core < > elixir-lang-core@googlegroups.com> wrote: > > > The proposal is very concise, > > the

Re: [elixir-core:10649] Introduce let and reduce qualifiers to for

2021-12-20 Thread &#x27;eksperimental&#x27; via elixir-lang-core
ok, [bar | bars]}} > >>> {:error, _reason} = error -> {error} > >>> end > >>> end > >>> > >>> Even if it did, it's not doing a great job of communicating the > >>> intent and still potentially requires a Enum.reverse call. The &

Re: [elixir-core:10650] Introduce let and reduce qualifiers to for

2021-12-20 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Not necessarily that they are replaceable, but that pattern of :cont, :halt, :suspend is most commonly used via Enumerable.reduce On Mon, 20 Dec 2021 19:18:53 -0500 "'eksperimental' via elixir-lang-core" wrote: > > I have found only one usage of Enum.reduce_whil

Re: [elixir-core:10665] Introduce let and reduce qualifiers to for

2021-12-21 Thread &#x27;eksperimental&#x27; via elixir-lang-core
On Tue, 21 Dec 2021 14:03:49 +0100 José Valim wrote: > 2. By declaring the variables that are part of reduce prior to the > generators, they can be used as part of the filters. So we can further > change the code above to this: So, the reduce() and let() part is going to be accepted only at the

[elixir-core:10727] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-01-25 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Hello everyone, Currently the second argument of funtions String.{trim, trim_leading, trim_trailing}/2 can only be a string. I would like Elixir to support a list of strings to be trimmed, such as: String.trim_leading(tag_name, ["OTP_", "OTP-"]) There is a precedent of other functions takin

Re: [elixir-core:10729] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-01-26 Thread &#x27;eksperimental&#x27; via elixir-lang-core
On Tue, 25 Jan 2022 18:33:08 +0100 José Valim wrote: > Yes, I think those would be consistent additions! > I will try to submit a PR this week then. -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop

[elixir-core:10746] Proposal: Allow `describe` blocks in ExUnit test to be skipped

2022-02-03 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Currently `@tag :skip` is only effictive in tests, but if I have a describe block with 10 test, i need to add the tag to each one individually. So I propose for the describe blocks to support the skip tag to ease development testing. -- You received this message because you are subscrib

Re: [elixir-core:10748] Proposal: Allow `describe` blocks in ExUnit test to be skipped

2022-02-03 Thread &#x27;eksperimental&#x27; via elixir-lang-core
It totally slipped my mind. I will update the docs to make this more noticeable, as of now if you look for "skip" the only relevant information is for skipping tests, not modules or describe blocks. Thank you Wojtek, On Thu, 03 Feb 2022 15:50:49 +0100 Wojtek Mach wrote: > This is already possib

Re: [elixir-core:10817] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-03-02 Thread &#x27;eksperimental&#x27; via elixir-lang-core
When starting to work in this implementation was wondering what should be the return value of String.trim_leading("--__--abc", [" ", "-", "_"]) and I realized that it should mimic String.replace_leading/3 Therefore it should returning "abc" Which leads me to think we should introduce Stri

Re: [elixir-core:10819] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-03-02 Thread &#x27;eksperimental&#x27; via elixir-lang-core
example, it > it to the behaviour of trim_leading/1 and trim_trailing/1). So we > could add trim_prefix/2 and trim_suffix/2, but then it is > inconsistent with other trim* functions. So unless there is a strong > reason for adding this, rather than consistency, I would not go this

Re: [elixir-core:10821] Proposal: Add support for list of strings in String.{trim, trim_leading, trim_trailing}

2022-03-02 Thread &#x27;eksperimental&#x27; via elixir-lang-core
place equivalents. Shall we go this route for > now? Please open up an issue and feel free to submit a PR. :) > > I am not convinced on trim_prefix/trim_suffix yet though, but you can > use the replace functions to achieve the same. > > On Wed, Mar 2, 2022 at 7:11 PM 'eksper

Re: [elixir-core:10841] [Proposal] Introduce `last` and `init` functions to Kernel

2022-03-24 Thread &#x27;eksperimental&#x27; via elixir-lang-core
We already have List.last/1-2 On Thu, 24 Mar 2022 06:24:24 -0700 (PDT) Weslei Juan Novaes Pereira wrote: > As Elixir has the `hd` and `tl` functions, it'd be very useful to > have a `init` and `last` functions as well. For example: > > last: takes a list and returns its last element. > iex> las

[elixir-core:10887] Proposal: Add Enum.sort_by_transform/4

2022-05-04 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Hi group. When working on sorting some data I realized that after sorting the enumerable, I had to map and iterate again to do a data transformation of the elements. So I look for a function that would already do this and I cannot find it. So by looking at the source code https://github.com/elixi

Re: [elixir-core:10912] [Proposal] Support for shorter @spec syntax

2022-06-03 Thread &#x27;eksperimental&#x27; via elixir-lang-core
> @spec word() :: boolean() Hi Boris, So if there is a function `word/0` how would you know this spec refers to word/1 and not word/0? On Thu, 2 Jun 2022 17:16:45 +0300 Boris Kuznetsov wrote: > Currently, if you want to add spec to functions, you have to use > @spec with a function name to de

[elixir-core:10924] Proposal: add :guards option to import/2

2022-06-13 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Hi, Currenly import/1 allows us to import :functions, :macros, :sigils with the :only option. I have found myself to manually have to list every guard I want to import from my "Util" module. This has been a recurring issue. I think it will be a good addition given the nature of guards that since t

Re: [elixir-core:10926] Re: Proposal: add :guards option to import/2

2022-06-13 Thread &#x27;eksperimental&#x27; via elixir-lang-core
As of now, when you define a guard with `defguard` it adds the attribute: `@doc guard: true`, we could include guards that are defined with `defguard` and any other macros with this attribute set. Or we could introduce a new attribute for identifying guards, as @doc seems limited to documentation

Re: [elixir-core:10928] Re: Proposal: add :guards option to import/2

2022-06-13 Thread &#x27;eksperimental&#x27; via elixir-lang-core
> Would you think it would make sense to _exclude_ any 'guard macros' > either NOT defined with `defguard` nor having whatever relevant > attribute there might be? How would you make the distinction between a guard and a regular macro? > I'm trying to think how useful this > request/proposal mig

Re: [elixir-core:10957] [Proposal] Add Enum.none?/2

2022-06-22 Thread &#x27;eksperimental&#x27; via elixir-lang-core
You need to use is like this. iex(1)> ["a","b","c"] |> Enum.any?(&String.valid?/1) |> Kernel.!() false iex(2)> !( ["a","b","c"] |> Enum.any?(&String.valid?/1)) false On Wed, 22 Jun 2022 10:26:57 -0700 Kurtis Rainbolt-Greene wrote: > While quippy `!Enum.any?` also just doesn't work

Re: [elixir-core:10976] Proposal: New function on List module

2022-07-15 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Hi Julian. It think it is a good addition. It is also analog to String.contains?/2 On Fri, 15 Jul 2022 04:58:59 -0700 (PDT) Julian Somoza wrote: > Hi everyone, I was working on a suggestion to add a new function on > the List module in order to find out if a given sublist is inside > another li

Re: [elixir-core:11253] [proposal] ExUnit: A use case for specifying setup callback as MF(A)

2023-02-05 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Hi Nikola Have you tried? `setup(context), do: Module.function_name(context)` Cheers. On Sun, 5 Feb 2023 03:21:12 -0800 (PST) Nikola Begedin wrote: > Hello everyone. 1st time writing here. I scanned through the repo > docs, etc, and I'm not finding a guideline on how to do it. Apologies > if I

Re: [elixir-core:11258] [Proposal] setup_all block inside describe block

2023-02-12 Thread &#x27;eksperimental&#x27; via elixir-lang-core
On Sun, 12 Feb 2023 14:52:37 -0800 (PST) Jose Vargas wrote: > There is module-level *setup* and module-level *setup_all* > There is describe-level *setup* but there is no describe-level > *setup_all* > > I find it would be convenient to have *describe* level *setup_all*. > > Right now the solut

Re: [elixir-core:11259] [Proposal] setup_all block inside describe block

2023-02-12 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Hi Jose Vargas, You can use tags as described in the `ExUnit.Callbacks` module docs: Finally, as discussed in the ExUnit.Case documentation, remember that the initial context metadata can also be set via @tags, which can then be accessed in the setup block: defmodule ExampleTagModificationTest d

Re: [elixir-core:11526] Show how many tests were actually run

2023-09-19 Thread &#x27;eksperimental&#x27; via elixir-lang-core
Hi Ignacio. Thanks for the proposal. I have been longing this feature for a long time as I have to end up doing a mental subtraction every time. This is something that hits me quite a few times a day, when I do something like: `mix test --only bar` or `mix test --except bar`. On Fri, 31 Mar 202