Returning any-word! with Rugby

I discovered that Rugby evaluates anything before it's returned, so if you are returning any-word! values (words, lit-words, etc.), like this:

test: does ['some-word]

Rugby will attempt to evaluate some-word.

If it fails, because it's unset, Rugby returns an error in an internal function. I believe this to be incorrect, because this breaks the paradigm of having Rugby be able to serve any REBOL function unchanged.

I've not had this behavior verified as correct by Maarten Koopmans, but I made a patch to the to-result that passes any-word! values through, while other return values are still evaluated. If you are using code, that relies on the word to be evaluated before being returned by Rugby, your code will break.

UPDATE:

An improved fix checks for set values in a returned word, so if your word has a value, it will be evaluated. Words that don't have a value, as well as lit-words will still not be evaluated. It has been approved by Maarten as a fix.

I've uploaded a patched version here.
|