I think he is looking for a Range function which answers whether a range is a subset of another range, e.g. 1..10 contains 2..4 == true.
On Tue, Dec 20, 2016 at 3:47 PM, José Valim <[email protected] > wrote: > Is there any reason to use Range.contains? given you can already do "x in > range" or "Enum.member?(range, x)" (they are equivalent). > > > > *José Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Tue, Dec 20, 2016 at 10:43 PM, Patrick Davey <[email protected]> > wrote: > >> I wanted to check if a range contained another range today while I was >> doing one of the www.adventofcode.com puzzles. >> >> I discussed it on the forum and I have done a search and it doesn't look >> like it has been proposed before, apologies if I have missed something. >> >> Anyway, just an idea, I'm happy to have a go at implementing it if it's >> something which merits approval. I understand if it's too simple a thing to >> be bothered implementing. >> >> Thanks to the team for Elixir - I'm thoroughly enjoying getting more >> comfortable with it through the advent of code puzzles :) >> >> -- >> 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 on the web visit https://groups.google.com/d/ms >> gid/elixir-lang-core/62203f2a-fe01-46e8-a373-16f40b860578% >> 40googlegroups.com >> <https://groups.google.com/d/msgid/elixir-lang-core/62203f2a-fe01-46e8-a373-16f40b860578%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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 on the web visit https://groups.google.com/d/ > msgid/elixir-lang-core/CAGnRm4K0Rk2uMJVTCNQi9t7nHD% > 3DHSsY4YRt_qEhTt6T4cot%3DPQ%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4K0Rk2uMJVTCNQi9t7nHD%3DHSsY4YRt_qEhTt6T4cot%3DPQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAK%3D%2B-TtyLV_yYN9yB6ESP85LOQg%3Dj9KZMqT1FC8YBAxSActRXw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
