<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,35 +1,39 @@
 function Rx (opt) {
-  this.authority = { };
+  this.type_registry   = { };
+  this.prefix_registry = {
+    '':      'tag:codesimply.com,2008:rx/core/',
+    '.meta': 'tag:codesimply.com,2008:rx/meta/'
+  };
 }
 
-Rx.parseTypeName = function (name) {
+Rx.prototype.expand_uri = function (name) {
+  if (name.match(/^\w+:/)) return name;
+
   var matches = name.match(/^\/(\w*)\/(\w+)$/);
 
-  if (! matches) throw 'invalid type name: ' + name;
+  if (! matches)
+    throw &quot;couldn't understand type name '&quot; + name + &quot;'&quot;;
 
-  return {
-    authorityName: matches[1],
-    subName      : matches[2]
-  };
+  if (! this.prefix_registry[ matches[1] ])
+    throw &quot;unknown prefix '&quot; + matches[1] + &quot;' in type name '&quot; + name + &quot;'&quot;;
+
+  return this.prefix_registry[ matches[1] ] + matches[2];
 }
 
 Rx.prototype.registerType = function (type, opt) {
-  var sn = type.typeName;
-  var auth = this.authority[ sn.authorityName ];
+  var uri = type.uri;
+
+  if (this.type_registry[ uri ])
+    throw &quot;tried to register type for already-registered uri &quot; + uri;
 
-  if (! auth) auth = this.authority[ sn.authorityName ] = {};
-  if (auth[ sn.subName ]) throw 'registration already present';
-  auth[ sn.subName ] = type;
+  this.type_registry[ uri ] = type;
 };
 
 Rx.prototype.typeFor = function (typeName) {
-  var sn = Rx.parseTypeName(typeName);
-
-  var auth = this.authority[sn.authorityName];
-  if (!auth) throw 'unknown authority in: ' + typeName;
+  var uri = this.expand_uri(typeName);
 
-  var typeChecker = auth[sn.subName];
-  if (! typeChecker) throw 'unknown datatype in: ' + typeName;
+  var typeChecker = this.type_registry[ uri ];
+  if (! typeChecker) throw 'unknown type: ' + uri;
 
   return typeChecker;
 };</diff>
      <filename>js/rx.js</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ Rx.CoreType.allType = function (opt, rx) {
   for (i in opt.of) this.alts.push( rx.makeSchema(opt.of[i]) )
 };
 
-Rx.CoreType.allType.typeName = Rx.parseTypeName('//all');
+Rx.CoreType.allType.uri = 'tag:codesimply.com,2008:rx/core/all';
 Rx.CoreType.allType.prototype.check  = function (v) {
   for (i in this.alts) if (! this.alts[i].check(v)) return false;
   return true;
@@ -31,7 +31,7 @@ Rx.CoreType.anyType = function (opt, rx) {
   }
 };
 
-Rx.CoreType.anyType.typeName = Rx.parseTypeName('//any');
+Rx.CoreType.anyType.uri = 'tag:codesimply.com,2008:rx/core/any';
 Rx.CoreType.anyType.prototype.check  = function (v) {
   if (! this.alts) return true;
   for (i in this.alts) if (this.alts[i].check(v)) return true;
@@ -39,17 +39,17 @@ Rx.CoreType.anyType.prototype.check  = function (v) {
 };
 
 Rx.CoreType.boolType = function (opt) {};
-Rx.CoreType.boolType.typeName = Rx.parseTypeName('//bool');
+Rx.CoreType.boolType.uri = 'tag:codesimply.com,2008:rx/core/bool';
 Rx.CoreType.boolType.prototype.check = function (v) {
   return((typeof(v) == 'boolean') || (v instanceof Boolean));
 };
 
 Rx.CoreType.defType  = function (opt) {};
-Rx.CoreType.defType.typeName = Rx.parseTypeName('//def');
+Rx.CoreType.defType.uri = 'tag:codesimply.com,2008:rx/core/def';
 Rx.CoreType.defType.prototype.check  = function (v) { return v != null; };
 
 Rx.CoreType.failType  = function (opt) {};
-Rx.CoreType.failType.typeName = Rx.parseTypeName('//fail');
+Rx.CoreType.failType.uri = 'tag:codesimply.com,2008:rx/core/fail';
 Rx.CoreType.failType.prototype.check  = function (v) { false; };
 
 Rx.CoreType.intType  = function (opt) {
@@ -65,7 +65,7 @@ Rx.CoreType.intType  = function (opt) {
     this.range_check = new Rx.Util.RangeChecker( opt.range );
   }
 };
-Rx.CoreType.intType.typeName = Rx.parseTypeName('//int');
+Rx.CoreType.intType.uri = 'tag:codesimply.com,2008:rx/core/int';
 Rx.CoreType.intType.prototype.check  = function (v) {
   if (v == null) return false;
   if (v.constructor != Number) return false;
@@ -78,7 +78,7 @@ Rx.CoreType.intType.prototype.check  = function (v) {
 };
 
 Rx.CoreType.nilType  = function (opt) {};
-Rx.CoreType.nilType.typeName = Rx.parseTypeName('//nil');
+Rx.CoreType.nilType.uri = 'tag:codesimply.com,2008:rx/core/nil';
 Rx.CoreType.nilType.prototype.check  = function (v) { return v === null };
 
 Rx.CoreType.numType  = function (opt) {
@@ -95,7 +95,7 @@ Rx.CoreType.numType  = function (opt) {
   }
 };
 
-Rx.CoreType.numType.typeName = Rx.parseTypeName('//num');
+Rx.CoreType.numType.uri = 'tag:codesimply.com,2008:rx/core/num';
 Rx.CoreType.numType.prototype.check  = function (v) {
   if (v == null) return false;
   if (v.constructor != Number) return false;
@@ -112,7 +112,7 @@ Rx.CoreType.strType  = function (opt) {
       throw new Rx.Error('invalid value parameter for str type');
     this.value = opt.value;
 };
-Rx.CoreType.strType.typeName = Rx.parseTypeName('//str');
+Rx.CoreType.strType.uri = 'tag:codesimply.com,2008:rx/core/str';
 Rx.CoreType.strType.prototype.check  = function (v) {
   if (! ((typeof(v) == 'string') || (v instanceof String))) return false;
   if (this.value != null &amp;&amp; v != this.value) return false;
@@ -120,7 +120,7 @@ Rx.CoreType.strType.prototype.check  = function (v) {
 };
 
 Rx.CoreType.oneType  = function (opt) {};
-Rx.CoreType.oneType.typeName = Rx.parseTypeName('//one');
+Rx.CoreType.oneType.uri = 'tag:codesimply.com,2008:rx/core/one';
 Rx.CoreType.oneType.prototype.check = function (v) {
   // for some reason this was false: (false instanceof Boolean)
   if (v == null) return false;
@@ -145,7 +145,7 @@ Rx.CoreType.arrType  = function (opt, rx) {
     this.length_check = new Rx.Util.RangeChecker( opt.length );
   }
 };
-Rx.CoreType.arrType.typeName = Rx.parseTypeName('//arr');
+Rx.CoreType.arrType.uri = 'tag:codesimply.com,2008:rx/core/arr';
 Rx.CoreType.arrType.prototype.check  = function (v) {
   if (! (v instanceof Array)) return false;
 
@@ -184,13 +184,13 @@ Rx.CoreType.recType = function (opt, rx) {
 
   if (opt.rest) this.restSchema = rx.makeSchema(opt.rest);
 };
+Rx.CoreType.recType.uri = 'tag:codesimply.com,2008:rx/core/rec';
 Rx.CoreType.recType._valid_options = {
   type: true,
   rest: true,
   required: true,
   optional: true
 };
-Rx.CoreType.recType.typeName = Rx.parseTypeName('//rec');
 Rx.CoreType.recType.prototype.check  = function (v) {
   if (!(((v != null) &amp;&amp; (typeof(v) == 'object')) &amp;&amp; ! (v instanceof Array)))
     return false;
@@ -225,7 +225,7 @@ Rx.CoreType.mapType = function (opt, rx) {
 
   this.valueSchema = rx.makeSchema(opt.values);
 };
-Rx.CoreType.mapType.typeName = Rx.parseTypeName('//map');
+Rx.CoreType.mapType.uri = 'tag:codesimply.com,2008:rx/core/map';
 Rx.CoreType.mapType.prototype.check  = function (v) {
   if (!(((v != null) &amp;&amp; (typeof(v) == 'object')) &amp;&amp; ! (v instanceof Array)))
     return false;
@@ -250,7 +250,7 @@ Rx.CoreType.seqType  = function (opt, rx) {
     this.tail_check = rx.makeSchema(opt.tail);
   }
 };
-Rx.CoreType.seqType.typeName = Rx.parseTypeName('//seq');
+Rx.CoreType.seqType.uri = 'tag:codesimply.com,2008:rx/core/seq';
 Rx.CoreType.seqType.prototype.check  = function (v) {
   if (!(v instanceof Array)) return false;
 </diff>
      <filename>js/rx/coretypes.js</filename>
    </modified>
    <modified>
      <diff>@@ -9,15 +9,6 @@ class Error(Exception):
 
 class Util(object):
   @staticmethod
-  def parse_type_name(type_name):
-    m = re.match('^/([-._a-z0-9]*)/([-._a-z0-9]+)$', type_name)
-
-    return {
-      &quot;authority&quot;: m.group(1),
-      &quot;subname&quot;  : m.group(2),
-    }
-
-  @staticmethod
   def make_range_check(opt):
     range = { }
     for entry in opt.keys():
@@ -37,20 +28,37 @@ class Util(object):
 
 class Factory(object):
   def __init__(self, opt={}):
-    self.registry = {}
+    self.prefix_registry = {
+      '':      'tag:codesimply.com,2008:rx/core/',
+      '.meta': 'tag:codesimply.com,2008:rx/meta/',
+    }
+
+    self.type_registry = {}
     if opt.get(&quot;register_core_types&quot;, False):
       for t in core_types: self.register_type(t)
 
-  def register_type(self, t):
-    t_authority = t.authority()
-    t_subname   = t.subname()
+  @staticmethod
+  def _default_prefixes(): pass
 
-    self.registry.setdefault(t_authority, {})
+  def expand_uri(self, type_name):
+    if re.match('^\w+:', type_name): return type_name
 
-    if self.registry[t_authority].get(t_subname, None):
-      raise &quot;type already registered for /%s/%s&quot; % (t_authority, t_subname)
+    m = re.match('^/([-._a-z0-9]*)/([-._a-z0-9]+)$', type_name)
+
+    if not m: raise &quot;couldn't understand type name '%s'&quot; % type_name
+
+    if not self.prefix_registry.get(m.group(1)):
+      raise &quot;unknown prefix '%s' in type name '%s'&quot; % (m.group(1), type_name)
 
-    self.registry[t_authority][t_subname] = t
+    return '%s%s' % (self.prefix_registry[ m.group(1) ], m.group(2))
+
+  def register_type(self, t):
+    t_uri = t.uri()
+
+    if self.type_registry.get(t_uri, None):
+      raise &quot;type already registered for %s&quot; % t_uri
+
+    self.type_registry[t_uri] = t
 
   def make_schema(self, schema):
     if type(schema) in (str, unicode):
@@ -59,21 +67,18 @@ class Factory(object):
     if not type(schema) is dict:
       raise Error('invalid schema argument to make_schema')
   
-    sn = Util.parse_type_name(schema[&quot;type&quot;])
+    uri = self.expand_uri(schema[&quot;type&quot;])
 
-    if not self.registry.has_key(sn[&quot;authority&quot;]):
-      raise &quot;unknown authority in type %s&quot; % schema[&quot;type&quot;]
+    if not self.type_registry.get(uri): raise &quot;unknown type %s&quot; % uri
 
-    if not self.registry[ sn[&quot;authority&quot;] ].has_key(sn[&quot;subname&quot;]):
-      raise &quot;unknown subname in type %s&quot; % schema[&quot;type&quot;]
-
-    type_class = self.registry[ sn[&quot;authority&quot;] ][ sn[&quot;subname&quot;] ]
+    type_class = self.type_registry[ uri ]
 
     return type_class(schema, self)
 
 class _CoreType(object):
-  @staticmethod
-  def authority(): return ''
+  @classmethod
+  def uri(self):
+    return 'tag:codesimply.com,2008:rx/core/' + self.subname()
 
   def __init__(self, schema, rx): pass
 </diff>
      <filename>python/Rx.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,39 @@
 function Rx (opt) {
-  this.authority = { };
+  this.type_registry   = { };
+  this.prefix_registry = {
+    '':      'tag:codesimply.com,2008:rx/core/',
+    '.meta': 'tag:codesimply.com,2008:rx/meta/'
+  };
 }
 
-Rx.parseTypeName = function (name) {
+Rx.prototype.expand_uri = function (name) {
+  if (name.match(/^\w+:/)) return name;
+
   var matches = name.match(/^\/(\w*)\/(\w+)$/);
 
-  if (! matches) throw 'invalid type name: ' + name;
+  if (! matches)
+    throw &quot;couldn't understand type name '&quot; + name + &quot;'&quot;;
 
-  return {
-    authorityName: matches[1],
-    subName      : matches[2]
-  };
+  if (! this.prefix_registry[ matches[1] ])
+    throw &quot;unknown prefix '&quot; + matches[1] + &quot;' in type name '&quot; + name + &quot;'&quot;;
+
+  return this.prefix_registry[ matches[1] ] + matches[2];
 }
 
 Rx.prototype.registerType = function (type, opt) {
-  var sn = type.typeName;
-  var auth = this.authority[ sn.authorityName ];
+  var uri = type.uri;
+
+  if (this.type_registry[ uri ])
+    throw &quot;tried to register type for already-registered uri &quot; + uri;
 
-  if (! auth) auth = this.authority[ sn.authorityName ] = {};
-  if (auth[ sn.subName ]) throw 'registration already present';
-  auth[ sn.subName ] = type;
+  this.type_registry[ uri ] = type;
 };
 
 Rx.prototype.typeFor = function (typeName) {
-  var sn = Rx.parseTypeName(typeName);
-
-  var auth = this.authority[sn.authorityName];
-  if (!auth) throw 'unknown authority in: ' + typeName;
+  var uri = this.expand_uri(typeName);
 
-  var typeChecker = auth[sn.subName];
-  if (! typeChecker) throw 'unknown datatype in: ' + typeName;
+  var typeChecker = this.type_registry[ uri ];
+  if (! typeChecker) throw 'unknown type: ' + uri;
 
   return typeChecker;
 };</diff>
      <filename>www/src/rx.js</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ Rx.CoreType.allType = function (opt, rx) {
   for (i in opt.of) this.alts.push( rx.makeSchema(opt.of[i]) )
 };
 
-Rx.CoreType.allType.typeName = Rx.parseTypeName('//all');
+Rx.CoreType.allType.uri = 'tag:codesimply.com,2008:rx/core/all';
 Rx.CoreType.allType.prototype.check  = function (v) {
   for (i in this.alts) if (! this.alts[i].check(v)) return false;
   return true;
@@ -31,7 +31,7 @@ Rx.CoreType.anyType = function (opt, rx) {
   }
 };
 
-Rx.CoreType.anyType.typeName = Rx.parseTypeName('//any');
+Rx.CoreType.anyType.uri = 'tag:codesimply.com,2008:rx/core/any';
 Rx.CoreType.anyType.prototype.check  = function (v) {
   if (! this.alts) return true;
   for (i in this.alts) if (this.alts[i].check(v)) return true;
@@ -39,17 +39,17 @@ Rx.CoreType.anyType.prototype.check  = function (v) {
 };
 
 Rx.CoreType.boolType = function (opt) {};
-Rx.CoreType.boolType.typeName = Rx.parseTypeName('//bool');
+Rx.CoreType.boolType.uri = 'tag:codesimply.com,2008:rx/core/bool';
 Rx.CoreType.boolType.prototype.check = function (v) {
   return((typeof(v) == 'boolean') || (v instanceof Boolean));
 };
 
 Rx.CoreType.defType  = function (opt) {};
-Rx.CoreType.defType.typeName = Rx.parseTypeName('//def');
+Rx.CoreType.defType.uri = 'tag:codesimply.com,2008:rx/core/def';
 Rx.CoreType.defType.prototype.check  = function (v) { return v != null; };
 
 Rx.CoreType.failType  = function (opt) {};
-Rx.CoreType.failType.typeName = Rx.parseTypeName('//fail');
+Rx.CoreType.failType.uri = 'tag:codesimply.com,2008:rx/core/fail';
 Rx.CoreType.failType.prototype.check  = function (v) { false; };
 
 Rx.CoreType.intType  = function (opt) {
@@ -65,7 +65,7 @@ Rx.CoreType.intType  = function (opt) {
     this.range_check = new Rx.Util.RangeChecker( opt.range );
   }
 };
-Rx.CoreType.intType.typeName = Rx.parseTypeName('//int');
+Rx.CoreType.intType.uri = 'tag:codesimply.com,2008:rx/core/int';
 Rx.CoreType.intType.prototype.check  = function (v) {
   if (v == null) return false;
   if (v.constructor != Number) return false;
@@ -78,7 +78,7 @@ Rx.CoreType.intType.prototype.check  = function (v) {
 };
 
 Rx.CoreType.nilType  = function (opt) {};
-Rx.CoreType.nilType.typeName = Rx.parseTypeName('//nil');
+Rx.CoreType.nilType.uri = 'tag:codesimply.com,2008:rx/core/nil';
 Rx.CoreType.nilType.prototype.check  = function (v) { return v === null };
 
 Rx.CoreType.numType  = function (opt) {
@@ -95,7 +95,7 @@ Rx.CoreType.numType  = function (opt) {
   }
 };
 
-Rx.CoreType.numType.typeName = Rx.parseTypeName('//num');
+Rx.CoreType.numType.uri = 'tag:codesimply.com,2008:rx/core/num';
 Rx.CoreType.numType.prototype.check  = function (v) {
   if (v == null) return false;
   if (v.constructor != Number) return false;
@@ -112,7 +112,7 @@ Rx.CoreType.strType  = function (opt) {
       throw new Rx.Error('invalid value parameter for str type');
     this.value = opt.value;
 };
-Rx.CoreType.strType.typeName = Rx.parseTypeName('//str');
+Rx.CoreType.strType.uri = 'tag:codesimply.com,2008:rx/core/str';
 Rx.CoreType.strType.prototype.check  = function (v) {
   if (! ((typeof(v) == 'string') || (v instanceof String))) return false;
   if (this.value != null &amp;&amp; v != this.value) return false;
@@ -120,7 +120,7 @@ Rx.CoreType.strType.prototype.check  = function (v) {
 };
 
 Rx.CoreType.oneType  = function (opt) {};
-Rx.CoreType.oneType.typeName = Rx.parseTypeName('//one');
+Rx.CoreType.oneType.uri = 'tag:codesimply.com,2008:rx/core/one';
 Rx.CoreType.oneType.prototype.check = function (v) {
   // for some reason this was false: (false instanceof Boolean)
   if (v == null) return false;
@@ -145,7 +145,7 @@ Rx.CoreType.arrType  = function (opt, rx) {
     this.length_check = new Rx.Util.RangeChecker( opt.length );
   }
 };
-Rx.CoreType.arrType.typeName = Rx.parseTypeName('//arr');
+Rx.CoreType.arrType.uri = 'tag:codesimply.com,2008:rx/core/arr';
 Rx.CoreType.arrType.prototype.check  = function (v) {
   if (! (v instanceof Array)) return false;
 
@@ -184,13 +184,13 @@ Rx.CoreType.recType = function (opt, rx) {
 
   if (opt.rest) this.restSchema = rx.makeSchema(opt.rest);
 };
+Rx.CoreType.recType.uri = 'tag:codesimply.com,2008:rx/core/rec';
 Rx.CoreType.recType._valid_options = {
   type: true,
   rest: true,
   required: true,
   optional: true
 };
-Rx.CoreType.recType.typeName = Rx.parseTypeName('//rec');
 Rx.CoreType.recType.prototype.check  = function (v) {
   if (!(((v != null) &amp;&amp; (typeof(v) == 'object')) &amp;&amp; ! (v instanceof Array)))
     return false;
@@ -225,7 +225,7 @@ Rx.CoreType.mapType = function (opt, rx) {
 
   this.valueSchema = rx.makeSchema(opt.values);
 };
-Rx.CoreType.mapType.typeName = Rx.parseTypeName('//map');
+Rx.CoreType.mapType.uri = 'tag:codesimply.com,2008:rx/core/map';
 Rx.CoreType.mapType.prototype.check  = function (v) {
   if (!(((v != null) &amp;&amp; (typeof(v) == 'object')) &amp;&amp; ! (v instanceof Array)))
     return false;
@@ -250,7 +250,7 @@ Rx.CoreType.seqType  = function (opt, rx) {
     this.tail_check = rx.makeSchema(opt.tail);
   }
 };
-Rx.CoreType.seqType.typeName = Rx.parseTypeName('//seq');
+Rx.CoreType.seqType.uri = 'tag:codesimply.com,2008:rx/core/seq';
 Rx.CoreType.seqType.prototype.check  = function (v) {
   if (!(v instanceof Array)) return false;
 </diff>
      <filename>www/src/rx/coretypes.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fcaab43243a03a167b28819e2638b3b6c0a56a17</id>
    </parent>
  </parents>
  <author>
    <name>Ricardo SIGNES</name>
    <email>rjbs@cpan.org</email>
  </author>
  <url>http://github.com/rjbs/rx/commit/31abd5e669cf837cd1124ef1d9e1ea34155ccb16</url>
  <id>31abd5e669cf837cd1124ef1d9e1ea34155ccb16</id>
  <committed-date>2008-08-30T19:03:40-07:00</committed-date>
  <authored-date>2008-08-30T19:03:40-07:00</authored-date>
  <message>python, js uri</message>
  <tree>235848711e8f110345611f8b02cc552a2d432388</tree>
  <committer>
    <name>Ricardo SIGNES</name>
    <email>rjbs@cpan.org</email>
  </committer>
</commit>
