示例#1
0
文件: String.cs 项目: toshok/shelisp
        public static Shelisp.Object Freplace_match(L l, Shelisp.Object newtext, [LispOptional] Shelisp.Object fixedcase, Shelisp.Object literal, Shelisp.Object str, Shelisp.Object subexp)
        {
            if (!L.NILP (str)) {
                int start = L.match_data[0];
                int end = L.match_data[1];
                string str_s = (string)(Shelisp.String)str;

                return (Shelisp.String)System.String.Concat (str_s.Substring (0, start), newtext.ToString("princ"), str_s.Substring (end));
            }
            else {
                Console.WriteLine ("replace-match not implemented"); return str;
            }
        }
示例#2
0
        public static Shelisp.Object Fread_from_minibuffer(L l, Shelisp.Object prompt,
								    [LispOptional] Shelisp.Object initial_contents, Shelisp.Object keymap, Shelisp.Object read, Shelisp.Object hist, Shelisp.Object default_value, Shelisp.Object inherit_input_method)
        {
            Console.Write (prompt.ToString("princ"));
            var input = Console.ReadLine ();

            if (L.NILP (read))
                return (Shelisp.String)input;
            else {
                return Reader.ReadFromString (input);
            }
        }
示例#3
0
文件: IO.cs 项目: toshok/shelisp
 public static Shelisp.Object Fprint(L l, Shelisp.Object obj, [LispOptional] Shelisp.Object stream)
 {
     Console.WriteLine (obj.ToString("prin1"));
     return obj;
 }
示例#4
0
        public static Shelisp.Object Fcompleting_read(L l, Shelisp.Object prompt, Shelisp.Object collection, [LispOptional] Shelisp.Object predicate, Shelisp.Object require_match,
							       Shelisp.Object initial_input, Shelisp.Object hist, Shelisp.Object def, Shelisp.Object inherit_input_method)
        {
            Console.Write (prompt.ToString("princ"));
            return (Shelisp.String)Console.ReadLine ();
        }
示例#5
0
文件: IO.cs 项目: toshok/shelisp
 public static Shelisp.Object Fprin1_to_string(L l, Shelisp.Object obj)
 {
     return (Shelisp.String)obj.ToString("prin1");
 }