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