You can achieve this today by using anonymous functions and calling them if you do not want to use a defp.
On Wed, 2 Aug 2017 at 09:03, <[email protected]> wrote: > I don't know what would be the cost of it during compilation time or how > difficult would be to implement it, but at first sight I think it could be > a nice idea to allow defining functions inside other function bodies. Just > like in Scala (https://www.scala-lang.org/old/node/116.html), nested > functions would be in scope only for parent functions. > > I think it would improve readability to be able to encapsulate those "def > do_work" functions within its related "def work" function. Maybe, to avoid > crazy things, we could limit the allowed nesting deep to just 2. > > -- > 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/5c89cded-89a6-4ea5-befd-039d391c879b%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/5c89cded-89a6-4ea5-befd-039d391c879b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Andrea Leopardi [email protected] -- 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/CAM9Rf%2B%2B%3DWvC4qkcAgdiWqwtUdz%2B%2BPLjH1AR5qOEFvuk_66b1UQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
