Re: [RFT] File Spec

2003-09-14 Thread Gordon Henriksen
On Sunday, September 14, 2003, at 12:50 , Michael G Schwern wrote: On Sat, Sep 13, 2003 at 09:55:48PM +0300, Vladimir Lipskiy wrote: To be clearer: concat_dirnames("b", "/foo") == error. As long as concat_dirnames() will be taught to divine whether its arguments are absolute paths or relative p

Re: [RFT] File Spec

2003-09-14 Thread Michael G Schwern
On Sat, Sep 13, 2003 at 09:55:48PM +0300, Vladimir Lipskiy wrote: > > To be clearer: concat_dirnames("b", "/foo") == error. > > As long as concat_dirnames() will be taught to divine whether its arguments > are absolute paths or relative paths, it could easily rotate its arguments > so the above-m

Re: [RFT] File Spec

2003-09-13 Thread Vladimir Lipskiy
> Are you saying: > > concat_dirnames("C:\foo", "bar") == error? Yes. Even if the file spec tool was smart enough just like you and me it would never be able to unriddle what output it would have to produce as a result of the following call on Mac: concat_dirnames("disk:dir_a", "dir_b"); if "dis

Re: [RFT] File Spec

2003-09-13 Thread Michael G Schwern
On Fri, Sep 12, 2003 at 10:29:04AM +0300, Vladimir Lipskiy wrote: > > People make mistakes. Perhaps you should produce some errors if a user > > strays outside these rules. Garbage in, garbage out: Bad. Garbage in, > > error out: Good. > > It really does that. I mean that it returns a "" when i

Re: [RFT] File Spec

2003-09-12 Thread Leopold Toetsch
Michael G Schwern <[EMAIL PROTECTED]> wrote: > People make mistakes. Perhaps you should produce some errors if a user > strays outside these rules. Garbage in, garbage out: Bad. Garbage in, > error out: Good. Albeit I did write, we need a simple interface to get at runtime libs and includes, I

Re: [RFT] File Spec

2003-09-11 Thread Vladimir Lipskiy
Thursday, September 11, 2003 11:36 PM Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Thu, Sep 11, 2003 at 08:36:02PM +0300, Vladimir Lipskiy wrote: > > > Famous last words: "Our data is perfect, we don't need to check our > > inputs." > > > > Yes. Our data is perfect and we don't need to check

Re: [RFT] File Spec

2003-09-11 Thread Michael G Schwern
On Thu, Sep 11, 2003 at 08:36:02PM +0300, Vladimir Lipskiy wrote: > > Famous last words: "Our data is perfect, we don't need to check our > inputs." > > Yes. Our data is perfect and we don't need to check our inputs if we > play by rules. And the rules are: > > Always use concat_dirnames to conca

Re: [RFT] File Spec

2003-09-11 Thread chromatic
On Thursday, September 11, 2003, at 10:36 AM, Vladimir Lipskiy wrote: If you observe the rules, you won't get into a mess. I'm not convinced "If you don't have users, you won't get into a mess" is a workable design goal for library code. -- c

Re: [RFT] File Spec

2003-09-11 Thread Vladimir Lipskiy
Michael G Schwern <[EMAIL PROTECTED]> wrote: > Why wouldn't appending no filename onto a directory result in the directory > being returned? Unless append_filename() guarantees that it will always > return a filepath ending in a filename? Yes. And it guarantees to return a "", when you do someth

Re: [RFT] File Spec

2003-09-11 Thread Michael G Schwern
On Thu, Sep 11, 2003 at 01:17:29PM +0300, Vladimir Lipskiy wrote: > > Shouldn't that be "."? > > > > > append_filename("a", "") = "" > > > > "a" > > Umm. Don't think so. At least it will be that > way until you convince me that it must be > another way concat_dirnames("a", "") = "a" concat_dirn

Re: [RFT] File Spec

2003-09-11 Thread Vladimir Lipskiy
> Shouldn't that be "."? > > > append_filename("a", "") = "" > > "a" Umm. Don't think so. At least it will be that way until you convince me that it must be another way > > What about > > append_filename("", "b") ? > > Would that be an error? No. It's okay. I just forgot to mention that ca

Re: [RFT] File Spec

2003-09-11 Thread Michael G Schwern
On Thu, Sep 11, 2003 at 10:23:27AM +0300, Vladimir Lipskiy wrote: > Unix et al > == > append_filename(".", "") = "" Shouldn't that be "."? > append_filename("a", "") = "" "a" > append_filename("a", "b") = "a/b" What about append_filename("", "b") ? Would that be an error? Don't for

[RFT] File Spec

2003-09-10 Thread Vladimir Lipskiy
Here is a new variant of File Spec for the Parrot internals. I've changed implementation. Made some alternations concerning with function names. catdir and catfile have become concat_dirnames and append_filename respectively. Now it will work properly on Windows, UNIX, VMS, Mac, cygwin, and OS/2(?)