Which form is more idiomatic Elixir? -


when writing method, more idiomatic elixir provide default argument in elixir so:

def mktempfile(ext \\ ".log", path) do

or better have 2 function definitions one:

def mktempfile(ext, path) do

and

def mktempfile(path) do

where second second definition, ext not provided assume ext of default value. if so, can explain why ?

the more idiomatic be:

def mktempfile(path, ext \\ ".log") 

Comments

  1. I have to say I feel more enlightened now that I've read your article. You really wrote some fascinating content in this article which you researched and presented very well. Thank you for this information. elixir definition Define Dictionary Meaning. A simple vocabulary sharing platform. Dedicated to learn and share knowledge by defining words and concepts in short and easy English. Define your own words and their meanings.

    ReplyDelete

Post a Comment

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -