namespace eval at {
# conformant enough, i hope
proc uri {uri} {
if {[string first "at://" $uri] != 0} return
set uri [string range $uri 5 end]
set uri [split $uri /]
switch -- [llength $uri] {
1 { return [list authority [lindex $uri 0]] }
2 { return [list authority [lindex $uri 0] collection [lindex $uri 1]] }
3 { return [list authority [lindex $uri 0] collection [lindex $uri 1] rkey [lindex $uri 2]] }
default { return {} }
}
}
}