Logo

Programming-Idioms

History of Idiom 118 > diff from v16 to v17

Edit summary for version 17 by steenslag:
[Ruby] require set moved to imports

Version 16

2016-10-29, 13:31:17

Version 17

2016-10-29, 22:50:36

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
Imports
Imports
require 'set'
Code
require 'set'
y = x.to_set
Code
y = x.to_set