From 3f67b9fe5713bd19d314500316be387ff7843c30 Mon Sep 17 00:00:00 2001 From: Joshua Judson Rosen Date: Sun, 19 Mar 2017 15:40:45 -0400 Subject: api: accept symbols (as well as strings) This seems a lot more natural for scheme code. --- src/api.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api.c b/src/api.c index 8143423..0274f48 100644 --- a/src/api.c +++ b/src/api.c @@ -51,6 +51,9 @@ api_robot_smell (SCM s_th) gboolean ret; gchar *str; + if (scm_symbol_p (s_th) == SCM_BOOL_T) { + s_th = scm_symbol_to_string (s_th); + } str = scm_to_locale_string (s_th); ret = g_robot_smell (robot, str); @@ -63,6 +66,9 @@ api_robot_feel (SCM s_th) gboolean ret; gchar *str; + if (scm_symbol_p (s_th) == SCM_BOOL_T) { + s_th = scm_symbol_to_string (s_th); + } str = scm_to_locale_string (s_th); ret = g_robot_feel (robot, str); @@ -75,6 +81,9 @@ api_robot_look (SCM s_th) gboolean ret; gchar *str; + if (scm_symbol_p (s_th) == SCM_BOOL_T) { + s_th = scm_symbol_to_string (s_th); + } str = scm_to_locale_string (s_th); ret = g_robot_look (robot, str); -- cgit v1.1