diff options
author | Jim Blandy <jimb@red-bean.com> | 1997-05-15 02:02:40 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1997-05-15 02:02:40 +0000 |
commit | b377f53e56680c143c066ccb0aeec2b361fc1edd (patch) | |
tree | db330c929024db736c948dd9d2acc288b465fcd2 | |
parent | 3a3e9e09b8df62fb0981aa22f876cc39ab680e74 (diff) | |
download | guile-b377f53e56680c143c066ccb0aeec2b361fc1edd.tar.gz |
* strports.c (scm_eval_string): New function.
(scm_eval_0str): Trivially re-implemented in terms of
scm_eval_string.
* strports.h (scm_eval_string): New extern decl.
-rw-r--r-- | libguile/strports.c | 17 | ||||
-rw-r--r-- | libguile/strports.h | 1 |
2 files changed, 14 insertions, 4 deletions
diff --git a/libguile/strports.c b/libguile/strports.c index 34485f0b3..55ae2ed1e 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -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 diff --git a/libguile/strports.h b/libguile/strports.h index fc0a1ed9f..ecba678e4 100644 --- a/libguile/strports.h +++ b/libguile/strports.h @@ -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 */ |