Exemple #1
0
        public DynValue ReadLine(Interpreter interpreter, ClrFunctionArguments args)
        {
            args.ExpectAtMost(1);

            var prompt = string.Empty;

            if (args.Count == 1)
            {
                args.ExpectTypeAtIndex(0, DynValueType.String);
                prompt = args[0].String;
            }

            return(new DynValue(
                       Kernel.Instance.Terminal.ReadLine(
                           prompt,
                           Kernel.Instance.InteractionCancellation.Token
                           )
                       ));
        }