Remove function single do: definition syntax

This commit is contained in:
José Valim
2012-05-13 17:36:54 +02:00
parent 53ba7e7e85
commit f9dd6f66a6
12 changed files with 126 additions and 130 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ defmodule Elixir.CLI do
end
defp print_stacktrace(stacktrace) do
Enum.each stacktrace, fn(s, do: IO.puts :standard_error, " #{format_stacktrace(s)}")
Enum.each stacktrace, fn s -> IO.puts :standard_error, " #{format_stacktrace(s)}" end
end
# Process shared options
+1 -1
View File
@@ -83,6 +83,6 @@ defmodule Elixir.IEx do
end
defp print_stacktrace(io, stacktrace) do
Enum.each stacktrace, fn(s, do: io.error " #{format_stacktrace(s)}")
Enum.each stacktrace, fn s -> io.error " #{format_stacktrace(s)}" end
end
end
+2 -2
View File
@@ -322,7 +322,7 @@ defmodule Elixir.SpecialForms do
## Examples
sum = fn(x, y, do: x + y)
sum = fn(x, y) -> x + y end
sum.(1, 2) #=> 3
Notice that a function needs to be invoked using the dot between
@@ -351,7 +351,7 @@ defmodule Elixir.SpecialForms do
One may define a function which expects different clauses as long
as all clauses expects the same number of arguments:
fun = fn do:
fun = fn do
[x, y] when y < 0 ->
x - y
[x, y] ->