Why can Rebol repeat not take a literal word type of value

87 Views Asked by At

The Rebol function set accepts an any-word! but repeat only accepts word!

Is there a particular reason that repeat could not also accept a lit-word! ?

2

There are 2 best solutions below

0
On

repeat uses same syntax as foreach and similar functions. They all accept word! only. I guess there's no particular reason, it's just what people are used to.

0
On

lit-word! params can be a bit confusing. That is, when the param is a lit-word!, you're saying "don't evaluate it", so passing a word! means the func is already seeing it as a lit-word!.

R3 only supports word! args in foreach as well, which is more consistent. Things look much cleaner this way, and are the best model when you write your own control funcs and such.