Andrew Martin wrote:
> [EMAIL PROTECTED] wrote:
> >             split-path %file.r
> >             split-path %dir/
>
> These ones, I feel, aren't a problem. The existing implementation of
> split-path is correct, I believe.

There is a problem. Look at the type of the second element of the result :
>> split-path %fdgd/file.r
== [%fdgd/ %file.r]
>> split-path %file.r
== [%./ "file.r"]

In one case it is a string!, in the other it is a file!.

There is also others problems with the original split-path:
>> split-path http://www.rebol.com
== [http:// %www.rebol.com]
>> split-path http://www.rebol.com/
== [http:// %www.rebol.com/]

I would prefer to get
== [http://www.rebol.com/ none]
in both cases, as in the following:
>> split-path %/
== [%/ none]

To summarize, split-path is so inconsistent that I will never use the
current version for real work.

clean-path is as buggy (even more) :
>> clean-path http://www/dfhfgh/../fghfgh
== http://www/dfhfgh/../fghfgh
(doesn't remove . and .. in URLs)
>> clean-path %""
** Script Error: Out of range or past end.
** Where: first target-copy


What would be cool, in fact would be a reference test suite for every
function of REBOL. Every Perl module provide such tests to assure
consistence between platforms.
It seems that Rebol (the company) doesn't use such methods to assure code
quality. But it's not too late to take another way than Microsoft's.


Olivier.

Reply via email to