small medium large xlarge

Generic-user-small
04 Sep 2016, 20:24
Srinivasan Rajappa (2 posts)

Hi I tried to find mean for a list of values using the code snippets provided on Page 34. The snippets use with keyword to compute the same.

I found out that we need to take special care while using do in the with statement.

Here are some of my [observations](https://goo.gl/photos/BfoXi7RfBi5cxGpA7); the example that shows the use of [parenthesis](https://goo.gl/photos/rETVyFKKWgTtrb6aA) is not working as well.

The only way I feel it works is the last example, where all the temp variables are appended by , and we use the colon operator after do:.

Please let me know if I have fallen short in my explanation or understanding from the book.

Dave_gnome_head_isolated_pragsmall
05 Sep 2016, 02:23
Dave Thomas (396 posts)

Try running the code from a file—iex doesn’t have the same lookahead for do keywords.

Generic-user-small
05 Sep 2016, 23:54
Srinivasan Rajappa (2 posts)

Oh! I see :) Thank you so much for your reply :D

You must be logged in to comment