oldfartdeveloper (17) [Avatar] Offline
#1
You show the example of using the capture operator here:

def new(entries \\ []) do
  Enum.reduce(
    entries,
    todo_list,
    &add_entry(&2, &1)
  )
end


The
 todo_list, 
argument is undefined when I try it; needs to be

def new(entries \\ []) do
  Enum.reduce(
    entries,
    %TodoList{},
    &add_entry(&2, &1)
  )
end



Hope this helps!

This is my 2nd book on Elixir, btw. Really learning a lot more from this one, thank you.
sjuric (86) [Avatar] Offline
#2
Good catch, thanks for reporting!
I'm glad you like the book smilie
jfs.world (109) [Avatar] Offline
#3
353525 wrote:This is my 2nd book on Elixir, btw. Really learning a lot more from this one, thank you.


Just out of curiosity (because I am looking at possibly getting this book), what was your first one, and how is this different or better?