summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-06-06 21:14:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-06-06 21:14:42 -0700
commit4ab49152980d3b9626d294af7d8ee9c296c09943 (patch)
treed8fdfabc9959c7bbc1225121e80e66cf47111dc5
parent265746e8cfedd7efed194f968500c041b2af20af (diff)
downloadtxr-4ab49152980d3b9626d294af7d8ee9c296c09943.tar.gz
txr-4ab49152980d3b9626d294af7d8ee9c296c09943.tar.bz2
txr-4ab49152980d3b9626d294af7d8ee9c296c09943.zip
Handle sequence structs in toseq.
* lib.c (toseq): Handle OBJP case, and implement behavior for struct objects that have a car method.
-rw-r--r--lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 3e245e40..29d11ef9 100644
--- a/lib.c
+++ b/lib.c
@@ -691,6 +691,10 @@ val toseq(val seq)
case CONS:
case LCONS:
return nullify(seq);
+ case COBJ:
+ if (structp(seq) && maybe_slot(seq, car_s))
+ return nullify(seq);
+ /* fallthrough */
default:
return cons(seq, nil);
}