REBOL3 tracker
  0.9.12 beta
Ticket #0002236 User: anonymous


Previous Next
TypeWish Statusdismissed Date3-Aug-2015 15:28
Versionr3 master CategoryNative Submitted byGraham
PlatformAll Severityminor Prioritynormal

Summary Allow foreach to use a block of words
Description At present foreach accepts a single word as its first parameter. I'd like to see it accept a block of words as well so we can access the data by word rather then having to use forskip.

Although forskip gives a none for values outside the provided data, I think we should create an error if a word has no corresponding data element.
Example code


Assigned ton/a Fixed in- Last Update12-Aug-2015 20:40

12-Aug-2015 20:39

FOREACH already supports a block of words:

>> foreach [a b c] [10 11 12 20 21 22] [print ['a a 'b b 'c c]]
a 10 b 11 c 12
a 20 b 21 c 22

So I'm closing this ticket, assuming you just missed this functionality already present. But please feel free to re-open or re-create a new one if that's not what you wanted.

Date User Field Action Change
12-Aug-2015 20:40 abolka Summary Modified allow foreach to use a block of words => Allow foreach to use a block of words
12-Aug-2015 20:40 abolka Description Modified -
12-Aug-2015 20:39 abolka Status Modified submitted => dismissed
12-Aug-2015 20:39 abolka Comment : 0004654 Added -
3-Aug-2015 15:38 Graham Description Modified -
3-Aug-2015 15:28 Graham Ticket Added -