Explorar el Código

add missing documentation to Array.map/filter

Simon Krajewski hace 12 años
padre
commit
d506da3142
Se han modificado 1 ficheros con 16 adiciones y 0 borrados
  1. 16 0
      std/Array.hx

+ 16 - 0
std/Array.hx

@@ -235,6 +235,22 @@ extern class Array<T> {
 	**/
 	**/
 	function iterator() : Iterator<T>;
 	function iterator() : Iterator<T>;
 
 
+	/**
+		Creates a new Array by applying function `f` to all elements of `this`.
+		
+		The order of elements is preserved.
+		
+		If `f` is null, the result is unspecified.
+	**/	
 	function map<S>( f : T -> S ) : Array<S>;
 	function map<S>( f : T -> S ) : Array<S>;
+	
+	/**
+		Returns an Array containing those elements of `this` for which `f`
+		returned true.
+
+		The individual elements are not duplicated and retain their identity.
+		
+		If `f` is null, the result is unspecified.
+	**/	
 	function filter( f : T -> Bool ) : Array<T>;
 	function filter( f : T -> Bool ) : Array<T>;
 }
 }