elixir-lang / elixir-lang.github.com

Website for Elixir
elixir-lang.org
354 stars 822 forks source link

update link texts #1525

Closed ctstacey closed 3 years ago

ctstacey commented 3 years ago

"doctest/1" ->"doctest/2" "test/2" ->"test/3"

josevalim commented 3 years ago

After further consideration, I think the text is correct. We are using test/2 in the code, so I made the link mirror that (although it will point to the exact same place!).

josevalim commented 3 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

ctstacey commented 3 years ago

Hi Jose, Thanks for considering my pull request. Perhaps I misunderstood the meaning of test/2. Does this mean we are calling the function with 2 arguments, or the function expects two arguments, and how do default arguments effect the arity of the function? Thanks in advance, Charles.

josevalim commented 3 years ago

If you call test(foo, bar), then you are calling test/2, with two arguments. It happens that the test macro, with default arguments, is defining both test/2 and test/3. :)

ctstacey commented 3 years ago

Oh nice! Thank-you! Am I right in assuming the definition of test/2 and test/3 happen in the compiler (at compile time)? (I was looking but couldn't find anything that explains this in the documentation)

josevalim commented 3 years ago

Correct.

ctstacey commented 3 years ago

Thanks! Have a great day! 💚 💙 💜 💛 ❤️