OxL Reference

method List.isEmpty

Whether the list has no elements.

Example:

oxl✓ checked in CI
fn main() io {
  let xs: List<i32> = []
  print("{xs.isEmpty()} {[1].isEmpty()}")
}
Output
true false

True when the list has no elements.

Example:

oxl✓ checked in CI
fn main() io {
  let xs: List<i32> = []
  print("{xs.isEmpty()} {[1].isEmpty()}")
}
Output
true false
pub(api) fn isEmpty() -> bool

Complexity. O(1).

Since. 1.0.0-beta

Returns

bool

Effects

none declared (pure unless the body says otherwise)

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

See also