Skip to content

Commit

Permalink
Add solution to 4th example on anonymous functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dskecse committed Oct 11, 2014
1 parent e04a955 commit 29e8f92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions functions/function4.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
prefix = fn prefix -> fn str -> "#{prefix} #{str}" end end

mrs = prefix.("Mrs")
mrs.("Smith") # => "Mrs Smith"

prefix.("Elixir").("Rocks") # => "Elixir Rocks"

0 comments on commit 29e8f92

Please sign in to comment.