Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use default argument for load_urls #65

Closed
wants to merge 3 commits into from
Closed

Use default argument for load_urls #65

wants to merge 3 commits into from

Conversation

Glutexo
Copy link
Owner

@Glutexo Glutexo commented Feb 11, 2022

Keep the logic of load_urls input in this function. Leverage default argument values to achieve this. As a result, the download/2 function is simplified.

Keep the logic of load_urls input in this function. Leverage default
argument values to achieve this. As a result, the download/2 function
is simplified.
@Glutexo Glutexo self-assigned this Feb 11, 2022
@Glutexo Glutexo requested a review from nappex February 11, 2022 21:18
@Glutexo Glutexo marked this pull request as ready for review February 11, 2022 21:18
@Glutexo
Copy link
Owner Author

Glutexo commented Feb 13, 2022

Merged current elixir and resolved conflicts.

Comment on lines +34 to +35
def load_urls(path \\ nil)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I am confused what does it mean. Do you have some material or docs where did you find this approach, please?

Copy link
Owner Author

@Glutexo Glutexo Feb 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a default argument. See https://hexdocs.pm/elixir/Kernel.html#def/2-default-arguments. Again, it is a syntactic sugar for multiple functions of the same name.

@Glutexo
Copy link
Owner Author

Glutexo commented Feb 13, 2022

After merging current elixir, I don’t really think this is a good approach any more. Having the get_env nicely together in main/0 feels better.

@Glutexo
Copy link
Owner Author

Glutexo commented Feb 13, 2022

Closing without merging. I don’t want to do this any more. Feel free to comment or reopen.

@Glutexo Glutexo closed this Feb 13, 2022
@Glutexo Glutexo deleted the list_urls branch July 11, 2022 20:03
@Glutexo Glutexo restored the list_urls branch July 11, 2022 20:03
@Glutexo Glutexo deleted the list_urls branch July 11, 2022 20:03
@Glutexo Glutexo restored the list_urls branch July 11, 2022 20:03
@Glutexo Glutexo deleted the list_urls branch July 11, 2022 20:03
@Glutexo Glutexo mentioned this pull request Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants