File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 3
3
** REBOL [R3] Language Interpreter and Run-time Environment
4
4
**
5
5
** Copyright 2012 REBOL Technologies
6
+ ** Copyright 2012-2023 Rebol Open Source Developers
6
7
** REBOL is a trademark of REBOL Technologies
7
8
**
8
9
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -443,7 +444,7 @@ enum loop_each_mode {
443
444
if (ANY_OBJECT (value ) || IS_MAP (value )) {
444
445
* vars = * value ;
445
446
} else {
446
- VAL_SET (vars , REB_BLOCK );
447
+ VAL_SET (vars , VAL_TYPE ( value ) );
447
448
VAL_SERIES (vars ) = series ;
448
449
VAL_INDEX (vars ) = index ;
449
450
}
Original file line number Diff line number Diff line change @@ -1524,6 +1524,21 @@ Rebol [
1524
1524
--assert 3 = foreach [ref: k v] m [if ref = m [x: x + v]]
1525
1525
--assert 6 = foreach [ref: k] m [if ref = m [x: x + m/: k]]
1526
1526
--assert ref = 'foo
1527
+
1528
+ --test-- "FOREACH [ref:] series!"
1529
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2530
1530
+ code: [if 2 = index? ref [break /return ref]]
1531
+ foreach [result values][
1532
+ [2 ] [1 2 ]
1533
+ (2 ) (1 2 )
1534
+ b/c a/b/c
1535
+ "bc" "abc"
1536
+ %bc %abc
1537
+ #{ 02 } #{ 0102 }
1538
+ ][
1539
+ --assert result == foreach [ref: ] :values :code
1540
+ ]
1541
+
1527
1542
===end-group===
1528
1543
1529
1544
===start-group=== "MAP-EACH"
You can’t perform that action at this time.
0 commit comments