Maat has a very tiny type system with the Array type inheriting directly from the Any type.
-- Yep, we have multiple ways of declaring an Array object
var a = a<liza madjou monthe>
var b = ["kueppo", "cyrus", "christ"]
var c = Array.new(2, 3, "four", a<5 6>)
.say for a.lmap(.split) -- a{l i z a m a d j o u m o n t h e}
.say for a.map(.split) -- a{l i z a}, a{m a d j o u}, a{m o n t h e}
-> Specifies the return type| Stands for alternation, so for example -> Num | Array means to return either a Num or an Array[] Simply means the rest of the arguments are optionalEXP: represents an expression, see maat's BNF for what is an expressionLet a be a variable containing an object of type Array, a supports the following methods:
a.len -> Num: Return the number of elements in aa.of -> Tell us of what type are the elements of aa.clone: Clone object in a into a new fresh one and return ita.min -> Any: Return the minimum element in a based on numeric comparisona.minstr -> Any: Return the minimum element in a based on stringwise comparisona.max -> Any: Return the maximum element in a based on numeric comparisona.maxstr -> Any: Return the maximum element in a based on stringwise comparisona.minmax -> Array: Return an Array of two elements which are the max and min in a respectively.a.minmaxstr -> Array: The stringwise version of a.minmaxa.minmax_op(Array | Set | MSet | Bag | MBag b) -> Array: Return an Array of two elements, first and second are the max and min in a and b resepctivelya.minmax_op_str(Array | Set | MSet | Bag | MBag b) -> Array: Stringwise version of a.minmax_opa.compact -> Array: Remove all nil values in aa.uniq([ Fun f | Expr ]) -> Array: Return a new Array object without duplicate elementsa.first(Fun f | Expr): Return the first element for which its evalution be f or Expr returns a true valuea.head(Str | Num n = 1) -> Any | Array: Return the first n elements of a if n >= 1 or the first n - 1 elements if n <= 0. Fail is a.is_emptya.tail(Str | Num n = 1) -> Any | Array: Same as a.head except that it performs on the last elements of aa.shuf(str | Num n = 1) -> Array: Shuffle elements in a n times and return aa.end -> Any: Return the index of the last element in aa.keys -> Array: Return an Array of indexes of aa.hash -> Map: Return a new Map object with elements from a, abort if a.len is odda.ihash -> Map: Return in a new object the Map version of a with indexes as keysa.rev -> Array: Return a new array which contains reversed elements of aa.join([ Str | Num sep = '' ]) -> Str: Stringyfy elements in a and interleave them with the separator sepa.pop([ Num | Str n = 1 ]) -> Num | Array: At the end, pop and return n elements from a, as a Num if n is 1 else as an Arraya.push(Any x [, Any y, ... ]) -> Array: At the end, push into a elements passed as arguments to pusha.append(Any x [, Any y, ... ]) -> Array: Same as push except that it flattens arrays to append individual elementsa.shift([ Num | Str n ]): Same as what a.pop does but does it at the fronta.unshift([ Num | Str n = 1 ]): Same as what a.push does but does it at the fronta.prepend() -> Array: Same as what a.append does but does it at the fronta.del([ Num | Str n ]): Delete element at index n or deleta, fail if index does not exist in aa.splice([ Num | Str s = 0 ] [, Num | Str l = ] [, Array | Bag | MBag | Set | MSet b ]) -> Array: Remove and return l elements from a, start at s, replace them by b if anya.flat -> Array: It flattens the Array object so that all the elements found in nested array end up direct elements of aa.map(Fun f | Expr) -> Array: Run function f or evaluate expression Expr for each elements in a and collect their return values into an arraya.lmap(Fun f | Expr) -> Array: Same as a.map but .flat the result before returning ita.grep(Fun f | Expr) -> Array: Returns elements in a for which their evaluations by f or Expr return a true valuea.each(Fun f | Expr) -> Array:a.each_kv(Fun f | Expr) -> Array:a.each_ikv(Fun f | Expr):a.cmp(Array b) -> Num:a.print -> Bool:a.say:a.dump: