From ef24230622494f2e73e236bcb67e5fd10a352ec6 Mon Sep 17 00:00:00 2001 From: TATSUNO Yasuhiro Date: Sun, 3 Jan 2021 20:23:35 +0900 Subject: [PATCH] Do not use coll which is a protected member --- _overviews/collections-2.13/views.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_overviews/collections-2.13/views.md b/_overviews/collections-2.13/views.md index 0c094bb38e..0b0e3f2c1e 100644 --- a/_overviews/collections-2.13/views.md +++ b/_overviews/collections-2.13/views.md @@ -18,8 +18,8 @@ There are two principal ways to implement transformers. One is _strict_, that is As an example of a non-strict transformer consider the following implementation of a lazy map operation: - def lazyMap[T, U](coll: Iterable[T], f: T => U) = new Iterable[U] { - def iterator = coll.iterator map f + def lazyMap[T, U](iter: Iterable[T], f: T => U) = new Iterable[U] { + def iterator = iter.iterator map f } Note that `lazyMap` constructs a new `Iterable` without stepping through all elements of the given collection `coll`. The given function `f` is instead applied to the elements of the new collection's `iterator` as they are demanded.