ceylon/ceylon-sdk — pull request #326 by jvasileff (2014-12-01 23:29:33+00:00)
Title: Immutable uri

For https://github.com/ceylon/ceylon-sdk/issues/47

I need an immutable Uri class, and made these changes before searching for this issue, which I guess I should have done first!

Anyway, if this is something you might want to merge, I should probably spend a few minutes on cleanup & review first. In particular, the `if (x.empty)` checks to make sure it matches the previous behavior. And I guess the new constructor signatures.

On a related note,

```ceylon
value path = Path(false, PathSegment("seg1"), PathSegment("seg2"));
Uri myUri = Uri("http", Authority(null, null, "www.espn.com"), path);
print(myUri);
```
prints `http://www.espn.comseg1/seg2`, so further review of how `Uri`s are constructed may be warranted to ensure integrity. Or, maybe `string` just needs to add a `/` when the `Path` claims to be relative. I guess it depends on what the rfc says.