-/* 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
*
* 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"
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;
}
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;
SCM answer;
SCM_NEWCELL(answer);
SCM_REDEFER_INTS;
- SCM_CAR(answer) = scm_tc16_variable;
- SCM_CDR(answer) = vcell;
+ SCM_SETCAR (answer, scm_tc16_variable);
+ SCM_SETCDR (answer, vcell);
SCM_REALLOW_INTS;
return answer;
}
SCM_NEWCELL(val_cell);
SCM_DEFER_INTS;
- SCM_CAR(val_cell) = name_hint;
- SCM_CDR(val_cell) = init;
+ SCM_SETCAR (val_cell, name_hint);
+ SCM_SETCDR (val_cell, init);
SCM_ALLOW_INTS;
return make_vcell_variable (val_cell);
}
SCM_NEWCELL (vcell);
SCM_DEFER_INTS;
- SCM_CAR (vcell) = name_hint;
- SCM_CDR (vcell) = SCM_UNDEFINED;
+ SCM_SETCAR (vcell, name_hint);
+ SCM_SETCDR (vcell, SCM_UNDEFINED);
SCM_ALLOW_INTS;
return make_vcell_variable (vcell);
}
SCM val;
{
SCM_ASSERT (SCM_NIMP(var) && SCM_VARIABLEP (var), var, SCM_ARG1, s_variable_set_x);
- SCM_CDR (SCM_CDR (var)) = val;
+ SCM_SETCDR (SCM_CDR (var), val);
return SCM_UNSPECIFIED;
}
SCM_DEFER_INTS;
if ( SCM_IMP (SCM_CDR (var_slot))
|| (SCM_VARVCELL (var_slot) != vcell))
- SCM_CDR (var_slot) = make_vcell_variable (vcell);
+ SCM_SETCDR (var_slot, make_vcell_variable (vcell));
SCM_ALLOW_INTS;
return SCM_CDR (var_slot);