From 8b01397de3f74cb608250554119322e53099a9a8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 26 Feb 2014 20:09:23 -0800 Subject: * 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. --- ChangeLog | 7 +++++++ lib.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5abbbec9..b5fd075b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-02-26 Kaz Kylheku + + * 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 * lib.c (lit_s): New symbol. 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: -- cgit v1.2.3