While working on my latest project I've run into a couple of bugs in 
REBOL/Core 2.2.0 (at least on Win98, but I think they're cross-platform 
problems).  I've been able to work around them, but it makes me really hope 
for a release of 2.3 soon..

   The first bug is already fixed in REBOL/View 0.9.8.3.1, but I figured I 
should report it just to be sure the fix gets put into core.  The 
'clean-path mezzanine function (and things built on it like 'change-dir) 
spits out an ugly block of internal data from it's parse rule if it is given 
a path that ends in "..".
Example of the broken behavior:
>>clean-path %..
["rebol/.." "Desktop/rebol/.." "WINDOWS/Desktop/rebol/.." 
"C/WINDOWS/Desktop/rebol/.."]
== %/C/WINDOWS/Desktop/
>>clean-path %editor/..
["editor/.." "rebol/editor/.." "Desktop/rebol/editor/.." 
"WINDOWS/Desktop/rebol/editor/.." "C/WINDOWS/Desktop/rebol/editor/.."]
== %/C/WINDOWS/Desktop/rebol/

   The other bug is in the 'select native (which is also used by the 'switch 
mezzanine where I noticed this behavior).  The problem exists in both /Core 
and /View.  This one was really a pain to track down when it came up in my 
code, for some reason a function that worked normally for most input 
(importing text into a buffer) replaced the text with the value url! for no 
apparent reason when given a block.  I finally discovered that the switch 
statement I was using to act based on the type of the input was searching 
for a value of type block! rather than the value block!.  At first it 
appeared to be a quirk of 'switch, but then I discovered that it actually 
came from 'select.  Then I thought that it was only an undocumented feature, 
but a bit of experimenting showed that the behavior was not entirely 
consistant and should probably be changed.

Examples:
normal operation:
>>select reduce [ string! [1] datatype! [2] block! [3] "foo" [4] ] string!
== [1]

undocumented feature operation:
>>select reduce [ "foo" [4] string! [1] datatype! [2] block! [3] ] string!
== [4]
>>select reduce [ string! [1] datatype! [2] block! [3] "foo" [4] ] block!
== datatype!

normal, but dangerously inconsistant operation:
>>select reduce [ string! [1] datatype! [2] block! [3] "foo" [4] ] datatype!
== [2]

My feeling is that the undocumented behaviour is useful, but should probably 
be optional (available with a refinement) and that 'datatype! should not be 
a special case.

   Cal Dixon ([EMAIL PROTECTED])

-><-

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

Reply via email to