X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/3b7ad313e0d7b351c55cf999474b61cdc18ecad1..b735c9913f34f4a9645e835ebc52733bedf6882d:/src/mocklisp.c diff --git a/src/mocklisp.c b/src/mocklisp.c index ad6ae9908c..00329b8038 100644 --- a/src/mocklisp.c +++ b/src/mocklisp.c @@ -50,6 +50,7 @@ DEFUN ("ml-if", Fml_if, Sml_if, 0, UNEVALLED, 0, "Mocklisp version of `if'.") register Lisp_Object val; struct gcpro gcpro1; + val = Qnil; GCPRO1 (args); while (!NILP (args)) { @@ -67,27 +68,28 @@ DEFUN ("ml-if", Fml_if, Sml_if, 0, UNEVALLED, 0, "Mocklisp version of `if'.") return val; } -/* Now converted to regular "while" by hairier conversion code. -* DEFUN ("ml-while", Fml_while, Sml_while, 1, UNEVALLED, 0, "while for mocklisp programs") -* (args) -* Lisp_Object args; -* { -* Lisp_Object test, body, tem; -* struct gcpro gcpro1, gcpro2; -* -* GCPRO2 (test, body); -* -* test = Fcar (args); -* body = Fcdr (args); -* while (tem = Feval (test), XINT (tem)) -* { -* QUIT; -* Fprogn (body); -* } -* -* UNGCPRO; -* return Qnil; -*} +#if 0 /* Now converted to regular "while" by hairier conversion code. */ +/**/DEFUN ("ml-while", Fml_while, Sml_while, 1, UNEVALLED, 0, "while for mocklisp programs") + (args) + Lisp_Object args; +{ + Lisp_Object test, body, tem; + struct gcpro gcpro1, gcpro2; + + GCPRO2 (test, body); + + test = Fcar (args); + body = Fcdr (args); + while (tem = Feval (test), XINT (tem)) + { + QUIT; + Fprogn (body); + } + + UNGCPRO; + return Qnil; +} +#endif /* This is the main entry point to mocklisp execution. When eval sees a mocklisp function being called, it calls here @@ -120,7 +122,7 @@ DEFUN ("ml-arg", Fml_arg, Sml_arg, 1, 2, 0, Lisp_Object n, prompt; { if (EQ (Vmocklisp_arguments, Qinteractive)) - return Fread_string (prompt, Qnil); + return Fread_string (prompt, Qnil, Qnil, Qnil, Qnil); CHECK_NUMBER (n, 0); XSETINT (n, XINT (n) - 1); /* Mocklisp likes to be origin-1 */ return Fcar (Fnthcdr (n, Vmocklisp_arguments)); @@ -226,6 +228,7 @@ is converted into a string by expressing it in decimal.") } +void syms_of_mocklisp () { Qmocklisp = intern ("mocklisp");