I made the following commits:
This does not change the current default behaviour, but it makes it a lot easier to work with relative references:
ZnUrl image + 'foo.txt'
�� => "file:///Users/sven/Develop/Smalltalk/foo.txt"
You just have to choose an appropriate base URL:
'postgresql://user:password@localhost:5432/default' asUrl + 'test'
�� => "postgresql://user:password@localhost:5432/test"
However, when you override the host, the port (actually the whole authority) is reset as well (according to my interpretation of the RFC anyway), that is why I added #portIfAbsent:
'postgresql://production/user-db' asUrl portIfAbsent: 5432
�� => 5432
I also added #asFileUrl to help in the common case of interpreting any scheme as referring to a file path. After that conversion, one will probably want to do an #asFileReference.
Well, it is a 'problem area' (design/implementation wise). Your suggestion makes sense though: to make the schemes objects so that they could implement specific behaviour (rather than making many subclasses of ZnUrl). I will think about this, thanks for the idea !
> Looking through Zinc I notice that the schemes are symbols.�� Any plans to make these classes?�� To maybe(?) make it easier to extend to other schemes (http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml) ?�� Or do you consider that outside the scope of Zinc ?