(Faref): Use SPLIT_CHAR instead of SPLIT_NON_ASCII_CHAR.
[bpt/emacs.git] / src / mocklisp.c
index 5f9d2df..00329b8 100644 (file)
@@ -1,11 +1,11 @@
 /* Mocklisp compatibility functions for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986, 1995 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -15,7 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 
 /* Compatibility for mocklisp */
@@ -49,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))
     {
@@ -66,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
 \f
 /* This is the main entry point to mocklisp execution.
  When eval sees a mocklisp function being called, it calls here
@@ -119,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));
@@ -210,9 +213,9 @@ is converted into a string by expressing it in decimal.")
     {
       tem = args[argnum];
     retry:
-      if (XTYPE (tem) == Lisp_Int)
+      if (INTEGERP (tem))
        tem = Fnumber_to_string (tem);
-      if (XTYPE (tem) == Lisp_String)
+      if (STRINGP (tem))
        insert1 (tem);
       else
        {
@@ -225,6 +228,7 @@ is converted into a string by expressing it in decimal.")
 }
 
 \f
+void
 syms_of_mocklisp ()
 {
   Qmocklisp = intern ("mocklisp");