On 11 Aug 2011, at 17:01, Igor Stasenko wrote:

> I don't understand how relative urls are ehmm related to this.
> By definition, you cannot construct a relative url out of a single
> argument, because it raising a question, relative to what?
> So, the right way to construct relative url is to be:
> 
> relativeUrl := 'about.html' asRelativeUrlTo: someBaseUrl.
> 
> while:
> 
> relativeUrl := 'about.html' asRelativeUrl
> 
> makes no sense at all.
> 
> That means, in own turn, that expression
> 'xyz' asUrl
> could only be used for producing absolute urls with all consequence
> (such as picking default scheme etc).

That is not how I see it (for now at least).

The difference between absolute and relative URLs is a known concept:

http://en.wikipedia.org/wiki/Url#Absolute_vs_relative_URLs

My view is that some string is parsed into an URL, which results in a object 
that has the (derived) property of being absolute or relative. It is true that 
a relative URL can only make sense in the context of a absolute URL, but that 
does not means that we cannot talk about or deal with a relative URL as a 
proper URL. Some intelligent operation to merge an absolute and relative one 
must be added in the future (this is possible only in a limited way now).

In a sense, it comes down to what 

'foo' as[Zn]Url 

should mean: either it is the host foo (old Url, browser interpretation), or 
the path foo (ZnUrl interpretation).

Your point about the resulting error in your particular case is valid, I will 
look into that.

But I still think that if you want a string to represent a URL unambiguously, 
you better add the scheme (as I wrote earlier).

Sven



Reply via email to