Even More Rugby Fixes
08-Apr-2007 13:43 Filed in: Rugby
The first
bug fix went not as deep as I thought it
should. The fix made it possible to evaluate
Rugby shared functions where the first argument
is a word.
Let's say that we have a Rugby shared function test-func in a net context and it returns the first argument:
But having multiple arguments where just one of them is a word, caused the same bug to appear again. test-func2 here accepts two arguments:
The new fix, fixes this bug by asking whether the argument is of type any-word and converts it to a lit-word! before evaluating the function server side.
This happens inside Rugby's function to parse and collect function refinements and arguments. The change looks like this:
Before:
After:
I'm still troubled that this is not a truly elegant solution to the problem, treating the symptoms like this rather than going for the cause. It works for now though, and you can download the latest version 5.0.4 here.
The source file now also contains a history of changes made by me.
Let's say that we have a Rugby shared function test-func in a net context and it returns the first argument:
net/test-func 'a
== a
But having multiple arguments where just one of them is a word, caused the same bug to appear again. test-func2 here accepts two arguments:
net/test-func2 5 'a
** Script Error: a has no value
The new fix, fixes this bug by asking whether the argument is of type any-word and converts it to a lit-word! before evaluating the function server side.
This happens inside Rugby's function to parse and collect function refinements and arguments. The change looks like this:
Before:
p2: [set w word!
(if ref-mode [append/only statement get bind to-word w 'comm])]
After:
p2: [set w word!
(if ref-mode [
w: get bind to-word w 'comm
append/only statement either any-word? w [to lit-word! w][w]]
)
]
I'm still troubled that this is not a truly elegant solution to the problem, treating the symptoms like this rather than going for the cause. It works for now though, and you can download the latest version 5.0.4 here.
The source file now also contains a history of changes made by me.
|