G. Robert Shiplett
G. Robert Shiplett

Reputation: 119

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

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! ?

Upvotes: 1

Views: 81

Answers (2)

Gregg Irwin
Gregg Irwin

Reputation: 151

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.

Upvotes: 1

rebolek
rebolek

Reputation: 1301

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.

Upvotes: 1

Related Questions