G.3.6.2 Comparing multiple arrays

For the semantics of the parameter ARRY see Conventions of the arrays API. For the semantics of the parameter ARRYS see Conventions of the arrays API. For the semantics of the parameter ISEQUAL see Conventions of the arrays API. For the semantics of the parameter ISLESS see Conventions of the arrays API.

Function: mbfl_multi_array_equal ARRYS
Function: mbfl_multi_array_equal ARRYS ISEQUAL

Compare the index arrays in ARRYS, slot by slot, and return true if the values are equal according to ISEQUAL; otherwise return false.

If ARRYS is empty: return true. If ARRYS contains a single array: return true.

mbfl_declare_index_array_varref(ARRY1, (a b c d e))
mbfl_declare_index_array_varref(ARRY2, (a b c d e))
mbfl_declare_index_array_varref(ARRY3, (a b c d e))
mbfl_declare_index_array_varref(ARRYS, (_(ARRY1) _(ARRY2) _(ARRY3)))

mbfl_multi_array_equal _(ARRYS)         ⇒ 0
Function: mbfl_multi_array_less ARRYS
Function: mbfl_multi_array_less ARRYS ISEQUAL ISLESS

Compare the index arrays in ARRYS, slot by slot, left to right, and return true if the arrays are sorted in strictly monotonic increasing lexicographic order according to ISEQUAL and isless; otherwise return false.

If ARRYS is empty: return true. If ARRYS contains a single array: return true.

mbfl_declare_index_array_varref(ARRY1, (a b c))
mbfl_declare_index_array_varref(ARRY2, (a b c d))
mbfl_declare_index_array_varref(ARRY3, (a b c d e))
mbfl_declare_index_array_varref(ARRYS, (_(ARRY1) _(ARRY2) _(ARRY3)))

mbfl_multi_array_less _(ARRYS)         ⇒ 0
Function: mbfl_multi_array_greater ARRYS
Function: mbfl_multi_array_greater ARRYS ISEQUAL ISLESS

Compare the index arrays in ARRYS, slot by slot, left to right, and return true if the arrays are sorted in strictly monotonic decreasing lexicographic order according to ISEQUAL and isless; otherwise return false.

If ARRYS is empty: return true. If ARRYS contains a single array: return true.

mbfl_declare_index_array_varref(ARRY1, (a b c d e))
mbfl_declare_index_array_varref(ARRY2, (a b c d))
mbfl_declare_index_array_varref(ARRY3, (a b c))
mbfl_declare_index_array_varref(ARRYS, (_(ARRY1) _(ARRY2) _(ARRY3)))

mbfl_multi_array_greater _(ARRYS)       ⇒ 0
Function: mbfl_multi_array_leq ARRYS
Function: mbfl_multi_array_leq ARRYS ISEQUAL ISLESS

Compare the index arrays in ARRYS, slot by slot, left to right, and return true if the arrays are sorted in non–strict monotonic increasing lexicographic order according to ISEQUAL and isless; otherwise return false.

If ARRYS is empty: return true. If ARRYS contains a single array: return true.

mbfl_declare_index_array_varref(ARRY1, (a b c))
mbfl_declare_index_array_varref(ARRY2, (a b c d))
mbfl_declare_index_array_varref(ARRY3, (a b c d))
mbfl_declare_index_array_varref(ARRY4, (a b c d e))
mbfl_declare_index_array_varref(ARRYS, (_(ARRY1) _(ARRY2) _(ARRY3) _(ARRY4)))

mbfl_multi_array_leq _(ARRYS)           ⇒ 0
Function: mbfl_multi_array_geq ARRYS
Function: mbfl_multi_array_geq ARRYS ISEQUAL ISLESS

Compare the index arrays in ARRYS, slot by slot, left to right, and return true if the arrays are sorted in non–strict monotonic decreasing lexicographic order according to ISEQUAL and isless; otherwise return false.

If ARRYS is empty: return true. If ARRYS contains a single array: return true.

mbfl_declare_index_array_varref(ARRY1, (a b c d e))
mbfl_declare_index_array_varref(ARRY2, (a b c d))
mbfl_declare_index_array_varref(ARRY3, (a b c d))
mbfl_declare_index_array_varref(ARRY4, (a b c))
mbfl_declare_index_array_varref(ARRYS, (_(ARRY1) _(ARRY2) _(ARRY3) _(ARRY4)))

mbfl_multi_array_geq _(ARRYS)           ⇒ 0
Function: mbfl_multi_array_equal_prefix_length_var LEN_RV ARRYS
Function: mbfl_multi_array_equal_prefix_length_var LEN_RV ARRYS ISEQUAL

Store in the result variable LEN_RV the length of the common prefix of all the arrays in ARRYS. Values comparison is performed with ISEQUAL.

If ARRYS is empty: the length is zero. If ARRYS contains a single array: the length is the size of the array. If ARRYS contains only empty arrays: the length is zero.

mbfl_declare_index_array_varref(ARRY1, (a b c))
mbfl_declare_index_array_varref(ARRY2, (a b))
mbfl_declare_index_array_varref(ARRY3, (a b c d))
mbfl_declare_index_array_varref(ARRYS, (_(ARRY1) _(ARRY2) _(ARRY3)))

mbfl_declare_integer_varref(LEN)

mbfl_multi_array_equal_prefix_length_var _(LEN) _(ARRYS)
$LEN    ⇒ 2
Function: mbfl_multi_array_equal_suffix_length_var LEN_RV ARRYS
Function: mbfl_multi_array_equal_suffix_length_var LEN_RV ARRYS ISEQUAL

Store in the result variable LEN_RV the length of the common suffix of all the arrays in ARRYS. Values comparison is performed with ISEQUAL.

If ARRYS is empty: the length is zero. If ARRYS contains a single array: the length is the size of the array. If ARRYS contains only empty arrays: the length is zero.

mbfl_declare_index_array_varref(ARRY1, (a b c d e f))
mbfl_declare_index_array_varref(ARRY2,       (d e f))
mbfl_declare_index_array_varref(ARRY3,     (c d e f))
mbfl_declare_index_array_varref(ARRYS, (_(ARRY1) _(ARRY2) _(ARRY3)))

mbfl_declare_integer_varref(LEN)

mbfl_multi_array_equal_suffix_length_var _(LEN) _(ARRYS)
$LEN    ⇒ 3

This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.