| Benjamin, I was thinking that I only want a line of the comprehension to change and not the whole thing to be strict. with {x, y} <- positions, %Pawn{} <- white_pieces do # end I might want positions to be strict but white pieces includes multiple types so I don’t want it strict. If we can learn the pattern suggested with the ‘=‘ on a separate line then we begin to understand that pattern. We can also use # this is gross but just tossing it out there. pair <- Enum.each(pairs, fn {_, _} -> nil end) How do you intend on remembering that you want it strict when first writing the code and the match doesn’t fail? Would you always use strict as the default? Have you attempted adding an implementation of this into your project and seeing how it affects behavior of the developers and if it reduces bugs? I’m curious how it has gone. I also think about this a lot because I have seen where there is a ‘for’ used as a simple loop around some asserts in a test. Since ‘for’ filters if the type changes or there is something unexpected then the asserts are not run and the test passes happily. I’ve found that realizing that ‘for’ is a filter and pointing that out has changed behavior for the whole team. I’ve tried a few things and none of them have worked as well as pointing out what a ‘for’ does. Amos On Jan 19, 2026, at 23:11, Benjamin Philip <[email protected]> wrote:
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/elixir-lang-core/97AD9C85-D427-4D2E-B5D2-7A1D2C11B094%40binarynoggin.com. |
- [elixir-core:12157] [Proposal] Add strict comprehensio... Hannes Steffenhagen
- Re: [elixir-core:12157] [Proposal] Add strict com... Bruce Tate
- Re: [elixir-core:12158] [Proposal] Add strict... Amos King
- Re: [elixir-core:12159] [Proposal] Add st... Bruce Tate
- Re: [elixir-core:12160] [Proposal] Ad... Jean Klingler
- Re: [elixir-core:12161] [Proposa... Benjamin Philip
- Re: [elixir-core:12162] [Pro... Amos King
