guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core/libguile values.c values.h


From: Marius Vollmer
Subject: guile/guile-core/libguile values.c values.h
Date: Mon, 26 Mar 2001 14:43:24 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Marius Vollmer <address@hidden> 01/03/26 14:43:23

Modified files:
        guile-core/libguile: values.c values.h 

Log message:
        * values.h (scm_values_vtable, SCM_VALUESP): Moved here so that
        eval.c can use it.
        (scm_call_with_values): Removed.
        * values.c (values_vtable, scm_values_vtable): Added "scm_" prefix
        so that it can be exported.
        (scm_call_with_values): Removed.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/values.c.diff?r1=1.2&r2=1.3
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/values.h.diff?r1=1.1&r2=1.2

Patches:
Index: guile/guile-core/libguile/values.c
diff -u guile/guile-core/libguile/values.c:1.2 
guile/guile-core/libguile/values.c:1.3
--- guile/guile-core/libguile/values.c:1.2      Sat Feb 17 03:24:30 2001
+++ guile/guile-core/libguile/values.c  Mon Mar 26 14:43:23 2001
@@ -52,11 +52,8 @@
 
 #include "libguile/values.h"
 
-static SCM values_vtable;
+SCM scm_values_vtable;
 
-#define SCM_VALUESP(x) (SCM_STRUCTP (x)\
-                        && SCM_EQ_P (scm_struct_vtable (x), values_vtable))
-
 static SCM
 print_values (SCM obj, SCM pwps)
 {
@@ -91,7 +88,7 @@
     result = SCM_CAR (args);
   else
     {
-      result = scm_make_struct (values_vtable, SCM_INUM0,
+      result = scm_make_struct (scm_values_vtable, SCM_INUM0,
                                scm_cons (args, SCM_EOL));
     }
 
@@ -99,46 +96,15 @@
 }
 #undef FUNC_NAME
 
-SCM_DEFINE (scm_call_with_values, "call-with-values", 2, 0, 0,
-           (SCM producer, SCM consumer),
-           "Calls its @var{producer} argument with no values and a\n"
-           "continuation that, when passed some values, calls the\n"
-           "@var{consumer} procedure with those values as arguments.  The\n"
-           "continuation for the call to @var{consumer} is the continuation\n"
-           "of the call to @code{call-with-values}.\n\n"
-           "@example\n"
-           "(call-with-values (lambda () (values 4 5))\n"
-           "                  (lambda (a b) b))\n"
-           "                                             ==>  5\n\n"
-           "@end example\n"
-           "@example\n"
-           "(call-with-values * -)                             ==>  -1\n"
-           "@end example")
-#define FUNC_NAME s_scm_call_with_values
-{
-  SCM product;
-
-  SCM_VALIDATE_PROC (1, producer);
-  SCM_VALIDATE_PROC (2, consumer);
-
-  product = scm_apply (producer, SCM_EOL, SCM_EOL);
-  if (SCM_VALUESP (product))
-    product = scm_struct_ref (product, SCM_INUM0);
-  else
-    product = scm_cons (product, SCM_EOL);
-  return scm_apply (consumer, product, SCM_EOL);
-}
-#undef FUNC_NAME
-
 void
 scm_init_values (void)
 {
   SCM print = scm_make_subr ("%print-values", scm_tc7_subr_2, print_values);
 
-  values_vtable 
+  scm_values_vtable 
     = scm_permanent_object (scm_make_vtable_vtable (scm_makfrom0str ("pr"),
                                                    SCM_INUM0, SCM_EOL));
-  SCM_SET_STRUCT_PRINTER (values_vtable, print);
+  SCM_SET_STRUCT_PRINTER (scm_values_vtable, print);
 
   scm_add_feature ("values");
 
Index: guile/guile-core/libguile/values.h
diff -u guile/guile-core/libguile/values.h:1.1 
guile/guile-core/libguile/values.h:1.2
--- guile/guile-core/libguile/values.h:1.1      Sun Nov 26 10:27:49 2000
+++ guile/guile-core/libguile/values.h  Mon Mar 26 14:43:23 2001
@@ -47,8 +47,12 @@
 
 #include "libguile/__scm.h"
 
+extern SCM scm_values_vtable;
+
+#define SCM_VALUESP(x) (SCM_STRUCTP (x)\
+                        && SCM_EQ_P (scm_struct_vtable (x), scm_values_vtable))
+
 extern SCM scm_values (SCM args);
-extern SCM scm_call_with_values (SCM producer, SCM consumer);
 extern void scm_init_values (void);
 
 #endif  /* SCM_VALUES_H */



reply via email to

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