guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile variable.c


From: Marius Vollmer
Subject: guile/guile-core/libguile variable.c
Date: Mon, 14 May 2001 07:09:54 -0700

CVSROOT:        /cvs
Module name:    guile
Branch:         mvo-vcell-cleanup-1-branch
Changes by:     Marius Vollmer <address@hidden> 01/05/14 07:09:54

Modified files:
        guile-core/libguile: variable.c 

Log message:
        Added removed vcell and obarray functions back as deprecated.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/variable.c.diff?cvsroot=OldCVS&only_with_tag=mvo-vcell-cleanup-1-branch&tr1=1.34.2.1&tr2=1.34.2.2&r1=text&r2=text

Patches:
Index: guile/guile-core/libguile/variable.c
diff -u guile/guile-core/libguile/variable.c:1.33 
guile/guile-core/libguile/variable.c:1.34
--- guile/guile-core/libguile/variable.c:1.33   Fri Mar  9 15:33:41 2001
+++ guile/guile-core/libguile/variable.c        Fri Mar 30 07:03:23 2001
@@ -1,4 +1,4 @@
-/*     Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, 
Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000,2001 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
@@ -59,17 +59,16 @@
 variable_print (SCM exp, SCM port, scm_print_state *pstate)
 {
   scm_puts ("#<variable ", port);
-  scm_intprint(SCM_UNPACK (exp), 16, port);
+  scm_intprint (SCM_UNPACK (exp), 16, port);
   {
-    SCM val_cell;
-    val_cell = SCM_CDR(exp);
-    if (!SCM_UNBNDP (SCM_CAR (val_cell)))
+    SCM vcell = SCM_VARVCELL (exp);
+    if (!SCM_UNBNDP (SCM_CAR (vcell)))
       {
        scm_puts (" name: ", port);
-       scm_iprin1 (SCM_CAR (val_cell), port, pstate);
+       scm_iprin1 (SCM_CAR (vcell), port, pstate);
       }
     scm_puts (" binding: ", port);
-    scm_iprin1 (SCM_CDR (val_cell), port, pstate);
+    scm_iprin1 (SCM_CDR (vcell), port, pstate);
   }
   scm_putc('>', port);
   return 1;
@@ -78,7 +77,7 @@
 static SCM
 variable_equalp (SCM var1, SCM var2)
 {
-  return scm_equal_p (SCM_CDR (var1), SCM_CDR (var2));
+  return scm_equal_p (SCM_VARVCELL (var1), SCM_VARVCELL (var2));
 }
 
 
@@ -100,17 +99,13 @@
             "variable may exist, so @var{name-hint} is just that---a hint.\n")
 #define FUNC_NAME s_scm_make_variable
 {
-  SCM val_cell;
+  SCM vcell;
   
   if (SCM_UNBNDP (name_hint))
     name_hint = anonymous_variable_sym;
 
-  SCM_NEWCELL(val_cell);
-  SCM_DEFER_INTS;
-  SCM_SETCAR (val_cell, name_hint);
-  SCM_SETCDR (val_cell, init);
-  SCM_ALLOW_INTS;
-  return make_vcell_variable (val_cell);
+  vcell = scm_cons (name_hint, init);
+  return make_vcell_variable (vcell);
 }
 #undef FUNC_NAME
 
@@ -129,11 +124,7 @@
   if (SCM_UNBNDP (name_hint))
     name_hint = anonymous_variable_sym;
 
-  SCM_NEWCELL (vcell);
-  SCM_DEFER_INTS;
-  SCM_SETCAR (vcell, name_hint);
-  SCM_SETCDR (vcell, SCM_UNDEFINED);
-  SCM_ALLOW_INTS;
+  vcell = scm_cons (name_hint, SCM_UNDEFINED);
   return make_vcell_variable (vcell);
 }
 #undef FUNC_NAME
@@ -158,7 +149,7 @@
 #define FUNC_NAME s_scm_variable_ref
 {
   SCM_VALIDATE_VARIABLE (1, var);
-  return SCM_CDR (SCM_CDR (var));
+  return SCM_CDR (SCM_VARVCELL (var));
 }
 #undef FUNC_NAME
 
@@ -171,8 +162,8 @@
            "value. Return an unspecified value.\n")
 #define FUNC_NAME s_scm_variable_set_x
 {
-  SCM_VALIDATE_VARIABLE (1,var);
-  SCM_SETCDR (SCM_CDR (var), val);
+  SCM_VALIDATE_VARIABLE (1, var);
+  SCM_SETCDR (SCM_VARVCELL (var), val);
   return SCM_UNSPECIFIED;
 }
 #undef FUNC_NAME
@@ -213,8 +204,8 @@
             "Throws an error if @var{var} is not a variable object.\n")
 #define FUNC_NAME s_scm_variable_bound_p
 {
-  SCM_VALIDATE_VARIABLE (1,var);
-  return SCM_NEGATE_BOOL(SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (var))));
+  SCM_VALIDATE_VARIABLE (1, var);
+  return SCM_BOOL (!SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (var))));
 }
 #undef FUNC_NAME
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]