Exemplo n.º 1
0
		public void Activate(string[] args)
		{
			bool verbose = false;
			if (args.Length > 0)
			{
				foreach (string arg in args)
				{
					if (arg.ToLower() ==  "/verbose")
						verbose = true;
				}
			}
			try
			{
				runtime = new Runtime();
				Environment globalEnvironment = new Environment();
				foreach (string line in LSharpCode)
				{
					if (verbose)
						Console.Write(line + " --> ");
					System.IO.StringReader reader = new System.IO.StringReader(line);
					object output = Runtime.EvalString(line, globalEnvironment);
					Console.WriteLine(Printer.WriteToString(output));
				}
			}
			catch (Exception e)
			{
				Console.WriteLine(e.ToString());
			}
			System.Console.WriteLine("Press any key to Continue...");
			System.Console.ReadKey(true);
		}
Exemplo n.º 2
0
		public void Activate(string[] args)
		{
			try
			{
				runtime = new Runtime();
				Environment globalEnvironment = new Environment();
				string code = "";
				foreach (string line in LSharpCode)
					code += "\n" + line;

				object output = Runtime.EvalString(code, globalEnvironment);
				Console.WriteLine(Printer.WriteToString(output));
			}
			catch (Exception e)
			{
				Console.WriteLine(e.ToString());
			}
			System.Console.WriteLine("Press any key to Continue...");
			System.Console.ReadKey(true);
		}
Exemplo n.º 3
0
		public void Activate(string[] args)
		{
			try
			{
				runtime = new Runtime();
				Environment globalEnvironment = new Environment();
				string code = "(do ";
				foreach (string line in LSharpCode)
					code += "\n" + line;
				code += ")";
				object output = Runtime.Eval(Reader.Read(new System.IO.StringReader(code),ReadTable.DefaultReadTable()), globalEnvironment);
				Console.WriteLine(Printer.WriteToString(output));
			}
			catch (Exception e)
			{
				Console.WriteLine(e.ToString());
			}
			//TODO: enable this as a CMD Arg
			//System.Console.WriteLine("Press any key to Continue...");
			//System.Console.ReadKey(true);
		}