Olivier wrote:
> 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!.
I haven't come across that one! I agree totally that that's a problem.
> 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]
I would prefer the result of:
split-path http://www.rebol.com
and
split-path http://www.rebol.com/
to both be:
[http://www.rebol.com/ %.]
In other words, the target is the current directory of the path:
http://www.rebol.com
I would prefer the result of:
split-path %/
to be:
[%/ %.]
The target is the current directory of the root.
> 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.
Totally agree. This is a job that list members could implement most of the
test code for, perhaps?
> 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.
Agreed.
Andrew Martin
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-