0 votes
in Scala Constructs by
For the for-yield construct, is the scope separate between for-body and yield-body?

a. Yes and no. It is different depending on the for construct and what it does.

b. Yes, because the for section does not expose its scope.

c. No, because for-yield shares the same scope, even though they are within separate curly braces.

d. Yes, because they are within different curly braces.

1 Answer

0 votes
by
Correct answer is :-  No, because for-yield shares the same scope, even though they are within separate curly braces.
...