Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #52 from malkomalko/master

Crash course fixes to Anonymous Functions section
  • Loading branch information...
commit 7b5ac69897132418a52c01fed8706535e8175ebd 2 parents 4a7884d + a1ff76a
@josevalim josevalim authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 crash-course.markdown
View
6 crash-course.markdown
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.