> Am 12.03.2015 um 22:20 schrieb Sean P. DeNigris <[email protected]>:
> 
> On Mar 12, 2015, at 4:54 PM, Sven Van Caekenberghe-2 [via Smalltalk] <[hidden 
> email] <x-msg://25/user/SendEmail.jtp?type=node&node=4811589&i=0>> 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 defaultScheme: variant. I’m not saying we should necessarily 
> assume HTTP. I’m just saying if someone gives us a string like 'www.hm.com 
> <http://www.hm.com/>’ (which I agree is incompletely defined), why set 
> #segments and not #host? Even with scheme = nil, the following would be more 
> useful:
> 'www.hm.com <http://www.hm.com/>' asUrl host = 'www.hm.com 
> <http://www.hm.com/>'. 
> 'www.hm.com <http://www.hm.com/>' asUrl segments = m <http://www.hm.com/>') 
> an OrderedCollection()

To me it is a discussion what is the real interpretation of ZnUrl. It behaves 
mostly like URI but the name implies URL. Without a colon you are in URI land. 
It is just a path. Starting with /, // or without slash determines the kind of 
path.
So www.hm.com <http://www.hm.com/> ist perfectly valid path. Just create a file 
named www.hm.com <http://www.hm.com/> on your filesystem and you can luckily 
reference it with that URI. Having a URI/URL object in mind there is nothing to 
assume. From a text block point of view that might be different. Text display 
in apps use something like linkify. There you scan the content for patterns 
like www.*.* or even *.*.* (matching domains for the last part) and if you find 
some you assume it to be a URL with the host you've found. But then you create 
the URLs out of that given context. 
Maybe you need another selector like asHttpUrl?
My concern is more that

'urn:foo:bar' asUrl

doesn't do what it should :)

Norbert





Reply via email to