Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-13 Thread Norbert Hartl
> Am 13.03.2015 um 20:04 schrieb Sven Van Caekenberghe : > > I know you mean well, but you cannot confuse things. Without some context, > not much can be done. #asZnUrl has totally no context. > Maybe this is misunderstanding. My point was that there is no context given by #asUrl. So it is not

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-13 Thread Sven Van Caekenberghe
I know you mean well, but you cannot confuse things. Without some context, not much can be done. #asZnUrl has totally no context. I recently added ZnUrl>>#withRelativeReference: reference "Return a new URL by parsing & resolving the relative reference using myself as base URL. Th

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-13 Thread Norbert Hartl
> Am 13.03.2015 um 17:29 schrieb Sven Van Caekenberghe : > > >> On 13 Mar 2015, at 17:20, Norbert Hartl wrote: >> >> My concern is more that >> >> 'urn:foo:bar' asUrl >> >> doesn't do what it should :) > > That is because #urn is not in #schemesNotUsingDoubleSlash, it should > probably be

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-13 Thread Sven Van Caekenberghe
> On 13 Mar 2015, at 17:20, Norbert Hartl wrote: > > My concern is more that > > 'urn:foo:bar' asUrl > > doesn't do what it should :) That is because #urn is not in #schemesNotUsingDoubleSlash, it should probably be added. But then I have to read more about it first. https://en.wikipedia.

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-13 Thread Norbert Hartl
> Am 12.03.2015 um 22:20 schrieb Sean P. DeNigris : > > On Mar 12, 2015, at 4:54 PM, Sven Van Caekenberghe-2 [via Smalltalk] <[hidden > email] > wrote: >> The scheme is not optional, it defines what (kind) the URL is. You are >> expecting behaviour such as in a browser's address bar. But there,

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-13 Thread Sven Van Caekenberghe
Sean, > On 12 Mar 2015, at 22:33, Sean P. DeNigris wrote: > > On Mar 12, 2015, at 5:30 PM, Sven Van Caekenberghe-2 [via Smalltalk] <[hidden > email]> wrote: > > I think that what we have now is correct. I am willing to change my mind > > when you point to some RFC that supports your point ;-)

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-12 Thread Sean P. DeNigris
On Mar 12, 2015, at 5:30 PM, Sven Van Caekenberghe-2 [via Smalltalk] wrote: > I think that what we have now is correct. I am willing to change my mind when > you point to some RFC that supports your point ;-) Well in that case… ^ Response new emoticon: ':-P’; sound: Sound raspb

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-12 Thread Sven Van Caekenberghe
Because the scheme defines the semantics of what comes after it. Not every URL has a host, like mailto:j...@acme.com (to pick an extreme case). Right now, 'foo' on itself becomes a part of the path, not the host. See also #testReferenceResolution where you can clearly see that when there is no

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-12 Thread Sean P. DeNigris
On Mar 12, 2015, at 4:54 PM, Sven Van Caekenberghe-2 [via Smalltalk] wrote: > The scheme is not optional, it defines what (kind) the URL is. You are > expecting behaviour such as in a browser's address bar. But there, there is > context (you are expecting an HTTP URL). I did see the defaultSch

Re: [Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-12 Thread Sven Van Caekenberghe
Sean, The scheme is not optional, it defines what (kind) the URL is. You are expecting behaviour such as in a browser's address bar. But there, there is context (you are expecting an HTTP URL). What you are looking for is provided: ZnUrl fromString: 'www.host.com' defaultScheme: #http Are y

[Pharo-dev] ZnUrl: Constructing without Scheme

2015-03-12 Thread Sean P. DeNigris
'http://www.hm.com' asUrl host = 'www.hm.com'. All good so far, but: 'www.hm.com' asUrl host = nil. 'www.hm.com' asUrl segments = an OrderedCollection('www.hm.com') I realize presenting a URL without a scheme is kind of vague, but the least surprising thing to me would be to interpret schemele