aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Templeton <[email protected]>2014-09-22 10:40:59 -0400
committerRobin Templeton <[email protected]>2015-04-20 00:29:03 -0400
commit5fdac58a86e83e2d4bd272d7dd4959c3ef2100bd (patch)
tree183a6090345943dea6d951a6a4aed2b9a557882c
parentfa4d389029c1a53dbd89ae99638c7b3a4e1b6f7b (diff)
print scheme objects unreadably
* src/lread.c (print_object): Print Scheme objects unreadably, instead of printing them in Scheme syntax. Thanks to Taylan Ulrich Bayırlı/Kammer <[email protected]> for the report.
-rw-r--r--src/print.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c
index 05a5dd70ae..a8bad353d0 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2142,11 +2142,16 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
case Lisp_Other:
{
+ static SCM prefix;
SCM port = scm_open_output_string ();
+ if (SCM_UNLIKELY (!prefix))
+ prefix = scm_from_latin1_string ("#<scheme ");
+ scm_display (prefix, port);
if (escapeflag)
scm_display (obj, port);
else
scm_write (obj, port);
+ scm_display (SCM_MAKE_CHAR ('>'), port);
strout (scm_to_locale_string (scm_get_output_string (port)),
-1, -1, printcharfun);
scm_close_port (port);