edit: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;C556753
File: BuiltinsOps.cs
===================================================================
--- $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;C556753  (server)    9/12/2008 3:40 PM
+++ Shelved Change: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;YamlRails
@@ -69,6 +69,15 @@
         }
     }
 
+    [RubyClass(Extends = typeof(RubyModule))]
+    public static class YamlModuleOps {
+        [RubyMethod("yaml_as")]
+        public static object YamlAs(CodeContext/*!*/ context, RubyModule/*!*/ self, object tag) {
+            object yamlModule = RubyUtils.GetConstant(context, self, SymbolTable.StringToId("YAML"), false);
+            return RubyYaml.TagClass(RubyUtils.GetScope(context), yamlModule as RubyModule, tag, self);
+        }
+    }
+
     [RubyClass(Extends = typeof(Hash))]
     public static class YamlHashOps {
         [RubyMethod("to_yaml_node")]
===================================================================
edit: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Initializer.Generated.cs;C556753
File: Initializer.Generated.cs
===================================================================
--- $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Initializer.Generated.cs;C556753  (server)    9/12/2008 3:41 PM
+++ Shelved Change: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Initializer.Generated.cs;YamlRails
@@ -27,6 +27,7 @@
             ExtendModule(typeof(IronRuby.Builtins.Range), new System.Action<IronRuby.Builtins.RubyModule>(LoadIronRuby__Builtins__Range_Instance), null, IronRuby.Builtins.RubyModule.EmptyArray);
             ExtendModule(typeof(IronRuby.Builtins.RubyArray), new System.Action<IronRuby.Builtins.RubyModule>(LoadIronRuby__Builtins__RubyArray_Instance), null, IronRuby.Builtins.RubyModule.EmptyArray);
             ExtendClass(typeof(IronRuby.Builtins.RubyClass), new System.Action<IronRuby.Builtins.RubyModule>(LoadIronRuby__Builtins__RubyClass_Instance), null, IronRuby.Builtins.RubyModule.EmptyArray, null);
+            ExtendClass(typeof(IronRuby.Builtins.RubyModule), new System.Action<IronRuby.Builtins.RubyModule>(LoadIronRuby__Builtins__RubyModule_Instance), null, IronRuby.Builtins.RubyModule.EmptyArray, null);
             ExtendModule(typeof(IronRuby.Builtins.RubyRegex), new System.Action<IronRuby.Builtins.RubyModule>(LoadIronRuby__Builtins__RubyRegex_Instance), null, IronRuby.Builtins.RubyModule.EmptyArray);
             ExtendModule(typeof(IronRuby.Builtins.RubyStruct), new System.Action<IronRuby.Builtins.RubyModule>(LoadIronRuby__Builtins__RubyStruct_Instance), null, IronRuby.Builtins.RubyModule.EmptyArray);
             ExtendModule(typeof(IronRuby.Builtins.TrueClass), new System.Action<IronRuby.Builtins.RubyModule>(LoadIronRuby__Builtins__TrueClass_Instance), null, IronRuby.Builtins.RubyModule.EmptyArray);
@@ -133,6 +134,14 @@
             
         }
         
+        private void LoadIronRuby__Builtins__RubyModule_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
+            
+            module.DefineLibraryMethod("yaml_as", 0x9, new System.Delegate[] {
+                new System.Func<Microsoft.Scripting.Runtime.CodeContext, IronRuby.Builtins.RubyModule, System.Object, System.Object>(IronRuby.StandardLibrary.Yaml.YamlModuleOps.YamlAs),
+            });
+            
+        }
+        
         private void LoadIronRuby__Builtins__RubyRegex_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
             
             module.DefineLibraryMethod("taguri", 0x9, new System.Delegate[] {
@@ -274,7 +283,6 @@
         }
         
         private void LoadYAML_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
-            
             module.DefineLibraryMethod("add_domain_type", 0x12, new System.Delegate[] {
                 new System.Func<Microsoft.Scripting.Runtime.CodeContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyModule, IronRuby.Builtins.MutableString, IronRuby.Builtins.MutableString, System.Object>(IronRuby.StandardLibrary.Yaml.RubyYaml.AddDomainType),
                 new System.Func<Microsoft.Scripting.Runtime.CodeContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyModule, IronRuby.Builtins.MutableString, IronRuby.Builtins.RubyRegex, System.Object>(IronRuby.StandardLibrary.Yaml.RubyYaml.AddDomainType),
@@ -328,12 +336,16 @@
                 new System.Func<IronRuby.Runtime.RubyScope, IronRuby.Builtins.RubyModule, System.Object, System.Object>(IronRuby.StandardLibrary.Yaml.RubyYaml.ParseFile),
             });
             
+            module.DefineLibraryMethod("quick_emit", 0x12, new System.Delegate[] {
+                new System.Func<Microsoft.Scripting.Runtime.CodeContext, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyModule, System.Object, System.Object[], System.Object>(IronRuby.StandardLibrary.Yaml.RubyYaml.QuickEmit),
+            });
+            
             module.DefineLibraryMethod("quick_emit_node", 0x12, new System.Delegate[] {
                 new System.Func<IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyModule, System.Object, System.Object[], System.Object>(IronRuby.StandardLibrary.Yaml.RubyYaml.QuickEmitNode),
             });
             
             module.DefineLibraryMethod("tag_class", 0x12, new System.Delegate[] {
-                new System.Func<IronRuby.Runtime.RubyScope, IronRuby.Builtins.RubyModule, System.Object, System.Object, System.Object>(IronRuby.StandardLibrary.Yaml.RubyYaml.Dump),
+                new System.Func<IronRuby.Runtime.RubyScope, IronRuby.Builtins.RubyModule, System.Object, System.Object, System.Object>(IronRuby.StandardLibrary.Yaml.RubyYaml.TagClass),
             });
             
             module.DefineLibraryMethod("tagged_classes", 0x12, new System.Delegate[] {
===================================================================
edit: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyRepresenter.cs;C556753
File: RubyRepresenter.cs
===================================================================
--- $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyRepresenter.cs;C556753  (server)    9/12/2008 6:20 PM
+++ Shelved Change: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyRepresenter.cs;YamlRails
@@ -73,6 +73,15 @@
  	         return RubyUtils.IsRubyValueType(data) || base.IgnoreAliases(data);
         }
 
+        internal Node Scalar(CodeContext context, MutableString taguri, MutableString value, SymbolId style) {
+            return Scalar(
+                taguri != null ? taguri.ConvertToString() : "",
+                value != null ? value.ConvertToString() : "",
+                //It's not clear what style argument really means, it seems to be always :plain
+                //for now we are ignoring it, defaulting to \0 (see Representer class)
+                '\0'
+            );
+        }
 
         internal Node Scalar(CodeContext context, object self, MutableString value) {
             MutableString taguri = _TagUri.Target(_TagUri, context, self);
===================================================================
edit: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyYaml.cs;C556753
File: RubyYaml.cs
===================================================================
--- $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyYaml.cs;C556753  (server)    9/12/2008 3:41 PM
+++ Shelved Change: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyYaml.cs;YamlRails
@@ -80,7 +80,7 @@
         }
 
         [RubyMethod("tag_class", RubyMethodAttributes.PrivateSingleton)]
-        public static object Dump(RubyScope/*!*/ scope, RubyModule/*!*/ self, object tag, object clazz) {
+        public static object TagClass(RubyScope/*!*/ scope, RubyModule/*!*/ self, object tag, object clazz) {
             Hash tagged_classes = (Hash)GetTaggedClasses(scope, self);
             return RubyUtils.SetHashElement(scope, tagged_classes, tag, clazz);
         }
@@ -224,6 +224,23 @@
             return null;
         }
 
+        [RubyMethod("quick_emit", RubyMethodAttributes.PrivateSingleton)]
+        public static object QuickEmit(CodeContext/*!*/ context, BlockParam/*!*/ block, RubyModule/*!*/ self, object objectId, params object[] opts) {
+            if (block == null) {
+                throw RubyExceptions.NoBlockGiven();
+            }
+            MutableStringWriter writer = new MutableStringWriter();
+            //We currently don't support serialization options, so we just ignore opts argument
+            YamlOptions cfg = YamlOptions.DefaultOptions;
+            using (Serializer s = new Serializer(new Emitter(writer, cfg), cfg)) {
+                RubyRepresenter r = new RubyRepresenter(context, s, cfg);
+                object result;
+                block.Yield(r, out result);
+                s.Serialize(result as Node);
+                return writer.String;
+            }
+        }
+
         [RubyMethod("tagurize", RubyMethodAttributes.PrivateSingleton)]
         public static object Tagurize(CodeContext context, RubyModule self, object arg) {
             if (arg == null) {
===================================================================
edit: $/Merlin_External/Languages/IronRuby/yaml/YamlTest/tags_tests.rb;C547115
File: tags_tests.rb
===================================================================
--- $/Merlin_External/Languages/IronRuby/yaml/YamlTest/tags_tests.rb;C547115  (server)    9/8/2008 5:30 PM
+++ Shelved Change: $/Merlin_External/Languages/IronRuby/yaml/YamlTest/tags_tests.rb;YamlRails
@@ -1,5 +1,6 @@
 require 'test/unit'
 require 'yaml'
+require 'bigdecimal'
 #require 'mscorlib'
 
 class Load_tests < Test::Unit::TestCase
@@ -26,7 +27,7 @@
 	assert YAML::tagged_classes['tag:yaml.org,2002:binary'] == String
 	assert YAML::tagged_classes['tag:yaml.org,2002:bool#no'] == FalseClass
 	assert YAML::tagged_classes['tag:yaml.org,2002:bool#yes'] == TrueClass
-	assert YAML::tagged_classes['tag:yaml.org,2002:float'] == Float
+	assert YAML::tagged_classes['tag:yaml.org,2002:float'] == BigDecimal
 	assert YAML::tagged_classes['tag:yaml.org,2002:int'] == Integer
 	assert YAML::tagged_classes['tag:yaml.org,2002:map'] == Hash
 	assert YAML::tagged_classes['tag:yaml.org,2002:null'] == NilClass
@@ -56,8 +57,56 @@
 	  YAML::tag_class(nil, Foo)
 	  assert(YAML::tagged_classes[nil] == Foo)	  
   end  
+  
+  class Coordinate
+	yaml_as "tag:ruby.yaml.org,2002:Coordinate"
+  end
+  
+  def test_yaml_as_tags_class
+    assert(YAML::tagged_classes['tag:ruby.yaml.org,2002:Coordinate'] == Coordinate)
+  end
 
+  class Coordinate2
+	yaml_as "tag:ruby.yaml.org,2002:Coordinate2"
+	yaml_as "tag:ruby.yaml.org,2002:Coordinate22"
+  end
+
+  def test_yaml_as_double_tag
+    assert(YAML::tagged_classes['tag:ruby.yaml.org,2002:Coordinate2'] == Coordinate2)
+    assert(YAML::tagged_classes['tag:ruby.yaml.org,2002:Coordinate22'] == Coordinate2)	
+  end
+
+  def test_to_yaml 
+	assert_equal "--- 1.0\n", BigDecimal.new('1.0').to_yaml 
+	assert_equal "--- 100000.30020320320000000000001\n", BigDecimal.new('100000.30020320320000000000001').to_yaml 
+	assert BigDecimal.new('123.45').to_s == YAML::load(BigDecimal.new('123.45').to_yaml).to_s
+  end 
+
 end
 
 class Foo 
-end	
\ No newline at end of file
+end	
+
+class BigDecimal 
+   yaml_as "tag:yaml.org,2002:float" 
+   def to_yaml( opts = {} ) 
+     YAML::quick_emit( nil, opts ) do |out| 
+             # This emits the number without any scientific notation.  
+             # I prefer it to using self.to_f.to_s, which would loose precision. 
+             # 
+             # Note that YAML allows that when reconsituting floats  
+             # to native types, some precision may get lost.  
+             # There is no full precision real YAML tag that I am aware of. 
+             str = self.to_s 
+             if str == "Infinity" 
+                 str = ".Inf" 
+             elsif str == "-Infinity" 
+                 str = "-.Inf" 
+             elsif str == "NaN" 
+                 str = ".NaN" 
+             end 
+             out.scalar( "tag:yaml.org,2002:float", str, :plain ) 
+         end 
+   end 
+ end 
+
===================================================================
