> 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 `if_match`, the only alternative would be `<-`, custom use case of `=` or a similar solution. Personally, I hate it when languages start using what feels like millions of "nice", "short", "clear" syntax trickeries for any given [edge] case. It's just extremely hard to read in other people's code if you're not that experienced and a hassle to remember for yourselves, if you don't use it a lot. I know I'm often times a bit of a buzzkill when it comes to little additions/changes like this but I feel the currently available solutions suffice. -sven On Fri, 18 Oct 2019 at 02:03, José Valim <jose.va...@plataformatec.com.br> wrote: > > But I see your point: it is not and it was never the intention for it > to be. > > Exactly. It could be, I guess, but it certainly wasn’t designed as such. > > > Thinking about that actually just gave me an idea for the lib: a `left > <- right` operator that works exactly like `=` but instead of raising when > it doesn’t match, it returns `nil`. Will check how that goes and what are > the implications of the conflict > > But even that can have other consequences. For example, what is the > precedence for <-? Does it work nicely with “and” and “or” and other > logical operators? > > So there is a lot of complexity involved! I was not trying to be harsh. :D > Almost anything you may want to do may impact others areas. > -- > > > *José Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > -- > 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 elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BKUcFhxMpK_tSNu%3DxM1n2%3Ddy7n%3DHTt9GvhqhoZa%2Bzc4Q%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BKUcFhxMpK_tSNu%3DxM1n2%3Ddy7n%3DHTt9GvhqhoZa%2Bzc4Q%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAFuVuxwMOYgp1oau0pQy8a9zFSxwURFB%2BUMNgDG74VDbei6jmg%40mail.gmail.com.