* load.c: #include "dynwind.h";
[bpt/guile.git] / libguile / variable.c
index 692219c..02f9a5c 100644 (file)
@@ -1,4 +1,4 @@
-/*     Copyright (C) 1995,1996 Free Software Foundation, Inc.
+/*     Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -12,7 +12,8 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this software; 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
  *
  * As a special exception, the Free Software Foundation gives permission
  * for additional uses of the text contained in its release of GUILE.
  *
  * If you write modifications of your own for GUILE, it is your choice
  * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.  
- */
+ * If you do not wish that, delete this exception notice.  */
 \f
 
 #include <stdio.h>
 #include "_scm.h"
+#include "eq.h"
 #include "genio.h"
 #include "smob.h"
 
@@ -67,20 +68,20 @@ prin_var (exp, port, pstate)
      SCM port;
      scm_print_state *pstate;
 {
-  scm_gen_puts (scm_regular_string, "#<variable ", port);
+  scm_puts ("#<variable ", port);
   scm_intprint(exp, 16, port);
   {
     SCM val_cell;
     val_cell = SCM_CDR(exp);
     if (SCM_CAR (val_cell) != SCM_UNDEFINED)
       {
-       scm_gen_puts (scm_regular_string, " name: ", port);
+       scm_puts (" name: ", port);
        scm_iprin1 (SCM_CAR (val_cell), port, pstate);
       }
-    scm_gen_puts (scm_regular_string, " binding: ", port);
+    scm_puts (" binding: ", port);
     scm_iprin1 (SCM_CDR (val_cell), port, pstate);
   }
-  scm_gen_putc('>', port);
+  scm_putc('>', port);
   return 1;
 }
 
@@ -97,8 +98,18 @@ scm_markvar (ptr)
   return SCM_CDR (ptr);
 }
 
+static SCM var_equal SCM_P ((SCM var1, SCM var2));
+
+static SCM
+var_equal (var1, var2)
+     SCM var1;
+     SCM var2;
+{
+  return scm_equal_p (SCM_CDR (var1), SCM_CDR (var2));
+}
+
 int scm_tc16_variable;
-static scm_smobfuns variable_smob = {scm_markvar, free_var, prin_var, 0};
+static scm_smobfuns variable_smob = {scm_markvar, free_var, prin_var, var_equal};
 \f
 
 static SCM anonymous_variable_sym;