mdef icon indicating copy to clipboard operation
mdef copied to clipboard

Support for mdefp

Open hajee opened this issue 10 years ago • 6 comments

Would it be useful to extend it to also support creation of multiple defp statements.

It could be as simple as:

mdefp _fred do
  { :init, val }   -> _fred {:double, val}
  { :double, val } -> val*2
  a, b, c when a < b  -> a+b+c
end

hajee avatar Aug 14 '14 21:08 hajee

Sure, although I'm not seeing much uptake on the concept atm...

On Thu, Aug 14, 2014 at 4:10 PM, Bert Hajee [email protected] wrote:

Would it be useful to extend it to also support creation of multiple defp statements.

It could be as simple as:

mdefp _fred do { :init, val } -> _fred {:double, val} { :double, val } -> val*2 a, b, c when a < b -> a+b+cend

— Reply to this email directly or view it on GitHub https://github.com/pragdave/mdef/issues/1.

pragdave avatar Aug 14 '14 21:08 pragdave

Would you be interested in a pull request adding support for it?

DevL avatar Nov 23 '14 12:11 DevL

Sure On Nov 23, 2014 6:30 AM, "Lennart Fridén" [email protected] wrote:

Would you be interested in a pull request adding support for it?

— Reply to this email directly or view it on GitHub https://github.com/pragdave/mdef/issues/1#issuecomment-64116307.

pragdave avatar Nov 23 '14 15:11 pragdave

Thanks, I've opened a PR (https://github.com/pragdave/mdef/pull/2) but could use some help in figuring out how to make it merge-worthy.

DevL avatar Nov 30 '14 14:11 DevL

I love mdef, and actually manually implemented mdefp (much less elegantly than in your mdefp branch). It would be great if you could merge the mdefp branch with master so it's easier to pull it into my projects. (I know I can add a github branch in mix.exs...)

houshuang avatar Aug 14 '15 02:08 houshuang

+1

skovmand avatar May 28 '16 18:05 skovmand