* strports.c (scm_eval_string): New function.
authorJim Blandy <jimb@red-bean.com>
Thu, 15 May 1997 02:02:40 +0000 (02:02 +0000)
committerJim Blandy <jimb@red-bean.com>
Thu, 15 May 1997 02:02:40 +0000 (02:02 +0000)
(scm_eval_0str): Trivially re-implemented in terms of
scm_eval_string.
* strports.h (scm_eval_string): New extern decl.

libguile/strports.c
libguile/strports.h

index 34485f0..55ae2ed 100644 (file)
@@ -254,12 +254,20 @@ SCM
 scm_eval_0str (expr)
      char *expr;
 {
-  SCM port = scm_mkstrport (SCM_MAKINUM (0),
-                           scm_makfrom0str (expr),
-                           SCM_OPN | SCM_RDNG,
+  return scm_eval_string (scm_makfrom0str (expr));
+}
+
+
+SCM_PROC (s_eval_string, "eval-string", 1, 0, 0, scm_eval_string);
+
+SCM
+scm_eval_string (string)
+     SCM string;
+{
+  SCM port = scm_mkstrport (SCM_MAKINUM (0), string, SCM_OPN | SCM_RDNG,
                            "scm_eval_0str");
   SCM form;
-  SCM ans = SCM_EOL;
+  SCM ans = SCM_UNSPECIFIED;
 
   /* Read expressions from that port; ignore the values.  */
   while ((form = scm_read (port)) != SCM_EOF_VAL)
@@ -270,6 +278,7 @@ scm_eval_0str (expr)
 }
 
 
+
 static int noop0 SCM_P ((SCM stream));
 
 static int 
index fc0a1ed..ecba678 100644 (file)
@@ -56,6 +56,7 @@ extern SCM scm_strprint_obj SCM_P ((SCM obj));
 extern SCM scm_call_with_input_string SCM_P ((SCM str, SCM proc));
 extern SCM scm_read_0str SCM_P ((char *expr));
 extern SCM scm_eval_0str SCM_P ((char *expr));
+extern SCM scm_eval_string SCM_P ((SCM string));
 extern void scm_init_strports SCM_P ((void));
 
 #endif  /* STRPORTSH */