On 17 Mar 2013, at 17:55, stephane ducasse <stephane.ducasse@free.fr> wrote:
may be this is stupid but I still say it :)
This is cool and in fact may be having the interface than FS would be really cool :)
Thanks, we all do continuous little improvements in our part of the Pharo ecosystem, together we are moving forward at an ever accelerating pace. Yes, I think AbstractFileReference>>#/ could probably be extended in a similar way, but I am no FileSystem expert...
------ Change the implementation of ZnUrl>>#/ to do a double-dispatch on its argument using #addedToZnUrl: Implemented #addedToZnUrl: on Collection, String and ZnUrl with the added feature that a String is split into path elements on $/ using #findTokens: - Do note that this is an internal path representation, not an encoded external representation. Extended unit tests to cover the new functionality ------
Basically you can now do any of the following:
| baseUrl |
baseUrl := 'http://api.host.com' asZnUrl.
baseUrl / 'doc' / 'file.html'. baseUrl / 'doc/file.html'. baseUrl / #( 'doc' 'file.html' ). baseUrl / 'doc/file.html' asZnUrl.
And they are all equivalent, except for the subtle difference noted in the commit message above.
What do you think ?
Regards,
Sven
-- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill