Refine is_empty methods.

This commit is contained in:
Stephen Chung
2022-08-24 21:58:08 +08:00
parent ae5e88928e
commit ca1b7f6a39
7 changed files with 101 additions and 35 deletions

View File

@@ -267,6 +267,12 @@ op +(u8, u8) -> u8;
/// ```
op +=(Map, Map) -> ();
op +=(String, String) -> ();
op +=(String, char) -> ();
op +=(String, ()) -> ();
op +=(String, ?) -> ();
op +=(String, Blob) -> ();
@@ -1850,6 +1856,21 @@ fn get int(x: float) -> float;
/// ```
fn get is_anonymous(fn_ptr: FnPtr) -> bool;
/// Return true if the array is empty.
fn get is_empty(array: Array) -> bool;
/// Return true if the BLOB is empty.
fn get is_empty(blob: Blob) -> bool;
/// Return true if the range contains no items.
fn get is_empty(range: ExclusiveRange) -> bool;
/// Return true if the range contains no items.
fn get is_empty(range: InclusiveRange) -> bool;
/// Return true if the string is empty.
fn get is_empty(string: String) -> bool;
/// Return true if the number is even.
fn get is_even(x: int) -> bool;
@@ -1973,9 +1994,6 @@ fn get is_zero(x: u8) -> bool;
/// Number of elements in the array.
fn get len(array: Array) -> int;
/// Return true if the array is empty.
fn get empty(array: Array) -> bool;
/// Return the length of the BLOB.
///
/// # Example
@@ -2398,6 +2416,24 @@ fn int(x: float) -> float;
/// ```
fn is_anonymous(fn_ptr: FnPtr) -> bool;
/// Return true if the array is empty.
fn is_empty(array: Array) -> bool;
/// Return true if the BLOB is empty.
fn is_empty(blob: Blob) -> bool;
/// Return true if the map is empty.
fn is_empty(map: Map) -> bool;
/// Return true if the range contains no items.
fn is_empty(range: ExclusiveRange) -> bool;
/// Return true if the range contains no items.
fn is_empty(range: InclusiveRange) -> bool;
/// Return true if the string is empty.
fn is_empty(string: String) -> bool;
/// Return true if the number is even.
fn is_even(x: int) -> bool;
@@ -2532,9 +2568,6 @@ fn keys(map: Map) -> Array;
/// Number of elements in the array.
fn len(array: Array) -> int;
/// Return true if the array is empty.
fn is_empty(array: Array) -> bool;
/// Return the length of the BLOB.
///
/// # Example
@@ -2548,15 +2581,9 @@ fn is_empty(array: Array) -> bool;
/// ```
fn len(blob: Blob) -> int;
/// Return true if the blob is empty.
fn is_empty(blob: Blob) -> bool;
/// Return the number of properties in the object map.
fn len(map: Map) -> int;
/// Return true if the map is empty.
fn is_empty(map: Map) -> bool;
/// Return the length of the string, in number of characters.
///
/// # Example
@@ -2568,9 +2595,6 @@ fn is_empty(map: Map) -> bool;
/// ```
fn len(string: String) -> int;
/// Return true if the string is empty.
fn is_empty(string: String) -> bool;
/// Return the natural log of the decimal number.
fn ln(x: Decimal) -> Decimal;