summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-26 20:09:23 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-26 20:09:23 -0800
commit8b01397de3f74cb608250554119322e53099a9a8 (patch)
treec090748794233af2eeac954d2f70079daeec6503
parent1521adde660652f214be2b8f2811db0c2a0339d2 (diff)
downloadtxr-8b01397de3f74cb608250554119322e53099a9a8.tar.gz
txr-8b01397de3f74cb608250554119322e53099a9a8.tar.bz2
txr-8b01397de3f74cb608250554119322e53099a9a8.zip
* lib.c (make_like): If the first element of list isn't
a character, then don't try to make it into a string; keep it as a list. This allows [mapcar list "abc" "def"] to work intuitively rather than blow up.
-rw-r--r--ChangeLog7
-rw-r--r--lib.c4
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5abbbec9..b5fd075b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2014-02-26 Kaz Kylheku <kaz@kylheku.com>
+ * lib.c (make_like): If the first element of list isn't
+ a character, then don't try to make it into a string;
+ keep it as a list. This allows [mapcar list "abc" "def"]
+ to work intuitively rather than blow up.
+
+2014-02-26 Kaz Kylheku <kaz@kylheku.com>
+
* lib.c (lit_s): New symbol.
(code2type): Return lit_s for LIT type.
(typeof): Return lit_s for TAG_LIT.
diff --git a/lib.c b/lib.c
index 4b1366e1..9aa3af95 100644
--- a/lib.c
+++ b/lib.c
@@ -453,7 +453,9 @@ val make_like(val list, val thatobj)
case STR:
case LIT:
case LSTR:
- return cat_str(list, nil);
+ if (is_chr(car(list)))
+ return cat_str(list, nil);
+ break;
case NIL:
case CONS:
case LCONS: