-
-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated hello_world problem to reflect exercism/problem-specification…
…s#520 (#370) * Updated hello_world problem to reflect exercism/problem-specifications#520 exercism/problem-specifications#520 * Adding example
- Loading branch information
1 parent
f073ca5
commit 4f8228c
Showing
5 changed files
with
10 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
defmodule HelloWorld do | ||
|
||
@doc """ | ||
Greets the user by name, or by saying "Hello, World!" | ||
if no name is given | ||
""" | ||
|
||
def hello(name \\ "World") do | ||
|
||
"Hello, " <> name <> "!" | ||
|
||
def hello do | ||
"Hello, World!" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,9 @@ | ||
defmodule HelloWorld do | ||
@moduledoc """ | ||
Elixir counts the number of arguments as part of the function name. | ||
For instance; | ||
def hello() do | ||
end | ||
would be a completely different function from | ||
def hello(name) do | ||
end | ||
Can you find a way to make all the tests pass with just one | ||
function? | ||
Hint: look into argument defaults here: | ||
http://elixir-lang.org/getting-started/modules-and-functions.html#default-arguments | ||
""" | ||
|
||
@doc """ | ||
Greets the user by name, or by saying "Hello, World!" | ||
if no name is given. | ||
Simply returns "Hello, world!" | ||
""" | ||
@spec hello(String.t) :: String.t | ||
def hello(name) do | ||
|
||
@spec hello :: String.t | ||
def hello do | ||
"Your implementation goes here" | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
%{"poison": {:hex, :poison, "1.4.0"}} | ||
%{"poison": {:hex, :poison, "1.4.0", "cd5afb9db7f0d19487572fa28185b6d4de647f14235746824e77b3139b79b725", [], [], "hexpm"}} |