Logo

Programming-Idioms

History of Idiom 118 > diff from v31 to v32

Edit summary for version 32 by Debaran:
[Scala] Added parens for the heck of it

Version 31

2019-02-02, 02:08:23

Version 32

2019-02-02, 02:09:23

Idiom #118 List to set

Create set y from list x.
x may contain duplicates. y is unordered and has no repeated values.

Illustration

Idiom #118 List to set

Create set y from list x.
x may contain duplicates. y is unordered and has no repeated values.

Illustration
Code
val y = x.toSet
Code
val y = x.toSet()