 	import flash.utils.Timer;
 	import flash.utils.getQualifiedClassName;
 	
+	import avmplus.DescribeType;
+	
+	import weave.api.getCallbackCollection;
+	import weave.api.getSessionState;
 	import weave.api.core.DynamicState;
 	import weave.api.core.ILinkableObject;
-	import weave.api.getCallbackCollection;
-	import weave.api.getSessionState;
 	import weave.compiler.Compiler;
 	import weave.compiler.StandardLib;
 	

			var t:Timer = new Timer(delay, 1);
			t.addEventListener(TimerEvent.TIMER, function(..._):*{ func.apply(null, params); });
			t.start();
		}
		
		/**

			StandardLib.sortOn(keys, function(key:String):String { return key.split('::').pop(); });
			return keys.map(function(key:String, i:int, a:Array):String { return '\t' + key + ': ' + debugId(object[key]); }).join('\n');
		}
		
		public static const HISTORY_TO_CSV:String = StandardLib.unIndent(<![CDATA[
			var data = [['t','path','value']].concat.apply(null, Weave.history.undoHistory.map((e,t)=>flattenSessionState(e.forward).map((a,i)=>[t,'Weave'+a[0].map(n=>EquationColumn.compiler.isValidSymbolName(n)?'.'+n:Compiler.stringify([n])).join(''),Compiler.stringify(a[1])])));
			var name = WeaveAPI.globalHashMap.generateUniqueName("Session History");
			var csv = WeaveAPI.globalHashMap.requestObject(name, CSVDataSource, false);
			csv.csvData.setSessionState(data);
			var table = WeaveAPI.globalHashMap.requestObject(null, TableTool, false);
			data[0].forEach(n=>csv.putColumnInHashMap(n, table.columns));
		]]>);
	}
}
