OxL Reference

init Set.new

True when the set has no elements.

Example:

oxl✓ checked in CI
fn main() io {
  print("{Set<i32>.new().isEmpty()}")
}
Output
true

Number of elements.

Example:

oxl✓ checked in CI
fn main() io {
  var s = Set<i32>.new()
  s.insert(1)
  s.insert(1)
  print("{s.len()}")
}
Output
1

An empty set.

Example:

oxl✓ checked in CI
fn main() io {
  let s = Set<i32>.new()
  print("{s.len()}")
}
Output
0
pub(api) init new() -> Self

Since. 1.0.0-beta

Returns

Self

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/collections.oxl:949

See also