Skip to content

Commit cbc67ca

Browse files
committed
FIX: words-of map normalizes KEY words to be always ordinary word
Fixes: metaeducation/rebol-issues#2353
1 parent c600d8a commit cbc67ca

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/core/t-map.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,14 @@
369369
out = BLK_HEAD(blk);
370370
for (val = BLK_HEAD(mapser); NOT_END(val) && NOT_END(val+1); val += 2) {
371371
if (!IS_NONE(val+1)) {
372-
if (what <= 0) *out++ = val[0];
373-
if (what >= 0) *out++ = val[1];
372+
if (what < 0) {
373+
// words-of
374+
*out++ = val[0];
375+
if (ANY_WORD(val)) VAL_SET(out - 1, REB_WORD);
376+
}
377+
else if (what == 0)
378+
*out++ = val[0]; // body-of
379+
if (what >= 0) *out++ = val[1]; // values
374380
}
375381
}
376382

0 commit comments

Comments
 (0)