summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Judson Rosen2017-03-19 15:40:45 -0400
committerJoshua Judson Rosen2017-03-28 22:07:50 -0400
commit3f67b9fe5713bd19d314500316be387ff7843c30 (patch)
treee2d15a740aa3ea12b3778a36000274ad20649fd0
parentrobot-move: prevent crash on zero-length moves (diff)
downloadgnurobots-3f67b9fe5713bd19d314500316be387ff7843c30.tar.gz
api: accept symbols (as well as strings)
This seems a lot more natural for scheme code.
-rw-r--r--src/api.c9
1 files changed, 9 insertions, 0 deletions
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);