Excellent questions! I don't think we should support improper lists because there is no notion of prefix for improper list. For instance, I would not expect this to match:
List.starts_with?([1, 2], [1 | 2]) Because we would compare 1 == 1 and then [2] to 2. The only situation they would match is if they are exactly equal and then the function is no longer necessary. *José Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Tue, Feb 21, 2017 at 3:38 PM, eksperimental <[email protected]> wrote: > Hi, List.starts_with?/2 have recently been introduced > https://github.com/elixir-lang/elixir/pull/5789 > > I was working on improving the specs and the code, > and I have realized there are a few issues I would to work on. > > Initially would like to to know whether we should support improper lists, > that would determine how > the code can be optimized. > > I would say yes, we should support improper lists. > But we also need to keep in mind that we will probably will end up adding > List.ends_with?/2 too, > so we need to keep that in mind > > If we support improper lists, prefix could be any term, not just a list. > > -- > 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/20170221213857.6c3a8f4f.eksperimental%40autistici.org > . > 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/CAGnRm4LwAuRsg1h1-hsC-5pRH0RA%2BFOOEjWsf4%2BG6CcLEV2q7Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
