Permalink
Browse files

Crash-course Anonymous Functions fixes

  • Loading branch information...
1 parent 4a7884d commit a1ff76adad5b34e2ce1d86497a99a4bd2a72fa95 @malkomalko malkomalko committed Dec 2, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 crash-course.markdown
View
@@ -588,11 +588,11 @@ Anonymous functions are defined in the following way:
**Erlang**
{% highlight erlang %}
-Sum = fun(a, b) -> a + b end.
+Sum = fun(A, B) -> A + B end.
Sum(4, 3).
%=> 7
-Square = fun(x) -> x * x end.
+Square = fun(X) -> X * X end.
lists:map(Square, [1, 2, 3, 4]).
%=> [1, 4, 9, 16]
{% endhighlight %}
@@ -601,7 +601,7 @@ lists:map(Square, [1, 2, 3, 4]).
{% highlight ruby %}
sum = fn(a, b) -> a + b end
-sum 4, 3
+sum.(4, 3)
#=> 7
square = fn(x) -> x * x end

0 comments on commit a1ff76a

Please sign in to comment.