//>>built
define("dojox/lang/functional/array",["dojo/_base/kernel","dojo/_base/lang","dojo/_base/array","./lambda"],function(i,h,l,g){var j={};h.mixin(g,{filter:function(a,d,c){"string"==typeof a&&(a=a.split(""));var c=c||i.global,d=g.lambda(d),b=[],f,e,k;if(h.isArray(a))for(e=0,k=a.length;e<k;++e)f=a[e],d.call(c,f,e,a)&&b.push(f);else if("function"==typeof a.hasNext&&"function"==typeof a.next)for(e=0;a.hasNext();)f=a.next(),d.call(c,f,e++,a)&&b.push(f);else for(e in a)e in j||(f=a[e],d.call(c,f,e,a)&&b.push(f));
return b},forEach:function(a,d,c){"string"==typeof a&&(a=a.split(""));var c=c||i.global,d=g.lambda(d),b,f;if(h.isArray(a))for(b=0,f=a.length;b<f;d.call(c,a[b],b,a),++b);else if("function"==typeof a.hasNext&&"function"==typeof a.next)for(b=0;a.hasNext();d.call(c,a.next(),b++,a));else for(b in a)b in j||d.call(c,a[b],b,a);return c},map:function(a,d,c){"string"==typeof a&&(a=a.split(""));var c=c||i.global,d=g.lambda(d),b,f,e;if(h.isArray(a)){b=Array(f=a.length);for(e=0;e<f;b[e]=d.call(c,a[e],e,a),++e);
}else if("function"==typeof a.hasNext&&"function"==typeof a.next){b=[];for(e=0;a.hasNext();b.push(d.call(c,a.next(),e++,a)));}else for(e in b=[],a)e in j||b.push(d.call(c,a[e],e,a));return b},every:function(a,d,c){"string"==typeof a&&(a=a.split(""));var c=c||i.global,d=g.lambda(d),b,f;if(h.isArray(a))for(b=0,f=a.length;b<f;++b){if(!d.call(c,a[b],b,a))return!1}else if("function"==typeof a.hasNext&&"function"==typeof a.next)for(b=0;a.hasNext();){if(!d.call(c,a.next(),b++,a))return!1}else for(b in a)if(!(b in
j)&&!d.call(c,a[b],b,a))return!1;return!0},some:function(a,d,c){"string"==typeof a&&(a=a.split(""));var c=c||i.global,d=g.lambda(d),b,f;if(h.isArray(a))for(b=0,f=a.length;b<f;++b){if(d.call(c,a[b],b,a))return!0}else if("function"==typeof a.hasNext&&"function"==typeof a.next)for(b=0;a.hasNext();){if(d.call(c,a.next(),b++,a))return!0}else for(b in a)if(!(b in j)&&d.call(c,a[b],b,a))return!0;return!1}});return g});