Repl() public method

A Read Eval Print Loop
public Repl ( ) : void
return void
示例#1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        /// [STAThread]
        static void Main(string[] args)
        {
            Runtime runtime = new Runtime(System.Console.In, System.Console.Out, System.Console.Error);

            if (args.Length < 1)
            {
                // Interactive Read, Eval, Print Loop
                runtime.Repl();
            }
            else
            {
                // Batch mode
                string filename = args[0];

                // Windows uses backslash as directory separator, so
                // we must escape it
                filename = filename.Replace("\\", "\\\\");

                runtime.Load(filename);

            }
        }