[EMAIL PROTECTED] wrote:
> after having some problems with split-path, here is my version:
>
> (Andrew, it may be nice to have it in your %patch.r)

>             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.

>             split-path to file! ""

I agree that this one's incorrect, and needs fixing.

Andrew Martin
Bored with getmsg...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, 26 February 2000 9:23 PM
Subject: [REBOL] Split-path correction


> Hi,
>
> after having some problems with split-path, here is my version:
>
> (Andrew, it may be nice to have it in your %patch.r)
>
> split-path: func [
>     {
>         Splits a file or URL. Returns a block containing path and
> target.
>
>         Overcomes some limitations of the Core split-path like
> strange results for:
>
>             split-path %file.r
>             split-path %dir/
>             split-path to file! ""
>
>         Moreover, the identity:
>
>             file = (append copy first r: split-path file second r)
>
>         is always preserved.
>     }
>     file [file! url!]
>     /local path target
> ] [
>     target: path: to string! file
>     parse path [any [#"/" target: | skip]]
>     path: copy/part path target
>     reduce [to file path to file target]
> ]
>

Reply via email to