<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/env/element_reference_tags.txt</filename>
    </added>
    <added>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/env/fixtures/classes.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/CodeContext.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/PythonDynamicStackFrame.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/UnboundNameException.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/ScopeOps.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObjectDebugView.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/VisibilityContext.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Languages/Ruby/Scripts/ircoverage.bat</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -43,7 +43,7 @@ namespace IronRuby.StandardLibrary.Yaml {
         public RubyRepresenter(RubyContext/*!*/ context, Serializer/*!*/ serializer, YamlOptions/*!*/ opts)
             : base(serializer, opts) {
             _context = context;
-            _objectToYamlMethod = context.GetClass(typeof(object)).ResolveMethod(&quot;to_yaml&quot;, RubyClass.IgnoreVisibility).Info;
+            _objectToYamlMethod = context.GetClass(typeof(object)).ResolveMethod(&quot;to_yaml&quot;, VisibilityContext.AllVisible).Info;
 
              _TagUri =
                 CallSite&lt;Func&lt;CallSite, object, object&gt;&gt;.Create(
@@ -88,7 +88,7 @@ namespace IronRuby.StandardLibrary.Yaml {
         #endregion
 
         protected override Node CreateNode(object data) {
-            RubyMemberInfo method = _context.GetImmediateClassOf(data).ResolveMethodForSite(&quot;to_yaml&quot;, RubyClass.IgnoreVisibility).Info;
+            RubyMemberInfo method = _context.GetImmediateClassOf(data).ResolveMethodForSite(&quot;to_yaml&quot;, VisibilityContext.AllVisible).Info;
 
             if (method == _objectToYamlMethod) {
                 return (Node)_ToYamlNode.Target(_ToYamlNode, data, this);</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/Yaml/IronRuby.Libraries.Yaml/RubyRepresenter.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1 @@
 fails:Array#== returns true if corresponding elements are #==
-fails:Array#== does not call #to_ary on its argument</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/array/equal_value_tags.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,9 @@
 fails:String#unpack returns an array by decoding self according to the format string
-fails:String#unpack with 'Z' directive returns an array by decoding self according to the format string
 fails:String#unpack with 'N' and 'n' directives returns an array by decoding self according to the format string
-fails:String#unpack with 'Q' and 'q' directives returns an array in little-endian (native format) order by decoding self according to the format string
-fails:String#unpack with 'Q' and 'q' directives returns Bignums for big numeric values on little-endian platforms
-fails:String#unpack with 'Q' and 'q' directives returns Fixnums for small numeric values
 fails:String#unpack with 'a', 'X' and 'x' directives returns an array by decoding self according to the format string
 fails:String#unpack with 'DdEeFfGg' directives returns an array by decoding self according to the format string
 fails:String#unpack with 'DdEeFfGg' directives returns an array by decoding self in little-endian order according to the format string
 fails:String#unpack with 'U' directive returns an array by decoding self according to the format string
-fails:String#unpack with '@' directive returns an array by decoding self according to the format string
 fails:String#unpack with 'M' directive returns an array by decoding self according to the format string
 fails:String#unpack with 'm' directive returns an array by decoding self according to the format string
 fails:String#unpack with 'w' directive produces a BER-compressed integer</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/string/unpack_tags.txt</filename>
    </modified>
    <modified>
      <diff>@@ -44,20 +44,6 @@ core\thread\critical_tags.txt:0:critical:Thread.critical= can be mismatched
 core\thread\raise_tags.txt:0:critical:Thread#raise on another thread re-raises active exception
 core\thread\critical_tags.txt:0:unstable:Thread.critical= does not change status of other existing threads
 language\method_tags.txt:0:critical:Calling a method fails with both lambda and block argument
-library\net\ftp\get_tags.txt:0:critical:Net::FTP#get (binary mode)
-library\net\ftp\getbinaryfile_tags.txt:0:critical:Net::FTP#getbinaryfile
-library\net\ftp\retrbinary_tags.txt:0:critical:Net::FTP#retrbinary
-library\net\http\http\get_print_tags.txt:0:critical:Net::HTTP.get_print when passed URI it prints the body of the specified uri to $stdout
-library\net\http\http\get_print_tags.txt:0:critical:Net::HTTP.get_print when passed host, path, port it prints the body of the specified uri to $stdout
-library\net\http\http\lock_tags.txt:0:critical:Net::HTTP#lock sends a LOCK request to the passed path and returns the response
-library\net\http\http\post_form_tags.txt:0:critical:Net::HTTP.post_form when passed URI POSTs the passed form data to the given uri
-library\net\http\http\post_tags.txt:0:critical:Net::HTTP#post
-library\net\http\http\propfind_tags.txt:0:critical:Net::HTTP#propfind
-library\net\http\http\proppatch_tags.txt:0:critical:Net::HTTP#proppatch
-library\net\http\http\put_tags.txt:0:critical:Net::HTTP#put
-library\net\http\http\request_tags.txt:0:critical:Net::HTTP#request
-library\net\http\http\send_request_tags.txt:0:critical:Net::HTTP#send_request
-library\net\http\http\unlock_tags.txt:0:critical:Net::HTTP#unlock
 library\resolv\get_address_tags.txt:0:critical:Resolv#getaddress
 library\resolv\get_addresses_tags.txt:0:critical:Resolv#getaddresses
 library\resolv\get_name_tags.txt:0:critical:Resolv#getname</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/critical_tags.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-critical:Net::FTP#get (binary mode)
+fails:Net::FTP#get (binary mode)
 fails:Net::FTP#get (text mode) sends the RETR command to the server
 fails:Net::FTP#get (text mode) returns nil
 fails:Net::FTP#get (text mode) saves the contents of the passed remote file to the passed local file</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/ftp/get_tags.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-critical:Net::FTP#getbinaryfile
+fails:Net::FTP#getbinaryfile</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/ftp/getbinaryfile_tags.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-critical:Net::FTP#retrbinary
+fails:Net::FTP#retrbinary</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/ftp/retrbinary_tags.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require File.dirname(__FILE__) + '/../../spec_helper'
+require File.dirname(__FILE__) + '/fixtures/classes'
 
 describe &quot;ENV.[]&quot; do
   before :each do
@@ -15,4 +16,69 @@ describe &quot;ENV.[]&quot; do
   it &quot;returns nil if the variable isn't found&quot; do
     ENV[&quot;this_var_is_never_set&quot;].should == nil
   end
+
+  platform_is :windows do  
+    it &quot;does not expand %HOME% if it is already set&quot; do
+      EnvSpecs.with_temp_ENV do
+        ENV['HOME'] = 'x:\Dummy\..\User\Jane Doe'
+        ruby_exe(&quot;puts ENV['HOME']&quot;).chomp.should == 'x:\Dummy\..\User\Jane Doe'
+      end
+    end
+ 
+    it &quot;sets HOME to %HOMEDRIVE%/%HOMEPATH% if %HOME% is not set&quot; do
+      EnvSpecs.with_temp_ENV do
+        ENV['HOMEDRIVE'] = 'x:'
+        ENV['HOMEPATH'] = '\User\Jane Doe'
+        ENV['USERPROFILE'] = 'y:\User\John Doe'
+        ruby_exe(&quot;puts ENV['HOME']&quot;).chomp.should == 'x:/User/Jane Doe'
+      end  
+    end
+ 
+    it &quot;sets HOME to %HOMEDRIVE% if %HOME% is not set&quot; do
+      EnvSpecs.with_temp_ENV do
+        ENV['HOMEDRIVE'] = 'x:'
+        ENV['USERPROFILE'] = 'y:\User\John Doe'
+        ruby_exe(&quot;puts ENV['HOME']&quot;).chomp.should == &quot;x:/&quot;
+      end
+    end
+ 
+    it &quot;sets HOME to %HOMEPATH% if %HOME% is not set&quot; do
+      EnvSpecs.with_temp_ENV do
+        ENV['HOMEPATH'] = '\User\Jane Doe'
+        ENV['USERPROFILE'] = 'y:\User\John Doe'
+        ruby_exe(&quot;puts ENV['HOME']&quot;).chomp.should == &quot;/User/Jane Doe&quot;
+      end
+    end
+  
+    it &quot;sets HOME to %USERPROFILE% if %HOMEDRIVE% or %HOMEPATH% are not set&quot; do
+      EnvSpecs.with_temp_ENV do
+        ENV['USERPROFILE'] = 'y:\User\John Doe'
+        ruby_exe(&quot;puts ENV['HOME']&quot;).chomp.should == &quot;y:/User/John Doe&quot;
+      end
+    end
+
+    ruby_version_is &quot;&quot; ... &quot;1.9&quot; do
+      it &quot;does not set HOME if none of %HOMEDRIVE%, %HOMEPATH% or %USERPROFILE% are set&quot; do
+        EnvSpecs.with_temp_ENV do
+          ENV['HOME'] = nil
+          ENV['HOMEDRIVE'] = nil
+          ENV['HOMEPATH'] = nil
+          ENV['USERPROFILE'] = nil
+          ruby_exe(&quot;puts puts ENV['HOME'], ENV['HOME'].nil?&quot;).chomp.should =~ /^true$/
+        end
+      end
+    end
+
+    ruby_version_is &quot;1.9&quot; do
+      it &quot;does set HOME if none of %HOMEDRIVE%, %HOMEPATH% or %USERPROFILE% are set&quot; do
+        EnvSpecs.with_temp_ENV do
+          ENV['HOME'] = nil
+          ENV['HOMEDRIVE'] = nil
+          ENV['HOMEPATH'] = nil
+          ENV['USERPROFILE'] = nil
+          ruby_exe(&quot;puts puts ENV['HOME'], ENV['HOME'].nil?&quot;).chomp.should =~ /^false$/
+        end
+      end
+    end
+  end
 end</diff>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/env/element_reference_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@
   &lt;microsoft.scripting&gt;
     &lt;languages&gt;
       &lt;language names=&quot;IronPython;Python;py&quot; extensions=&quot;.py&quot; displayName=&quot;IronPython 2.6 Alpha&quot; type=&quot;IronPython.Runtime.PythonContext, IronPython, Version=2.6.0.20, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; /&gt;
-      &lt;language names=&quot;IronRuby;Ruby;rb&quot; extensions=&quot;.rb&quot; displayName=&quot;IronRuby&quot; type=&quot;IronRuby.Runtime.RubyContext, IronRuby, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; /&gt;
+      &lt;language names=&quot;IronRuby;Ruby;rb&quot; extensions=&quot;.rb&quot; displayName=&quot;IronRuby&quot; type=&quot;IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; /&gt;
     &lt;/languages&gt;
 
     &lt;options&gt;</diff>
      <filename>Merlin/Main/Config/Signed/App.config</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@
   &lt;microsoft.scripting&gt;
     &lt;languages&gt;
       &lt;language names=&quot;IronPython;Python;py&quot; extensions=&quot;.py&quot; displayName=&quot;IronPython 2.6 Alpha&quot; type=&quot;IronPython.Runtime.PythonContext, IronPython, Version=2.6.0.20, Culture=neutral, PublicKeyToken=null&quot; /&gt;
-      &lt;language names=&quot;IronRuby;Ruby;rb&quot; extensions=&quot;.rb&quot; displayName=&quot;IronRuby&quot; type=&quot;IronRuby.Runtime.RubyContext, IronRuby, Version=0.6.0.0, Culture=neutral, PublicKeyToken=null&quot; /&gt;
+      &lt;language names=&quot;IronRuby;Ruby;rb&quot; extensions=&quot;.rb&quot; displayName=&quot;IronRuby&quot; type=&quot;IronRuby.Runtime.RubyContext, IronRuby, Version=0.9.0.0, Culture=neutral, PublicKeyToken=null&quot; /&gt;
     &lt;/languages&gt;
 
     &lt;options&gt;</diff>
      <filename>Merlin/Main/Config/Unsigned/App.config</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,7 @@ namespace IronRuby.Rack {
 
         private readonly object _app;
         private readonly string _appRoot;
-        private readonly string _rackVersion;
+        private readonly string _rackVersion;
         private readonly string _gemPath;
 
         public object App {
@@ -20,12 +20,12 @@ namespace IronRuby.Rack {
         }
 
         private const string AppRootOptionName = &quot;AppRoot&quot;;
-        private const string RackVersionOptionName = &quot;RackVersion&quot;;
+        private const string RackVersionOptionName = &quot;RackVersion&quot;;
         private const string GemPathOptionName = &quot;GemPath&quot;;
 
         public Application(HttpContext context) {
             _appRoot = GetRoot(context);
-            _rackVersion = GetRackVersion();
+            _rackVersion = GetRackVersion();
             _gemPath = GetGemPath();
 
             InitRack();
@@ -41,7 +41,7 @@ namespace IronRuby.Rack {
             return RubyEngine.ExecuteMethod&lt;RubyArray&gt;(_app, &quot;call&quot;, envHash);
         }
 
-        private void InitRack() {
+        private void InitRack() {
             Environment.SetEnvironmentVariable(&quot;GEM_PATH&quot;, _gemPath);
 
             Utils.Log(&quot;=&gt; Loading RubyGems&quot;);
@@ -83,10 +83,10 @@ namespace IronRuby.Rack {
                 }
             }
             return root;
-        }
-
-        private static string GetGemPath() {
-            return ConfigurationManager.AppSettings[GemPathOptionName] ?? &quot;&quot;;
+        }
+
+        private static string GetGemPath() {
+            return ConfigurationManager.AppSettings[GemPathOptionName] ?? &quot;&quot;;
         }
     }
 }</diff>
      <filename>Merlin/Main/Hosts/IronRuby.Rack/Application.cs</filename>
    </modified>
    <modified>
      <diff>@@ -41,16 +41,16 @@ namespace IronRuby.Rack {
 
         public static object Execute(string code, ScriptScope aScope) {
             return Engine.CreateScriptSourceFromString(code).Execute(aScope);
-        }
-
-        public static T Execute&lt;T&gt;(string code)
-        {
-            return Execute&lt;T&gt;(code, scope);
-        }
-
-        public static T Execute&lt;T&gt;(string code, ScriptScope aScope)
-        {
-            return (T)Engine.CreateScriptSourceFromString(code).Execute(aScope);
+        }
+
+        public static T Execute&lt;T&gt;(string code)
+        {
+            return Execute&lt;T&gt;(code, scope);
+        }
+
+        public static T Execute&lt;T&gt;(string code, ScriptScope aScope)
+        {
+            return (T)Engine.CreateScriptSourceFromString(code).Execute(aScope);
         }
         
         public static T ExecuteMethod&lt;T&gt;(object instance, string methodName, params object[] args)</diff>
      <filename>Merlin/Main/Hosts/IronRuby.Rack/RubyEngine.cs</filename>
    </modified>
    <modified>
      <diff>@@ -45,13 +45,13 @@ namespace IronRuby.Rack {
             foreach (var path in RubyEngine.Engine.GetSearchPaths()) {
                 context.Response.Write(HttpUtility.HtmlEncode(path));
                 context.Response.Write(&quot;\r\n&quot;);
-            }
-            context.Response.Write(&quot;&lt;/pre&gt;\r\n&quot;);
-            context.Response.Write(&quot;&lt;h4&gt;Gem paths&lt;/h4&gt;\r\n&quot;);
-            context.Response.Write(&quot;&lt;pre&gt;\r\n&quot;);
-            foreach (var gempath in RubyEngine.Execute&lt;RubyArray&gt;(&quot;require 'rubygems'; Gem.path&quot;)) {
-                context.Response.Write(HttpUtility.HtmlEncode(((MutableString)gempath).ToString()));
-                context.Response.Write(&quot;\r\n&quot;);
+            }
+            context.Response.Write(&quot;&lt;/pre&gt;\r\n&quot;);
+            context.Response.Write(&quot;&lt;h4&gt;Gem paths&lt;/h4&gt;\r\n&quot;);
+            context.Response.Write(&quot;&lt;pre&gt;\r\n&quot;);
+            foreach (var gempath in RubyEngine.Execute&lt;RubyArray&gt;(&quot;require 'rubygems'; Gem.path&quot;)) {
+                context.Response.Write(HttpUtility.HtmlEncode(((MutableString)gempath).ToString()));
+                context.Response.Write(&quot;\r\n&quot;);
             }
             context.Response.Write(&quot;&lt;/pre&gt;\r\n&quot;);
             context.Response.Write(&quot;&lt;/html&gt;\r\n&quot;);</diff>
      <filename>Merlin/Main/Hosts/IronRuby.Rack/Utils.cs</filename>
    </modified>
    <modified>
      <diff>@@ -32,7 +32,7 @@ namespace Microsoft.Scripting.Silverlight {
         public ScriptScope EntryPointScope { get; private set; }
 
         public void Start() {
-            InitializeRuntime(Settings.Debug);
+            InitializeRuntime(Settings.Debug);
             Run(Settings.GetEntryPoint(), Settings.ConsoleEnabled);
         }
 
@@ -68,8 +68,8 @@ namespace Microsoft.Scripting.Silverlight {
         private void Run(string entryPoint, bool consoleEnabled) {
             string code = GetEntryPointContents();
             Engine = Runtime.GetEngineByFileExtension(Path.GetExtension(entryPoint));
-            EntryPointScope = Engine.CreateScope();
-
+            EntryPointScope = Engine.CreateScope();
+
             if (consoleEnabled) Repl.Show();
 
             ScriptSource sourceCode = Engine.CreateScriptSourceFromString(code, entryPoint, SourceCodeKind.File);</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/DynamicEngine.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
     &lt;SignAssembly Condition=&quot;'$(SignAssembly)' == '' And Exists('$(AssemblyOriginatorKeyFile)')&quot;&gt;true&lt;/SignAssembly&gt;
     &lt;SignedSym Condition=&quot;'$(SignAssembly)' == 'true'&quot;&gt;SIGNED&lt;/SignedSym&gt;
     &lt;DelaySign&gt;true&lt;/DelaySign&gt;
-    &lt;SilverlightPath Condition=&quot;$(SilverlightPath) == ''&quot;&gt;..\..\..\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
+    &lt;SilverlightPath Condition=&quot;'$(SilverlightPath)' == ''&quot;&gt;..\..\..\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
     &lt;BaseAddress&gt;885063680&lt;/BaseAddress&gt;
   &lt;/PropertyGroup&gt;
   &lt;PropertyGroup Condition=&quot; '$(Configuration)' == 'Debug' &quot;&gt;
@@ -80,8 +80,8 @@
       &lt;HintPath&gt;$(SilverlightPath)\System.Core.dll&lt;/HintPath&gt;
       &lt;Aliases&gt;systemcore&lt;/Aliases&gt;
     &lt;/Reference&gt;
-    &lt;Reference Include=&quot;System.Data&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
-    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Data&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
     &lt;Compile Include=&quot;..\..\..\Hosts\Silverlight\SilverlightVersion.cs&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython.Modules/IronPython.Modules.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -251,7 +251,7 @@ namespace IronPython.Modules {
         }
 
         [PythonType, DynamicBaseTypeAttribute, PythonHidden]
-        public sealed partial class weakproxy : IPythonObject, ICodeFormattable, IProxyObject, IValueEquality, IMembersList {
+        public sealed partial class weakproxy : IPythonObject, ICodeFormattable, IProxyObject, IValueEquality, IPythonMembersList {
             private readonly WeakHandle _target;
             private readonly CodeContext/*!*/ _context;
 
@@ -406,7 +406,11 @@ namespace IronPython.Modules {
                 PythonOps.DeleteAttr(context, o, SymbolTable.StringToId(name));
             }
 
-            IList&lt;object&gt; IMembersList.GetMemberNames(CodeContext/*!*/ context) {
+            IList&lt;string&gt; IMembersList.GetMemberNames() {
+                return PythonOps.GetStringMemberList(this);
+            }
+
+            IList&lt;object&gt; IPythonMembersList.GetMemberNames(CodeContext/*!*/ context) {
                 object o;
                 if (!TryGetObject(out o)) {
                     // if we've been disconnected return an empty list
@@ -456,7 +460,7 @@ namespace IronPython.Modules {
             ICodeFormattable,            
             IProxyObject,
             IValueEquality,
-            IMembersList {
+            IPythonMembersList {
 
             private WeakHandle _target;
             private readonly CodeContext/*!*/ _context;
@@ -625,7 +629,11 @@ namespace IronPython.Modules {
                 PythonOps.DeleteAttr(context, o, SymbolTable.StringToId(name));
             }
 
-            IList&lt;object&gt; IMembersList.GetMemberNames(CodeContext/*!*/ context) {
+            IList&lt;string&gt; IMembersList.GetMemberNames() {
+                return PythonOps.GetStringMemberList(this);
+            }
+
+            IList&lt;object&gt; IPythonMembersList.GetMemberNames(CodeContext/*!*/ context) {
                 object o;
                 if (!TryGetObject(out o)) {
                     // if we've been disconnected return an empty list</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython.Modules/_weakref.cs</filename>
    </modified>
    <modified>
      <diff>@@ -510,7 +510,7 @@ namespace IronPython.Modules {
         public static PythonTuple _pickle(CodeContext/*!*/ context, RE_Pattern pattern) {
             object scope = Importer.ImportModule(context, new PythonDictionary(), &quot;re&quot;, false, 0);
             object compile;
-            if (scope is Scope &amp;&amp; ((Scope)scope).TryGetName(SymbolTable.StringToId(&quot;compile&quot;), out compile)) {
+            if (scope is Scope &amp;&amp; ((Scope)scope).TryGetVariable(SymbolTable.StringToId(&quot;compile&quot;), out compile)) {
                 return PythonTuple.MakeTuple(compile, PythonTuple.MakeTuple(pattern.pattern, pattern.flags));
             }
             throw new InvalidOperationException(&quot;couldn't find compile method&quot;);</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython.Modules/re.cs</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,7 @@ namespace IronPython.Compiler.Ast {
         private readonly GlobalArrayConstant _array;
         internal static readonly MSAst.ParameterExpression/*!*/ _globalContext = Ast.Parameter(typeof(CodeContext), &quot;$globalContext&quot;);
 
-        public ArrayGlobalAllocator(LanguageContext/*!*/ context) {
+        public ArrayGlobalAllocator(PythonContext/*!*/ context) {
             _globalArray = Ast.Parameter(typeof(PythonGlobal[]), &quot;$globalArray&quot;);
             _scope = new Scope(new PythonDictionary(new GlobalDictionaryStorage(_globalVals)));
             _context = new CodeContext(_scope, context);</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/ArrayGlobalAllocator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -71,7 +71,7 @@ namespace IronPython.Compiler.Ast {
         private Dictionary&lt;int, bool&gt; _handlerLocations;                // list of all exception handlers and finallys.  - used for debugging/tracing support to disallow jumping into handlers.  Value is true if handler is finally
 
         private static readonly Dictionary&lt;string, MethodInfo&gt; _HelperMethods = new Dictionary&lt;string, MethodInfo&gt;(); // cache of helper methods
-        private static readonly MethodInfo _UpdateStackTrace = typeof(ExceptionHelpers).GetMethod(&quot;UpdateStackTrace&quot;);
+        private static readonly MethodInfo _UpdateStackTrace = typeof(PythonOps).GetMethod(&quot;UpdateStackTrace&quot;);
         private static readonly MSAst.Expression _GetCurrentMethod = Ast.Call(typeof(MethodBase).GetMethod(&quot;GetCurrentMethod&quot;));
         internal static readonly MSAst.Expression[] EmptyExpression = new MSAst.Expression[0];
         internal static readonly MSAst.BlockExpression EmptyBlock = Ast.Block(AstUtils.Empty());
@@ -115,16 +115,15 @@ namespace IronPython.Compiler.Ast {
             _context = context;
             _pythonContext = (PythonContext)context.SourceUnit.LanguageContext;
             _document = _context.SourceUnit.Document ?? Ast.SymbolDocument(name, PyContext.LanguageGuid, PyContext.VendorGuid);
-
-            LanguageContext pc = context.SourceUnit.LanguageContext;
+            
             switch (mode) {
-                case CompilationMode.Collectable: _globals = new ArrayGlobalAllocator(pc); break;
+                case CompilationMode.Collectable: _globals = new ArrayGlobalAllocator(_pythonContext); break;
                 case CompilationMode.Lookup: _globals = new DictionaryGlobalAllocator(); break;
-                case CompilationMode.ToDisk: _globals = new SavableGlobalAllocator(pc); break;
-                case CompilationMode.Uncollectable: _globals = new StaticGlobalAllocator(pc, name); break;
+                case CompilationMode.ToDisk: _globals = new SavableGlobalAllocator(_pythonContext); break;
+                case CompilationMode.Uncollectable: _globals = new StaticGlobalAllocator(_pythonContext, name); break;
             }
 
-            PythonOptions po = (pc.Options as PythonOptions);
+            PythonOptions po = (_pythonContext.Options as PythonOptions);
             Assert.NotNull(po);
             if (po.EnableProfiler &amp;&amp; mode != CompilationMode.ToDisk) {
                 _profiler = Profiler.GetProfiler(PyContext);
@@ -638,7 +637,7 @@ namespace IronPython.Compiler.Ast {
                             LineNumberUpdated
                         ),
                         Ast.Call(
-                            typeof(ExceptionHelpers).GetMethod(&quot;UpdateStackTrace&quot;),
+                            _UpdateStackTrace,
                             LocalContext,
                             _GetCurrentMethod,
                             AstUtils.Constant(Name),</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/Ast/AstGenerator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -81,7 +81,7 @@ namespace IronPython.Compiler.Ast {
         }
 
         protected override MSAst.Expression/*!*/ GetGlobal(string/*!*/ name, AstGenerator/*!*/ ag, bool isLocal) {
-            return new LookupGlobalVariable(Ast.Property(ag.LocalContext, &quot;Scope&quot;), name, isLocal);
+            return new LookupGlobalVariable(ag.LocalContext, name, isLocal);
         }
     }
 }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/DictionaryGlobalAllocator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -68,7 +68,7 @@ namespace IronPython.Compiler {
                 PythonGlobal[] globalArray = new PythonGlobal[optimizedCode.Names.Length];
                 Scope scope = new Scope(new PythonDictionary(new GlobalDictionaryStorage(globals, globalArray)));
 
-                CodeContext res = new CodeContext(scope, SourceUnit.LanguageContext);
+                CodeContext res = new CodeContext(scope, (PythonContext)SourceUnit.LanguageContext);
 
                 for (int i = 0; i &lt; optimizedCode.Names.Length; i++) {
                     SymbolId name = SymbolTable.StringToId(optimizedCode.Names[i]);</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/OnDiskScriptCode.cs</filename>
    </modified>
    <modified>
      <diff>@@ -83,7 +83,7 @@ namespace IronPython.Compiler {
             } else {
                 object value;
 
-                if (_context.LanguageContext.TryLookupGlobal(_context.Scope, _name, out value)) {
+                if (_context.TryLookupGlobal(_name, out value)) {
                     return value;
                 }
             }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/PythonGlobal.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,7 @@
  * ***************************************************************************/
 
 using System;
+using System.Diagnostics;
 using System.Linq.Expressions;
 
 using Microsoft.Scripting;
@@ -22,6 +23,7 @@ using Microsoft.Scripting.Interpreter;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
 
+using IronPython.Runtime;
 using IronPython.Runtime.Operations;
 
 namespace IronPython.Compiler {
@@ -211,14 +213,15 @@ namespace IronPython.Compiler {
     class LookupGlobalVariable : Expression, IInstructionProvider, IPythonGlobalExpression {
         private readonly string/*!*/ _name;
         private readonly bool/*!*/ _isLocal;
-        private readonly Expression/*!*/ _scope;
+        private readonly Expression/*!*/ _codeContextExpr;
 
-        public LookupGlobalVariable(Expression/*!*/ scopeExpr, string/*!*/  name, bool isLocal) {
+        public LookupGlobalVariable(Expression/*!*/ codeContextExpr, string/*!*/  name, bool isLocal) {
+            Debug.Assert(codeContextExpr.Type == typeof(CodeContext));
             Assert.NotNull(name);
 
             _name = name;
             _isLocal = isLocal;
-            _scope = scopeExpr;
+            _codeContextExpr = codeContextExpr;
         }
 
         public sealed override ExpressionType NodeType {
@@ -238,7 +241,7 @@ namespace IronPython.Compiler {
         public Expression/*!*/ RawValue() {
             return Expression.Call(
                 typeof(PythonOps).GetMethod(_isLocal ? &quot;RawGetLocal&quot; : &quot;RawGetGlobal&quot;),
-                _scope,
+                _codeContextExpr,
                 Utils.Constant(SymbolTable.StringToId(_name))
             );
         }
@@ -246,7 +249,7 @@ namespace IronPython.Compiler {
         public override Expression/*!*/ Reduce() {
             return Expression.Call(
                 typeof(PythonOps).GetMethod(_isLocal ? &quot;GetLocal&quot; : &quot;GetGlobal&quot;),
-                _scope,
+                _codeContextExpr,
                 Utils.Constant(SymbolTable.StringToId(_name))
             );
         }
@@ -254,7 +257,7 @@ namespace IronPython.Compiler {
         public Expression/*!*/ Assign(Expression/*!*/ value) {
             return Expression.Call(
                 typeof(PythonOps).GetMethod(_isLocal ? &quot;SetLocal&quot; : &quot;SetGlobal&quot;),
-                _scope,
+                _codeContextExpr,
                 Utils.Constant(SymbolTable.StringToId(_name)),
                 value
             );
@@ -263,7 +266,7 @@ namespace IronPython.Compiler {
         public Expression/*!*/ Delete() {
             return Expression.Call(
                 typeof(PythonOps).GetMethod(_isLocal ? &quot;DeleteLocal&quot; : &quot;DeleteGlobal&quot;),
-                _scope,
+                _codeContextExpr,
                 Utils.Constant(SymbolTable.StringToId(_name))
             );
         }
@@ -271,7 +274,7 @@ namespace IronPython.Compiler {
         #region IInstructionProvider Members
 
         void IInstructionProvider.AddInstructions(LightCompiler compiler) {
-            compiler.Compile(_scope);
+            compiler.Compile(_codeContextExpr);
             compiler.AddInstruction(new LookupGlobalInstruction(_name, _isLocal));
         }
 
@@ -289,9 +292,9 @@ namespace IronPython.Compiler {
         public override int ProducedStack { get { return 1; } }
         public override int Run(InterpretedFrame frame) {
             if (_isLocal) {
-                frame.Push(PythonOps.GetLocal((Scope)frame.Pop(), _name));
+                frame.Push(PythonOps.GetLocal((CodeContext)frame.Pop(), _name));
             } else {
-                frame.Push(PythonOps.GetGlobal((Scope)frame.Pop(), _name));
+                frame.Push(PythonOps.GetGlobal((CodeContext)frame.Pop(), _name));
             }
             return +1;
         }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/PythonGlobalVariableExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@ using Microsoft.Scripting;
 using Microsoft.Scripting.Ast;
 using Microsoft.Scripting.Runtime;
 
+using IronPython.Runtime;
 using IronPython.Runtime.Operations;
 
 using MSAst = System.Linq.Expressions;
@@ -30,7 +31,7 @@ namespace IronPython.Compiler.Ast {
     class SavableGlobalAllocator : ArrayGlobalAllocator {
         private readonly List&lt;MSAst.Expression/*!*/&gt;/*!*/ _constants;
 
-        public SavableGlobalAllocator(LanguageContext/*!*/ context)
+        public SavableGlobalAllocator(PythonContext/*!*/ context)
             : base(context) {
             _constants = new List&lt;MSAst.Expression&gt;();
         }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/SavableGlobalAllocator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ namespace IronPython.Compiler.Ast {
         private StrongBox&lt;Type&gt; _finalType = new StrongBox&lt;Type&gt;();        
 #endif
 
-        public StaticGlobalAllocator(LanguageContext/*!*/ context, string name) {
+        public StaticGlobalAllocator(PythonContext/*!*/ context, string name) {
             _typeGen = Snippets.Shared.DefineType(name, typeof(object), false, false);
 
             _codeContextField = _typeGen.AddStaticField(typeof(CodeContext), &quot;__global_context&quot;);</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Compiler/StaticGlobalAllocator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -194,8 +194,8 @@ namespace IronPython.Hosting {
             ModuleOptions trueDiv = (PythonContext.PythonOptions.DivisionOptions == PythonDivisionOptions.New) ? ModuleOptions.TrueDivision : ModuleOptions.None;
             PythonModule module = PythonContext.CreateModule(trueDiv | ModuleOptions.ModuleBuiltins);
             PythonContext.PublishModule(&quot;__main__&quot;, module);
-            module.Scope.SetName(Symbols.Doc, null);
-            module.Scope.SetName(Symbols.Name, &quot;__main__&quot;);
+            module.Scope.SetVariable(Symbols.Doc, null);
+            module.Scope.SetVariable(Symbols.Name, &quot;__main__&quot;);
             return module.Scope;
         }
         
@@ -510,6 +510,13 @@ namespace IronPython.Hosting {
         protected override void UnhandledException(Exception e) {
             PythonOps.PrintException(new CodeContext(Scope, Language), e, Console);
         }
+
+        private new PythonContext Language {
+            get {
+                return (PythonContext)base.Language;
+            }
+        }
+
     }
 #endif
 }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Hosting/PythonCommandLine.cs</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/IronPython.Build.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -80,7 +80,7 @@
     &lt;NoWarn&gt;1591&lt;/NoWarn&gt;
   &lt;/PropertyGroup&gt;
   &lt;ItemGroup&gt;
-    &lt;Reference Include=&quot;System&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
     &lt;Reference Include=&quot;mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;$(SilverlightPath)\mscorlib.dll&lt;/HintPath&gt;
@@ -90,7 +90,7 @@
       &lt;HintPath&gt;$(SilverlightPath)\System.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
     &lt;Reference Include=&quot;System.Data&quot; /&gt;
-    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
     &lt;Compile Include=&quot;..\..\..\Hosts\SilverLight\SilverlightVersion.cs&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;
@@ -103,6 +103,7 @@
     &lt;Compile Include=&quot;Compiler\Ast\AssignmentStatement.cs&quot; /&gt;
     &lt;Compile Include=&quot;Compiler\Ast\AstGenerator.cs&quot; /&gt;
     &lt;Compile Include=&quot;Modules\imp.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Runtime\CodeContext.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\DontMapIEnumerableToIterAttribute.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Binding\ContextArgBuilder.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Binding\IFastSettable.cs&quot; /&gt;
@@ -247,6 +248,7 @@
     &lt;Compile Include=&quot;Runtime\Operations\IListOfByteOps.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\BytesConversionAttribute.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Python3Warning.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Runtime\PythonDynamicStackFrame.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\PythonFunction.Generated.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\PythonOptions.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\CompiledLoader.cs&quot; /&gt;
@@ -450,6 +452,7 @@
     &lt;Compile Include=&quot;Runtime\Types\IPythonObject.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Types\PythonTypeSlot.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Types\DynamicHelpers.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Runtime\UnboundNameException.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\WarningInfo.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\WeakRef.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\WrapperDescriptorAttribute.cs&quot; /&gt;</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/IronPython.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,10 @@
 #
 #####################################################################################
 
+all_feature_names = ['nested_scopes', 'generators', 'division', 
+                     'absolute_import', 'with_statement', 'print_function', 
+                     'unicode_literals']
+
 division=1
 with_statement=1
 generators=1</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Lib/__future__.py</filename>
    </modified>
    <modified>
      <diff>@@ -835,7 +835,7 @@ namespace IronPython.Modules {
                     if (name == Symbols.Class || name == Symbols.Builtins) continue;
 
                     object value;
-                    if (scope.TryGetName(name, out value)) {
+                    if (scope.TryGetVariable(name, out value)) {
                         help(context, doced, doc, indent + 1, value);
                     }
                 }
@@ -853,7 +853,7 @@ namespace IronPython.Modules {
                     doc.AppendLine();
                 }
 
-                IList&lt;object&gt; names = ((IMembersList)oldClass).GetMemberNames(context);
+                IList&lt;object&gt; names = ((IPythonMembersList)oldClass).GetMemberNames(context);
                 List sortNames = new List(names);
                 sortNames.sort(context);
                 names = sortNames;</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Modules/Builtin.cs</filename>
    </modified>
    <modified>
      <diff>@@ -109,9 +109,9 @@ namespace IronPython.Modules {
             if (name == null) throw PythonOps.TypeError(&quot;new_module() argument 1 must be string, not None&quot;);
 
             Scope res = PythonContext.GetContext(context).CreateModule().Scope;
-            res.SetName(Symbols.Name, name);
-            res.SetName(Symbols.Doc, null);
-            res.SetName(Symbols.Package, null);
+            res.SetVariable(Symbols.Name, name);
+            res.SetVariable(Symbols.Doc, null);
+            res.SetVariable(Symbols.Package, null);
             return res;
         }
 
@@ -209,8 +209,8 @@ namespace IronPython.Modules {
 
             PythonModule mod = pc.CreateModule();
             Scope scope = mod.Scope;
-            scope.SetName(Symbols.Name, name);
-            scope.SetName(Symbols.Path, pathname);
+            scope.SetVariable(Symbols.Name, name);
+            scope.SetVariable(Symbols.Path, pathname);
 
             pc.SystemStateModules[name] = scope;
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Modules/imp.cs</filename>
    </modified>
    <modified>
      <diff>@@ -296,7 +296,7 @@ namespace IronPython.Runtime.Binding {
             return new ValidationInfo(typeTest);
         }
 
-        private static MethodCallExpression/*!*/ CheckTypeVersion(Expression/*!*/ tested, int version) {
+        internal static MethodCallExpression/*!*/ CheckTypeVersion(Expression/*!*/ tested, int version) {
             FieldInfo fi = tested.Type.GetField(NewTypeMaker.ClassFieldName);
             if (fi == null) {
                 return Ast.Call(</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/BindingHelpers.cs</filename>
    </modified>
    <modified>
      <diff>@@ -214,7 +214,7 @@ namespace IronPython.Runtime.Binding {
                 );
             }
 
-            return res ?? EnsureReturnType(Context.Binder.ConvertTo(Type, ResultKind, self));
+            return res ?? EnsureReturnType(Context.Binder.ConvertTo(Type, ResultKind, self, _context.SharedOverloadResolverFactory));
         }
 
         private DynamicMetaObject EnsureReturnType(DynamicMetaObject dynamicMetaObject) {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/ConversionBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -98,7 +98,7 @@ namespace IronPython.Runtime.Binding {
         }
 
         public override System.Collections.Generic.IEnumerable&lt;string&gt; GetDynamicMemberNames() {
-            foreach (object o in ((IMembersList)Value).GetMemberNames(DefaultContext.Default)) {
+            foreach (object o in ((IPythonMembersList)Value).GetMemberNames(DefaultContext.Default)) {
                 if (o is string) {
                     yield return (string)o;
                 }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/MetaOldClass.cs</filename>
    </modified>
    <modified>
      <diff>@@ -153,7 +153,7 @@ namespace IronPython.Runtime.Binding {
         }
 
         public override System.Collections.Generic.IEnumerable&lt;string&gt; GetDynamicMemberNames() {
-            foreach (object o in ((IMembersList)Value).GetMemberNames(DefaultContext.Default)) {
+            foreach (object o in ((IPythonMembersList)Value).GetMemberNames(DefaultContext.Default)) {
                 if (o is string) {
                     yield return (string)o;
                 }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/MetaOldInstance.cs</filename>
    </modified>
    <modified>
      <diff>@@ -134,7 +134,8 @@ namespace IronPython.Runtime.Binding {
                 BindingRestrictionsHelpers.GetRuntimeTypeRestriction(Expression, LimitType),
                 Value
             );
-            ArgumentValues ai = new ArgumentValues(BindingHelpers.GetCallSignature(call), self, args);
+            CallSignature sig = BindingHelpers.GetCallSignature(call);
+            ArgumentValues ai = new ArgumentValues(sig, self, args);
             NewAdapter newAdapter;
             InitAdapter initAdapter;
 
@@ -163,76 +164,89 @@ namespace IronPython.Runtime.Binding {
                 );                    
             }
 
-            // then get the statement for calling __init__
-            ParameterExpression allocatedInst = Ast.Variable(createExpr.GetLimitType(), &quot;newInst&quot;);
-            Expression tmpRead = allocatedInst;
-            DynamicMetaObject initCall = initAdapter.MakeInitCall(
-                state.Binder,
-                new RestrictedMetaObject(
-                    AstUtils.Convert(allocatedInst, Value.UnderlyingSystemType),
-                    createExpr.Restrictions
-                )
-            );
-
-            List&lt;Expression&gt; body = new List&lt;Expression&gt;();
-            // then get the call to __del__ if we need one
-            if (HasFinalizer(call)) {
-                body.Add(
-                    Ast.Assign(allocatedInst, createExpr.Expression)
+            Expression res;
+            BindingRestrictions additionalRestrictions = BindingRestrictions.Empty;
+            if (!Value.IsSystemType &amp;&amp; (!(newAdapter is DefaultNewAdapter) || HasFinalizer(call))) {
+                // we need to dynamically check the return value to see if it's a subtype of
+                // the type that we are calling.  If it is then we need to call __init__/__del__
+                // for the actual returned type.
+                res = Expression.Dynamic(
+                    Value.GetLateBoundInitBinder(sig),
+                    typeof(object),
+                    ArrayUtils.Insert(
+                        codeContext,
+                        Expression.Convert(createExpr.Expression, typeof(object)),
+                        DynamicUtils.GetExpressions(args)
+                    )
                 );
-                body.Add(
-                    GetFinalizerInitialization(call, allocatedInst)
+                additionalRestrictions = createExpr.Restrictions;
+            } else {
+                // just call the __init__ method, built-in types currently have
+                // no wacky return values which don't return the derived type.
+
+                // then get the statement for calling __init__
+                ParameterExpression allocatedInst = Ast.Variable(createExpr.GetLimitType(), &quot;newInst&quot;);
+                Expression tmpRead = allocatedInst;
+                DynamicMetaObject initCall = initAdapter.MakeInitCall(
+                    state.Binder,
+                    new RestrictedMetaObject(
+                        AstUtils.Convert(allocatedInst, Value.UnderlyingSystemType),
+                        createExpr.Restrictions
+                    )
                 );
-            }
-
-            // add the call to init if we need to
-            if (initCall.Expression != tmpRead) {
-                // init can fail but if __new__ returns a different type
-                // no exception is raised.
-                DynamicMetaObject initStmt = initCall;
 
-                if (body.Count == 0) {
-                    body.Add(
-                        Ast.Assign(allocatedInst, createExpr.Expression)
-                    );
+                List&lt;Expression&gt; body = new List&lt;Expression&gt;();
+                Debug.Assert(!HasFinalizer(call));
+
+                // add the call to init if we need to
+                if (initCall.Expression != tmpRead) {
+                    // init can fail but if __new__ returns a different type
+                    // no exception is raised.
+                    DynamicMetaObject initStmt = initCall;
+
+                    if (body.Count == 0) {
+                        body.Add(
+                            Ast.Assign(allocatedInst, createExpr.Expression)
+                        );
+                    }
+
+                    if (!Value.UnderlyingSystemType.IsAssignableFrom(createExpr.Expression.Type)) {
+                        // return type of object, we need to check the return type before calling __init__.
+                        body.Add(
+                            AstUtils.IfThen(
+                                Ast.TypeIs(allocatedInst, Value.UnderlyingSystemType),
+                                initStmt.Expression
+                            )
+                        );
+                    } else {
+                        // just call the __init__ method, no type check necessary (TODO: need null check?)
+                        body.Add(initStmt.Expression);
+                    }
                 }
 
-                if (!Value.UnderlyingSystemType.IsAssignableFrom(createExpr.Expression.Type)) {
-                    // return type of object, we need to check the return type before calling __init__.
-                    body.Add(
-                        AstUtils.IfThen(
-                            Ast.TypeIs(allocatedInst, Value.UnderlyingSystemType),
-                            initStmt.Expression
-                        )
-                    );
+                // and build the target from everything we have
+                if (body.Count == 0) {
+                    res = createExpr.Expression;
                 } else {
-                    // just call the __init__ method, no type check necessary (TODO: need null check?)
-                    body.Add(initStmt.Expression);
+                    body.Add(allocatedInst);
+                    res = Ast.Block(body);
                 }
-            }
+                res = Ast.Block(new ParameterExpression[] { allocatedInst }, res);
 
-            Expression res;
-            // and build the target from everything we have
-            if (body.Count == 0) {
-                res = createExpr.Expression;
-            } else {
-                body.Add(allocatedInst);
-                res = Ast.Block(body);
+                additionalRestrictions = initCall.Restrictions;
             }
-            res = Ast.Block(new ParameterExpression[] { allocatedInst }, res);
 
             return BindingHelpers.AddDynamicTestAndDefer(
                 call,
                 new DynamicMetaObject(
                     res,
-                    self.Restrictions.Merge(initCall.Restrictions)
+                    self.Restrictions.Merge(additionalRestrictions)
                 ),
                 ArrayUtils.Insert(this, args),
                 valInfo
             );
         }
-
-
+        
         #endregion
 
         #region Adapter support
@@ -502,21 +516,19 @@ namespace IronPython.Runtime.Binding {
             protected DynamicMetaObject/*!*/ MakeDefaultInit(PythonBinder/*!*/ binder, DynamicMetaObject/*!*/ createExpr, Expression/*!*/ init) {
                 List&lt;Expression&gt; args = new List&lt;Expression&gt;();
                 args.Add(CodeContext);
-                args.Add(init);
+                args.Add(Expression.Convert(createExpr.Expression, typeof(object)));
                 foreach (DynamicMetaObject mo in Arguments.Arguments) {
                     args.Add(mo.Expression);
                 }
 
                 return new DynamicMetaObject(
-                    Ast.Dynamic(
-                        PythonContext.Invoke(
-                            Arguments.Signature
-                        ),
+                    Expression.Dynamic(
+                        ((PythonType)Arguments.Self.Value).GetLateBoundInitBinder(Arguments.Signature),
                         typeof(object),
-                        args
+                        args.ToArray()
                     ),
                     Arguments.Self.Restrictions.Merge(createExpr.Restrictions)
-                );
+                );                
             }
         }
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/MetaPythonType.Calls.cs</filename>
    </modified>
    <modified>
      <diff>@@ -86,7 +86,7 @@ namespace IronPython.Runtime.Binding {
                             tt
                         ),
                         value,
-                        AstUtils.Constant(state.SharedContext)
+                        new PythonOverloadResolverFactory(state.Binder, AstUtils.Constant(state.SharedContext))
                     ).Expression,
                     Restrictions.Merge(value.Restrictions).Merge(BindingRestrictions.GetInstanceRestriction(Expression, Value))
                 );
@@ -112,7 +112,8 @@ namespace IronPython.Runtime.Binding {
                             AstUtils.Constant(tt),
                             BindingRestrictions.Empty,
                             tt
-                        )
+                        ),
+                        state.SharedOverloadResolverFactory
                     ).Expression,
                     BindingRestrictions.GetInstanceRestriction(Expression, Value).Merge(Restrictions)
                 );
@@ -331,8 +332,12 @@ namespace IronPython.Runtime.Binding {
                 pts.MakeGetExpression(
                         _state.Binder,
                         _codeContext,
-                        null,
-                        AstUtils.Convert(AstUtils.WeakConstant(Value), typeof(PythonType)),
+                        null,                        
+                        new DynamicMetaObject(
+                            AstUtils.Convert(AstUtils.WeakConstant(Value), typeof(PythonType)),
+                            BindingRestrictions.Empty,
+                            Value
+                        ),
                         _cb
                     );
 
@@ -386,10 +391,15 @@ namespace IronPython.Runtime.Binding {
 
             protected override void AddMetaSlotAccess(PythonType metaType, PythonTypeSlot pts) {
                 ParameterExpression tmp = Ast.Variable(typeof(object), &quot;slotRes&quot;);
-                pts.MakeGetExpression(_state.Binder,
+                pts.MakeGetExpression(
+                    _state.Binder,
                     _codeContext,
-                    Expression,
-                    AstUtils.Constant(metaType),
+                    _type,
+                    new DynamicMetaObject(
+                        AstUtils.Constant(metaType),
+                        BindingRestrictions.Empty,
+                        metaType
+                    ),
                     _cb
                 );
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/MetaPythonType.Members.cs</filename>
    </modified>
    <modified>
      <diff>@@ -313,7 +313,7 @@ namespace IronPython.Runtime.Binding {
         private Expression ConversionFallback(DynamicMetaObjectBinder/*!*/ convertToAction) {
             PythonConversionBinder cb = convertToAction as PythonConversionBinder;
             if (cb != null) {
-                return GetConversionFailedReturnValue(cb, this);
+                return GetConversionFailedReturnValue(cb, this).Expression;
             }
 
             return convertToAction.GetUpdateExpression(typeof(object));
@@ -342,11 +342,11 @@ namespace IronPython.Runtime.Binding {
         /// &lt;summary&gt;
         ///  Various helpers related to calling Python __*__ conversion methods 
         /// &lt;/summary&gt;
-        private Expression/*!*/ GetConversionFailedReturnValue(PythonConversionBinder/*!*/ convertToAction, DynamicMetaObject/*!*/ self) {
+        private DynamicMetaObject/*!*/ GetConversionFailedReturnValue(PythonConversionBinder/*!*/ convertToAction, DynamicMetaObject/*!*/ self) {
             switch (convertToAction.ResultKind) {
                 case ConversionResultKind.ImplicitTry:
                 case ConversionResultKind.ExplicitTry:
-                    return DefaultBinder.GetTryConvertReturnValue(convertToAction.Type);
+                    return new DynamicMetaObject(DefaultBinder.GetTryConvertReturnValue(convertToAction.Type), BindingRestrictions.Empty);
                 case ConversionResultKind.ExplicitCast:
                 case ConversionResultKind.ImplicitCast:
                     DefaultBinder db = PythonContext.GetPythonContext(convertToAction).Binder;</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/MetaUserObject.cs</filename>
    </modified>
    <modified>
      <diff>@@ -60,7 +60,7 @@ namespace IronPython.Runtime.Binding {
             }
         }
 
-        public override Expression/*!*/ ConvertExpression(Expression/*!*/ expr, Type/*!*/ toType, ConversionResultKind kind, Expression context) {
+        public override Expression/*!*/ ConvertExpression(Expression/*!*/ expr, Type/*!*/ toType, ConversionResultKind kind, OverloadResolverFactory factory) {
             ContractUtils.RequiresNotNull(expr, &quot;expr&quot;);
             ContractUtils.RequiresNotNull(toType, &quot;toType&quot;);
 
@@ -85,7 +85,7 @@ namespace IronPython.Runtime.Binding {
             }
 
             return Binders.Convert(
-                context,
+                ((PythonOverloadResolverFactory)factory)._codeContext,
                 _context,
                 visType,
                 visType == typeof(char) ? ConversionResultKind.ImplicitCast : kind,
@@ -182,9 +182,9 @@ namespace IronPython.Runtime.Binding {
             );
         }
 
-        public override ErrorInfo/*!*/ MakeNonPublicMemberGetError(Expression codeContext, MemberTracker member, Type type, Expression instance) {
+        public override ErrorInfo/*!*/ MakeNonPublicMemberGetError(OverloadResolverFactory resolverFactory, MemberTracker member, Type type, DynamicMetaObject instance) {
             if (PrivateBinding) {
-                return base.MakeNonPublicMemberGetError(codeContext, member, type, instance);
+                return base.MakeNonPublicMemberGetError(resolverFactory, member, type, instance);
             }
 
             return ErrorInfo.FromValue(
@@ -192,11 +192,11 @@ namespace IronPython.Runtime.Binding {
             );
         }
 
-        public override ErrorInfo/*!*/ MakeStaticAssignFromDerivedTypeError(Type accessingType, DynamicMetaObject instance, MemberTracker info, Expression assignedValue, Expression context) {
+        public override ErrorInfo/*!*/ MakeStaticAssignFromDerivedTypeError(Type accessingType, DynamicMetaObject instance, MemberTracker info, DynamicMetaObject assignedValue, OverloadResolverFactory factory) {
             return MakeMissingMemberError(accessingType, instance, info.Name);
         }
 
-        public override ErrorInfo/*!*/ MakeStaticPropertyInstanceAccessError(PropertyTracker/*!*/ tracker, bool isAssignment, IList&lt;Expression&gt;/*!*/ parameters) {
+        public override ErrorInfo/*!*/ MakeStaticPropertyInstanceAccessError(PropertyTracker/*!*/ tracker, bool isAssignment, IList&lt;DynamicMetaObject&gt;/*!*/ parameters) {            
             ContractUtils.RequiresNotNull(tracker, &quot;tracker&quot;);
             ContractUtils.RequiresNotNull(parameters, &quot;parameters&quot;);
 
@@ -240,36 +240,18 @@ namespace IronPython.Runtime.Binding {
         }
 
 
-        public override ErrorInfo/*!*/ MakeEventValidation(MemberGroup/*!*/ members, Expression eventObject, Expression/*!*/ value, Expression/*!*/ codeContext) {
+        public override ErrorInfo/*!*/ MakeEventValidation(MemberGroup/*!*/ members, DynamicMetaObject eventObject, DynamicMetaObject/*!*/ value, OverloadResolverFactory/*!*/ factory) {            
             EventTracker ev = (EventTracker)members[0];
 
             return ErrorInfo.FromValueNoError(
                Ast.Block(
                    Ast.Call(
                        typeof(PythonOps).GetMethod(&quot;SlotTrySetValue&quot;),
-                       codeContext,
+                       ((PythonOverloadResolverFactory)factory)._codeContext,
                        AstUtils.Constant(PythonTypeOps.GetReflectedEvent(ev)),
-                       eventObject != null ? AstUtils.Convert(eventObject, typeof(object)) : AstUtils.Constant(null),
+                       eventObject != null ? AstUtils.Convert(eventObject.Expression, typeof(object)) : AstUtils.Constant(null),
                        AstUtils.Constant(null, typeof(PythonType)),
-                       AstUtils.Convert(value, typeof(object))
-                   ),
-                   Ast.Constant(null)
-               )
-            );
-        }
-
-        public override ErrorInfo MakeEventValidation(RuleBuilder rule, MemberGroup members) {
-            EventTracker ev = (EventTracker)members[0];
-
-            return ErrorInfo.FromValueNoError(
-               Ast.Block(
-                   Ast.Call(
-                       typeof(PythonOps).GetMethod(&quot;SlotTrySetValue&quot;),
-                       rule.Context,
-                       AstUtils.Constant(PythonTypeOps.GetReflectedEvent(ev)),
-                       AstUtils.Convert(rule.Parameters[0], typeof(object)),
-                       AstUtils.Constant(null, typeof(PythonType)),
-                       AstUtils.Convert(rule.Parameters[1], typeof(object))
+                       AstUtils.Convert(value.Expression, typeof(object))
                    ),
                    Ast.Constant(null)
                )
@@ -408,33 +390,33 @@ namespace IronPython.Runtime.Binding {
             return _dlrExtensionTypes.ContainsKey(t);
         }
 
-        public override Expression ReturnMemberTracker(Type type, MemberTracker memberTracker) {
-            Expression res = ReturnMemberTracker(type, memberTracker, PrivateBinding);
+        public override DynamicMetaObject ReturnMemberTracker(Type type, MemberTracker memberTracker) {
+            var res = ReturnMemberTracker(type, memberTracker, PrivateBinding);
 
             return res ?? base.ReturnMemberTracker(type, memberTracker);
         }
 
-        private static Expression ReturnMemberTracker(Type type, MemberTracker memberTracker, bool privateBinding) {
+        private static DynamicMetaObject ReturnMemberTracker(Type type, MemberTracker memberTracker, bool privateBinding) {
             switch (memberTracker.MemberType) {
                 case TrackerTypes.TypeGroup:
-                    return AstUtils.Constant(memberTracker);
+                    return new DynamicMetaObject(AstUtils.Constant(memberTracker), BindingRestrictions.Empty, memberTracker);
                 case TrackerTypes.Type:
                     return ReturnTypeTracker((TypeTracker)memberTracker);
                 case TrackerTypes.Bound:
-                    return ReturnBoundTracker((BoundMemberTracker)memberTracker, privateBinding);
+                    return new DynamicMetaObject(ReturnBoundTracker((BoundMemberTracker)memberTracker, privateBinding), BindingRestrictions.Empty);
                 case TrackerTypes.Property:
-                    return ReturnPropertyTracker((PropertyTracker)memberTracker, privateBinding);
+                    return new DynamicMetaObject(ReturnPropertyTracker((PropertyTracker)memberTracker, privateBinding), BindingRestrictions.Empty);;
                 case TrackerTypes.Event:
-                    return Ast.Call(
+                    return new DynamicMetaObject(Ast.Call(
                         typeof(PythonOps).GetMethod(&quot;MakeBoundEvent&quot;),
                         AstUtils.Constant(PythonTypeOps.GetReflectedEvent((EventTracker)memberTracker)),
                         AstUtils.Constant(null),
                         AstUtils.Constant(type)
-                    );
+                    ), BindingRestrictions.Empty);;
                 case TrackerTypes.Field:
-                    return ReturnFieldTracker((FieldTracker)memberTracker);
+                    return new DynamicMetaObject(ReturnFieldTracker((FieldTracker)memberTracker), BindingRestrictions.Empty);;
                 case TrackerTypes.MethodGroup:
-                    return ReturnMethodGroup((MethodGroup)memberTracker);
+                    return new DynamicMetaObject(ReturnMethodGroup((MethodGroup)memberTracker), BindingRestrictions.Empty); ;
                 case TrackerTypes.Constructor:
                     MethodBase[] ctors = CompilerHelpers.GetConstructors(type, privateBinding, true);
                     object val;
@@ -448,9 +430,13 @@ namespace IronPython.Runtime.Binding {
                         val = PythonTypeOps.GetConstructor(type, InstanceOps.NonDefaultNewInst, ctors);
                     }
 
-                    return AstUtils.Constant(val);
+                    return new DynamicMetaObject(AstUtils.Constant(val), BindingRestrictions.Empty, val);
                 case TrackerTypes.Custom:
-                    return AstUtils.Constant(((PythonCustomTracker)memberTracker).GetSlot(), typeof(PythonTypeSlot));
+                    return new DynamicMetaObject(
+                        AstUtils.Constant(((PythonCustomTracker)memberTracker).GetSlot(), typeof(PythonTypeSlot)),
+                        BindingRestrictions.Empty,
+                        ((PythonCustomTracker)memberTracker).GetSlot()
+                    );
             }
             return null;
         }
@@ -621,13 +607,13 @@ namespace IronPython.Runtime.Binding {
                     return Ast.New(
                         typeof(ReflectedIndexer).GetConstructor(new Type[] { typeof(ReflectedIndexer), typeof(object) }),
                         AstUtils.Constant(new ReflectedIndexer(((ReflectedPropertyTracker)pt).Property, NameType.Property, privateBinding)),
-                        boundMemberTracker.Instance
+                        boundMemberTracker.Instance.Expression
                     );
                 case TrackerTypes.Event:
                     return Ast.Call(
                         typeof(PythonOps).GetMethod(&quot;MakeBoundEvent&quot;),
                         AstUtils.Constant(PythonTypeOps.GetReflectedEvent((EventTracker)boundMemberTracker.BoundTo)),
-                        boundMemberTracker.Instance,
+                        boundMemberTracker.Instance.Expression,
                         AstUtils.Constant(boundMemberTracker.DeclaringType)
                     );
                 case TrackerTypes.MethodGroup:
@@ -635,7 +621,7 @@ namespace IronPython.Runtime.Binding {
                         typeof(PythonOps).GetMethod(&quot;MakeBoundBuiltinFunction&quot;),
                         AstUtils.Constant(GetBuiltinFunction((MethodGroup)boundTo)),
                         AstUtils.Convert(
-                            boundMemberTracker.Instance,
+                            boundMemberTracker.Instance.Expression,
                             typeof(object)
                         )
                     );
@@ -662,9 +648,10 @@ namespace IronPython.Runtime.Binding {
             return AstUtils.Constant(PythonTypeOps.GetReflectedProperty(propertyTracker, null, privateBinding));
         }
 
-        private static Expression ReturnTypeTracker(TypeTracker memberTracker) {
+        private static DynamicMetaObject ReturnTypeTracker(TypeTracker memberTracker) {
             // all non-group types get exposed as PythonType's
-            return AstUtils.Constant(DynamicHelpers.GetPythonTypeFromType(memberTracker.Type));
+            object value = DynamicHelpers.GetPythonTypeFromType(memberTracker.Type);
+            return new DynamicMetaObject(Ast.Constant(value), BindingRestrictions.Empty, value);
         }
 
         internal ScriptDomainManager/*!*/ DomainManager {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,7 @@ namespace IronPython.Runtime.Binding {
                 return Defer(self);
             }
 
-            return Context.Binder.DeleteMember(Name, self, AstUtils.Constant(Context.SharedContext));
+            return Context.Binder.DeleteMember(Name, self, new PythonOverloadResolverFactory(_context.Binder, AstUtils.Constant(Context.SharedContext)));
         }
 
         public PythonContext/*!*/ Context {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonDeleteMemberBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -520,13 +520,14 @@ namespace IronPython.Runtime.Binding {
 
         public DynamicMetaObject/*!*/ Fallback(DynamicMetaObject/*!*/ self, DynamicMetaObject/*!*/ codeContext) {
             // Python always provides an extra arg to GetMember to flow the context.
-            return FallbackWorker(self, codeContext, Name, _options, this, null);
+            return FallbackWorker(_context, self, codeContext, Name, _options, this, null);
         }
 
-        internal static DynamicMetaObject FallbackWorker(DynamicMetaObject/*!*/ self, DynamicMetaObject/*!*/ codeContext, string name, GetMemberOptions options, DynamicMetaObjectBinder action, DynamicMetaObject errorSuggestion) {
+        internal static DynamicMetaObject FallbackWorker(PythonContext context, DynamicMetaObject/*!*/ self, DynamicMetaObject/*!*/ codeContext, string name, GetMemberOptions options, DynamicMetaObjectBinder action, DynamicMetaObject errorSuggestion) {
             if (self.NeedsDeferral()) {
                 return action.Defer(self);
             }
+            PythonOverloadResolverFactory resolverFactory = new PythonOverloadResolverFactory(context.Binder, codeContext.Expression);
 
             PerfTrack.NoteEvent(PerfTrack.Categories.BindingTarget, &quot;FallbackGet&quot;);
 
@@ -544,7 +545,7 @@ namespace IronPython.Runtime.Binding {
                     DynamicMetaObject baseRes = PythonContext.GetPythonContext(action).Binder.GetMember(
                         name,
                         self,
-                        codeContext.Expression,
+                        resolverFactory,
                         isNoThrow,
                         errorSuggestion
                     );
@@ -581,11 +582,11 @@ namespace IronPython.Runtime.Binding {
                 }
             }
 
-            var res = PythonContext.GetPythonContext(action).Binder.GetMember(name, self, codeContext.Expression, isNoThrow, errorSuggestion);
+            var res = PythonContext.GetPythonContext(action).Binder.GetMember(name, self, resolverFactory, isNoThrow, errorSuggestion);
 
             // Default binder can return something typed to boolean or int.
             // If that happens, we need to apply Python's boxing rules.
-            if (res.Expression.Type == typeof(bool) || res.Expression.Type == typeof(int)) {
+            if (res.Expression.Type.IsValueType) {
                 res = new DynamicMetaObject(
                     AstUtils.Convert(res.Expression, typeof(object)),
                     res.Restrictions
@@ -605,7 +606,7 @@ namespace IronPython.Runtime.Binding {
                         name
                     ),
                     typeof(object)
-                );
+                ).Expression;
         }
 
         public string Name {
@@ -660,16 +661,16 @@ namespace IronPython.Runtime.Binding {
     }
 
     class CompatibilityGetMember : GetMemberBinder, IPythonSite {
-        private readonly PythonContext/*!*/ _state;
+        private readonly PythonContext/*!*/ _context;
 
-        public CompatibilityGetMember(PythonContext/*!*/ binder, string/*!*/ name)
+        public CompatibilityGetMember(PythonContext/*!*/ context, string/*!*/ name)
             : base(name, false) {
-            _state = binder;
+            _context = context;
         }
 
-        public CompatibilityGetMember(PythonContext/*!*/ binder, string/*!*/ name, bool ignoreCase)
+        public CompatibilityGetMember(PythonContext/*!*/ context, string/*!*/ name, bool ignoreCase)
             : base(name, ignoreCase) {
-            _state = binder;
+            _context = context;
         }
 
         public override DynamicMetaObject FallbackGetMember(DynamicMetaObject self, DynamicMetaObject errorSuggestion) {
@@ -679,19 +680,19 @@ namespace IronPython.Runtime.Binding {
                 return com;
             }
 #endif
-            return PythonGetMemberBinder.FallbackWorker(self, PythonContext.GetCodeContextMOCls(this), Name, GetMemberOptions.None, this, errorSuggestion);
+            return PythonGetMemberBinder.FallbackWorker(_context, self, PythonContext.GetCodeContextMOCls(this), Name, GetMemberOptions.None, this, errorSuggestion);
         }
 
         #region IPythonSite Members
 
         public PythonContext Context {
-            get { return _state; }
+            get { return _context; }
         }
 
         #endregion
 
         public override int GetHashCode() {
-            return base.GetHashCode() ^ _state.Binder.GetHashCode();
+            return base.GetHashCode() ^ _context.Binder.GetHashCode();
         }
 
         public override bool Equals(object obj) {
@@ -700,7 +701,7 @@ namespace IronPython.Runtime.Binding {
                 return false;
             }
 
-            return ob._state.Binder == _state.Binder &amp;&amp;
+            return ob._context.Binder == _context.Binder &amp;&amp;
                 base.Equals(obj);
         }
     }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonGetMemberBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -29,7 +29,7 @@ using System.Collections;
 namespace IronPython.Runtime.Binding {
     internal sealed class PythonOverloadResolverFactory : OverloadResolverFactory {
         private readonly PythonBinder/*!*/ _binder;
-        private readonly Expression/*!*/ _codeContext;
+        internal readonly Expression/*!*/ _codeContext;
 
         public PythonOverloadResolverFactory(PythonBinder/*!*/ binder, Expression/*!*/ codeContext) {
             Assert.NotNull(binder, codeContext);
@@ -137,7 +137,7 @@ namespace IronPython.Runtime.Binding {
         }
 
         public override Expression Convert(DynamicMetaObject metaObject, Type restrictedType, ParameterInfo info, Type toType) {
-            return Binder.ConvertExpression(metaObject.Expression, toType, ConversionResultKind.ExplicitCast, _context);
+            return Binder.ConvertExpression(metaObject.Expression, toType, ConversionResultKind.ExplicitCast, new PythonOverloadResolverFactory(Binder, _context));
         }
 
         public override Expression GetDynamicConversion(Expression value, Type type) {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonOverloadResolver.cs</filename>
    </modified>
    <modified>
      <diff>@@ -637,50 +637,6 @@ namespace IronPython.Runtime.Binding {
             );
         }
 
-        private static DynamicMetaObject/*!*/ MakeMemberNamesOperation(PythonOperationBinder/*!*/ operation, DynamicMetaObject[] args) {
-            DynamicMetaObject self = args[0];
-            CodeContext context;
-            if (args.Length &gt; 1 &amp;&amp; args[0].GetLimitType() == typeof(CodeContext)) {
-                self = args[1];
-                context = (CodeContext)args[0].Value;
-            } else {
-                context = PythonContext.GetPythonContext(operation).SharedContext;
-            }
-
-            if (typeof(IMembersList).IsAssignableFrom(self.GetLimitType())) {
-                return MakeIMembersListRule(PythonContext.GetCodeContext(operation), self);
-            }
-
-            PythonType pt = DynamicHelpers.GetPythonType(self.Value);
-            List&lt;string&gt; strNames = GetMemberNames(context, pt, self.Value);
-
-            if (pt.IsSystemType) {
-                return new DynamicMetaObject(
-                    AstUtils.Constant(strNames),
-                    BindingRestrictions.GetInstanceRestriction(self.Expression, self.Value).Merge(self.Restrictions)
-                );
-            }
-
-            return new DynamicMetaObject(
-                AstUtils.Constant(strNames),
-                BindingRestrictions.GetInstanceRestriction(self.Expression, self.Value).Merge(self.Restrictions)
-            );
-        }
-
-        private static DynamicMetaObject MakeIMembersListRule(Expression codeContext, DynamicMetaObject target) {
-            return new DynamicMetaObject(
-                Ast.Call(
-                    typeof(BinderOps).GetMethod(&quot;GetStringMembers&quot;),
-                    Ast.Call(
-                        AstUtils.Convert(target.Expression, typeof(IMembersList)),
-                        typeof(IMembersList).GetMethod(&quot;GetMemberNames&quot;),
-                        codeContext
-                    )
-                ),
-                BindingRestrictionsHelpers.GetRuntimeTypeRestriction(target.Expression, target.GetLimitType()).Merge(target.Restrictions)
-            );
-        }
-
         internal static DynamicMetaObject/*!*/ MakeCallSignatureOperation(DynamicMetaObject/*!*/ self, IList&lt;MethodBase/*!*/&gt;/*!*/ targets) {
             List&lt;string&gt; arrres = new List&lt;string&gt;();
             foreach (MethodBase mb in targets) {
@@ -1783,10 +1739,14 @@ namespace IronPython.Runtime.Binding {
                 _slot.MakeGetExpression(
                     Binder,
                     AstUtils.Constant(PythonContext.SharedContext),
-                    args[0].Expression,
-                    Ast.Call(
-                        typeof(DynamicHelpers).GetMethod(&quot;GetPythonType&quot;),
-                        AstUtils.Convert(args[0].Expression, typeof(object))
+                    args[0],
+                    new DynamicMetaObject(
+                        Ast.Call(
+                            typeof(DynamicHelpers).GetMethod(&quot;GetPythonType&quot;),
+                            AstUtils.Convert(args[0].Expression, typeof(object))
+                        ),
+                        BindingRestrictions.Empty,
+                        DynamicHelpers.GetPythonType(args[0].Value)
                     ),
                     cb
                 );</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonProtocol.Operations.cs</filename>
    </modified>
    <modified>
      <diff>@@ -145,7 +145,7 @@ namespace IronPython.Runtime.Binding {
                 callSlot.MakeGetExpression(
                     pyContext.Binder,
                     PythonContext.GetCodeContext(call),
-                    self.Expression,
+                    self,
                     GetPythonType(self),
                     cb
                 );
@@ -187,17 +187,25 @@ namespace IronPython.Runtime.Binding {
             return null;
         }
 
-        private static Expression/*!*/ GetPythonType(DynamicMetaObject/*!*/ self) {
+        private static DynamicMetaObject/*!*/ GetPythonType(DynamicMetaObject/*!*/ self) {
             Assert.NotNull(self);
 
             PythonType pt = DynamicHelpers.GetPythonType(self.Value);
             if (pt.IsSystemType) {
-                return AstUtils.Constant(pt);
+                return new DynamicMetaObject(
+                    AstUtils.Constant(pt),
+                    BindingRestrictions.Empty,
+                    pt
+                );
             }
 
-            return Ast.Property(
-                Ast.Convert(self.Expression, typeof(IPythonObject)),
-                TypeInfo._IPythonObject.PythonType
+            return new DynamicMetaObject(
+                Ast.Property(
+                    Ast.Convert(self.Expression, typeof(IPythonObject)),
+                    TypeInfo._IPythonObject.PythonType
+                ),
+                BindingRestrictions.Empty,
+                pt
             );
         }
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonProtocol.cs</filename>
    </modified>
    <modified>
      <diff>@@ -51,7 +51,7 @@ namespace IronPython.Runtime.Binding {
                 return com;
             }
 #endif
-            return Context.Binder.SetMember(Name, self, value, AstUtils.Constant(Context.SharedContext));
+            return Context.Binder.SetMember(Name, self, value, new PythonOverloadResolverFactory(_context.Binder, AstUtils.Constant(Context.SharedContext)));
         }
 
         public override T BindDelegate&lt;T&gt;(CallSite&lt;T&gt; site, object[] args) {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Binding/PythonSetMemberBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -659,7 +659,7 @@ namespace IronPython.Runtime {
             );
         }
 
-        public virtual string/*!*/ __repr__(Microsoft.Scripting.Runtime.CodeContext context) {
+        public virtual string/*!*/ __repr__(CodeContext context) {
             return _bytes.BytesRepr();
         }
         </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Bytes.cs</filename>
    </modified>
    <modified>
      <diff>@@ -360,7 +360,7 @@ the assembly object.&quot;)]
 
         private static void PublishTypeLibDesc(CodeContext context, ComTypeLibDesc typeLibDesc) {
             SymbolId symbol = SymbolTable.StringToId(typeLibDesc.Name);
-            context.LanguageContext.DomainManager.Globals.SetName(symbol, typeLibDesc);
+            context.LanguageContext.DomainManager.Globals.SetVariable(symbol, typeLibDesc);
         }
 #endif
         private static void AddReferenceByName(CodeContext/*!*/ context, string name) {
@@ -438,13 +438,14 @@ import Namespace.&quot;)]
             string path = System.IO.Path.GetDirectoryName(file);
             List list;
 
-            if (!PythonContext.GetContext(context).TryGetSystemPath(out list)) {
+            PythonContext pc = PythonContext.GetContext(context);
+            if (!pc.TryGetSystemPath(out list)) {
                 throw PythonOps.TypeError(&quot;cannot update path, it is not a list&quot;);
             }
 
             list.append(path);
 
-            Assembly asm = DefaultContext.Default.LanguageContext.LoadAssemblyFromFile(file);
+            Assembly asm = pc.LoadAssemblyFromFile(file);
             if (asm == null) throw PythonOps.IOError(&quot;file does not exist: {0}&quot;, file);
             AddReference(context, asm);
         }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/ClrModule.cs</filename>
    </modified>
    <modified>
      <diff>@@ -149,7 +149,7 @@ namespace IronPython.Runtime {
         }
 
         [SpecialName, PropertyMethod, WrapperDescriptor]
-        public static void Set__doc__(PythonProperty self) {
+        public static void Set__doc__(PythonProperty self, object value) {
             throw PythonOps.TypeError(&quot;'property' object is immutable&quot;);
         }
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Descriptors.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1104,7 +1104,7 @@ for k, v in toError.iteritems():
         /// &lt;/summary&gt;
         [PythonHidden]
         public static PythonType CreateSubType(PythonContext/*!*/ context, PythonType baseType, string name, string module, string documentation) {
-            PythonType res = new PythonType(null, baseType, name, module, documentation);
+            PythonType res = new PythonType(context, baseType, name, module, documentation);
             res.SetCustomMember(context.SharedContext, Symbols.WeakRef, new PythonTypeWeakRefSlot(res));
             res.IsWeakReferencable = true;
             return res;</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Exceptions/PythonExceptions.cs</filename>
    </modified>
    <modified>
      <diff>@@ -98,11 +98,11 @@ namespace IronPython.Runtime.Exceptions {
         }
 
         internal TraceBackFrame(PythonTracebackListener traceAdapter, object code, TraceBackFrame back, PythonDebuggingPayload debugProperties, Func&lt;Scope&gt; scopeCallback) {
-            this._traceAdapter = traceAdapter;
-            this._code = code;
-            this._back = back;
-            this._debugProperties = debugProperties;
-            this._scopeCallback = scopeCallback;
+            _traceAdapter = traceAdapter;
+            _code = code;
+            _back = back;
+            _debugProperties = debugProperties;
+            _scopeCallback = scopeCallback;
         }
         
         public TracebackDelegate f_trace {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Exceptions/TraceBack.cs</filename>
    </modified>
    <modified>
      <diff>@@ -44,9 +44,9 @@ namespace IronPython.Runtime {
         public static void PerformModuleReload(PythonContext context, IAttributesCollection dict) {
             Scope scope = Importer.ImportModule(context.SharedContext, context.SharedContext.GlobalScope.Dict, &quot;itertools&quot;, false, -1) as Scope;
             if (scope != null) {
-                dict[SymbolTable.StringToId(&quot;map&quot;)] = scope.LookupName(context, SymbolTable.StringToId(&quot;imap&quot;));
-                dict[SymbolTable.StringToId(&quot;filter&quot;)] = scope.LookupName(context, SymbolTable.StringToId(&quot;ifilter&quot;));
-                dict[SymbolTable.StringToId(&quot;zip&quot;)] = scope.LookupName(context, SymbolTable.StringToId(&quot;izip&quot;));
+                dict[SymbolTable.StringToId(&quot;map&quot;)] = scope.GetVariable(SymbolTable.StringToId(&quot;imap&quot;));
+                dict[SymbolTable.StringToId(&quot;filter&quot;)] = scope.GetVariable(SymbolTable.StringToId(&quot;ifilter&quot;));
+                dict[SymbolTable.StringToId(&quot;zip&quot;)] = scope.GetVariable(SymbolTable.StringToId(&quot;izip&quot;));
             }
         }
         </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/FutureBuiltins.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ using Microsoft.Scripting.Runtime;
 namespace IronPython.Runtime {
     internal class GlobalScopeDictionaryStorage : ScopeDictionaryStorage {
         public GlobalScopeDictionaryStorage(Scope scope)
-            : base(scope.ModuleScope) {
+            : base(CodeContext.GetModuleScope(scope)) {
 
         }
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/GlobalScopeDictionaryStorage.cs</filename>
    </modified>
    <modified>
      <diff>@@ -102,13 +102,13 @@ namespace IronPython.Runtime {
                 NamespaceTracker nt;
                 if (scope != null) {
                     object ret;
-                    if (scope.TryGetName(SymbolTable.StringToId(name), out ret)) {
+                    if (scope.TryGetVariable(SymbolTable.StringToId(name), out ret)) {
                         return ret;
                     }
 
                     object path;
                     List listPath;
-                    if (scope.TryGetName(Symbols.Path, out path) &amp;&amp; (listPath = path as List) != null) {
+                    if (scope.TryGetVariable(Symbols.Path, out path) &amp;&amp; (listPath = path as List) != null) {
                         return ImportNestedModule(context, scope, name, listPath);
                     }
                 } else if ((pt = from as PythonType) != null) {
@@ -141,7 +141,7 @@ namespace IronPython.Runtime {
             if (scope != null) {
                 object path;
                 List listPath;
-                if (scope.TryGetName(Symbols.Path, out path) &amp;&amp; (listPath = path as List) != null) {
+                if (scope.TryGetVariable(Symbols.Path, out path) &amp;&amp; (listPath = path as List) != null) {
                     return ImportNestedModule(context, scope, name, listPath);
                 }
             }
@@ -209,7 +209,7 @@ namespace IronPython.Runtime {
                     if (!TryGetExistingOrMetaPathModule(context, name, path, out newmod)) {
                         newmod = ImportFromPath(context, parts[0], name, path);
                         if (newmod != null &amp;&amp; parentScope != null) {
-                            parentScope.SetName(SymbolTable.StringToId(modName), newmod);
+                            parentScope.SetVariable(SymbolTable.StringToId(modName), newmod);
                         }
                     } else if (parts.Length == 1) {
                         // if we imported before having the assembly
@@ -229,8 +229,8 @@ namespace IronPython.Runtime {
                     object parentPkg;
                     if (package != null &amp;&amp; !PythonContext.GetContext(context).SystemStateModules.TryGetValue(package, out parentPkg)) {
                         Scope warnScope = new Scope();
-                        warnScope.SetName(Symbols.File, package);
-                        warnScope.SetName(Symbols.Name, package);
+                        warnScope.SetVariable(Symbols.File, package);
+                        warnScope.SetVariable(Symbols.Name, package);
                         PythonOps.Warn(
                             new CodeContext(warnScope, context.LanguageContext), 
                             PythonExceptions.RuntimeWarning, 
@@ -462,7 +462,7 @@ namespace IronPython.Runtime {
                 if (parentScope != null) {
                     object objPath;
                     // get its path as a List if it's there
-                    if (parentScope.TryGetName(Symbols.Path, out objPath)) {
+                    if (parentScope.TryGetVariable(Symbols.Path, out objPath)) {
                         path = objPath as List;
                     }
                 }
@@ -591,7 +591,7 @@ namespace IronPython.Runtime {
         private static bool TryGetNestedModule(CodeContext/*!*/ context, Scope/*!*/ scope, string/*!*/ name, out object nested) {
             Assert.NotNull(context, scope, name);
 
-            if (scope.TryGetName(SymbolTable.StringToId(name), out nested)) {
+            if (scope.TryGetVariable(SymbolTable.StringToId(name), out nested)) {
                 if (nested is Scope) return true;
 
                 // This allows from System.Math import *
@@ -611,7 +611,7 @@ namespace IronPython.Runtime {
             string fullName = CreateFullName(module.GetName() as string, name);
 
             if (TryGetExistingOrMetaPathModule(context, fullName, path, out ret)) {
-                module.Scope.SetName(SymbolTable.StringToId(name), ret);
+                module.Scope.SetVariable(SymbolTable.StringToId(name), ret);
                 return ret;
             }
 
@@ -619,7 +619,7 @@ namespace IronPython.Runtime {
 
             object importedScope = ImportFromPath(context, name, fullName, path);
             if (importedScope != null) {
-                module.Scope.SetName(SymbolTable.StringToId(name), importedScope);
+                module.Scope.SetVariable(SymbolTable.StringToId(name), importedScope);
                 return importedScope;
             }
 
@@ -628,12 +628,12 @@ namespace IronPython.Runtime {
 
         private static object FindImportFunction(CodeContext/*!*/ context) {
             object builtin, import;
-            if (!context.GlobalScope.TryGetName(Symbols.Builtins, out builtin)) {
+            if (!context.GlobalScope.TryGetVariable(Symbols.Builtins, out builtin)) {
                 builtin = PythonContext.GetContext(context).BuiltinModuleInstance;
             }
 
             Scope scope = builtin as Scope;
-            if (scope != null &amp;&amp; scope.TryGetName(Symbols.Import, out import)) {
+            if (scope != null &amp;&amp; scope.TryGetVariable(Symbols.Import, out import)) {
                 return import;
             }
 
@@ -669,7 +669,7 @@ namespace IronPython.Runtime {
         private static object ImportReflected(CodeContext/*!*/ context, string/*!*/ name) {
             object ret;
             PythonContext pc = PythonContext.GetContext(context);
-            if (!pc.DomainManager.Globals.TryGetName(SymbolTable.StringToId(name), out ret)) {
+            if (!pc.DomainManager.Globals.TryGetVariable(SymbolTable.StringToId(name), out ret)) {
                 ret = TryImportSourceFile(pc, name);
             }
 
@@ -713,7 +713,7 @@ namespace IronPython.Runtime {
                 // foreign language, we should publish in sys.modules too
                 context.SystemStateModules[name] = scope;
             }
-            sourceUnit.LanguageContext.DomainManager.Globals.SetName(SymbolTable.StringToId(name), scope);
+            sourceUnit.LanguageContext.DomainManager.Globals.SetVariable(SymbolTable.StringToId(name), scope);
             return scope;
         }
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Importer.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,7 @@
  *
  * ***************************************************************************/
 
+using System.Collections.Generic;
 using Microsoft.Scripting.Runtime;
 
 namespace IronPython.Runtime {
@@ -53,4 +54,18 @@ namespace IronPython.Runtime {
     public interface IProxyObject {
         object Target { get; }
     }
+
+    /// &lt;summary&gt;
+    /// Provides a list of all the members of an instance.  ie. all the keys in the 
+    /// dictionary of the object. Note that it can contain objects that are not strings. 
+    /// 
+    /// Such keys can be added in IronPython using syntax like:
+    ///     obj.__dict__[100] = someOtherObject
+    ///     
+    /// This Python specific version also supports filtering based upon the show cls 
+    /// flag by flowing in the code context.
+    /// &lt;/summary&gt;
+    public interface IPythonMembersList : IMembersList {
+        IList&lt;object&gt; GetMemberNames(CodeContext context);
+    }
 }
\ No newline at end of file</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Interfaces.cs</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ using IronPython.Runtime.Types;
 namespace IronPython.Runtime {
 
     [PythonType(&quot;instancemethod&quot;), DontMapGetMemberNamesToDir]
-    public sealed partial class Method : PythonTypeSlot, IWeakReferenceable, IMembersList, IDynamicMetaObjectProvider, ICodeFormattable {
+    public sealed partial class Method : PythonTypeSlot, IWeakReferenceable, IPythonMembersList, IDynamicMetaObjectProvider, ICodeFormattable {
         private readonly object _func;
         private readonly object _inst;
         private readonly object _declaringClass;
@@ -204,7 +204,11 @@ namespace IronPython.Runtime {
             TypeCache.Method.DeleteMember(context, this, SymbolTable.StringToId(name));
         }
 
-        IList&lt;object&gt; IMembersList.GetMemberNames(CodeContext context) {
+        IList&lt;string&gt; IMembersList.GetMemberNames() {
+            return PythonOps.GetStringMemberList(this);
+        }
+
+        IList&lt;object&gt; IPythonMembersList.GetMemberNames(CodeContext/*!*/ context) {
             List ret = TypeCache.Method.GetMemberNames(context);
 
             ret.AddNoLockNoDups(SymbolTable.IdToString(Symbols.Module));</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Method.cs</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,7 @@ namespace IronPython.Runtime {
                 if (pc.SystemStateModules.TryGetValue(_parentName, out parent)) {
                     Scope s = parent as Scope;
                     if (s != null) {
-                        s.SetName(SymbolTable.StringToId(_name), res);
+                        s.SetVariable(SymbolTable.StringToId(_name), res);
                     }
                 }
             }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/ModuleLoader.cs</filename>
    </modified>
    <modified>
      <diff>@@ -501,7 +501,7 @@ namespace IronPython.Runtime.Operations {
             PythonTuple data = ClrModule.Serialize(self);
 
             object deserializeNew;
-            bool res = PythonContext.GetContext(context).ClrModule.TryGetName(
+            bool res = PythonContext.GetContext(context).ClrModule.TryGetVariable(
                 SymbolTable.StringToId(&quot;Deserialize&quot;),
                 out deserializeNew
             );</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Operations/InstanceOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1006,10 +1006,25 @@ namespace IronPython.Runtime.Operations {
             throw PythonOps.AttributeErrorForMissingAttribute(PythonTypeOps.GetName(o), name);
         }
 
+        internal static IList&lt;string&gt; GetStringMemberList(IPythonMembersList pyMemList) {
+            List&lt;string&gt; res = new List&lt;string&gt;();
+            foreach (object o in pyMemList.GetMemberNames(DefaultContext.Default)) {
+                if (o is string) {
+                    res.Add((string)o);
+                }
+            }
+            return res;
+        }
+
         public static IList&lt;object&gt; GetAttrNames(CodeContext/*!*/ context, object o) {
+            IPythonMembersList pyMemList = o as IPythonMembersList;
+            if (pyMemList != null) {
+                return pyMemList.GetMemberNames(context);
+            }
+
             IMembersList memList = o as IMembersList;
             if (memList != null) {
-                return memList.GetMemberNames(context);
+                return new List(memList.GetMemberNames());
             }
 
             IPythonObject po = o as IPythonObject;
@@ -1220,7 +1235,7 @@ namespace IronPython.Runtime.Operations {
             }
 
             // Otherwise, if there's a global variable named __metaclass__, it is used.
-            if (context.GlobalScope.TryLookupName(Symbols.MetaClass, out ret) &amp;&amp; ret != null) {
+            if (context.GlobalScope.TryGetVariable(Symbols.MetaClass, out ret) &amp;&amp; ret != null) {
                 return ret;
             }
 
@@ -1661,22 +1676,22 @@ namespace IronPython.Runtime.Operations {
 
                 // we special case several types to avoid one-off code gen of dynamic sites                
                 if (scope != null) {
-                    context.Scope.SetName(fieldId, scope.Dict[fieldId]);
+                    context.Scope.SetVariable(fieldId, scope.Dict[fieldId]);
                 } else if (nt != null) {
                     object value = NamespaceTrackerOps.GetCustomMember(context, nt, name);
                     if (value != OperationFailed.Value) {
-                        context.Scope.SetName(fieldId, value);
+                        context.Scope.SetVariable(fieldId, value);
                     }
                 } else if (pt != null) {
                     PythonTypeSlot pts;
                     object value;
                     if (pt.TryResolveSlot(context, fieldId, out pts) &amp;&amp;
                         pts.TryGetValue(context, null, pt, out value)) {
-                        context.Scope.SetName(fieldId, value);
+                        context.Scope.SetVariable(fieldId, value);
                     }
                 } else {
                     // not a known type, we'll do use a site to do the get...
-                    context.Scope.SetName(fieldId, PythonOps.GetBoundAttr(context, newmod, fieldId));
+                    context.Scope.SetVariable(fieldId, PythonOps.GetBoundAttr(context, newmod, fieldId));
                 }
             }
         }
@@ -2004,8 +2019,12 @@ namespace IronPython.Runtime.Operations {
                     // dynamic method, strip the trailing id...
                     name = name.Substring(0, name.IndexOf('#'));
                 }
-                CodeContext context = frame.CodeContext;
-                if (context == null) {
+
+                PythonDynamicStackFrame pyFrame = frame as PythonDynamicStackFrame;
+                CodeContext context;
+                if (pyFrame != null) {
+                    context = pyFrame.CodeContext;
+                } else {
                     context = DefaultContext.Default;
                 }
 
@@ -3038,7 +3057,7 @@ namespace IronPython.Runtime.Operations {
         [NoSideEffects]
         public static object CheckUninitialized(object value, SymbolId name) {
             if (value == Uninitialized.Instance) {
-                ScriptingRuntimeHelpers.ThrowUnboundLocalError(name);
+                throw new UnboundLocalException(String.Format(&quot;Local variable '{0}' referenced before assignment.&quot;, SymbolTable.IdToString(name)));
             }
             return value;
         }
@@ -3208,7 +3227,7 @@ namespace IronPython.Runtime.Operations {
         }
 
         public static void ModuleStarted(CodeContext/*!*/ context, PythonLanguageFeatures features) {
-            PythonModule scopeExtension = (PythonModule)context.LanguageContext.EnsureScopeExtension(context.Scope.ModuleScope);
+            PythonModule scopeExtension = (PythonModule)context.LanguageContext.EnsureScopeExtension(context.GlobalScope);
             scopeExtension.LanguageFeatures |= features;
         }
 
@@ -3502,22 +3521,33 @@ namespace IronPython.Runtime.Operations {
         /// &lt;summary&gt;
         /// Called from generated code, helper to remove a name
         /// &lt;/summary&gt;
-        public static object RemoveName(CodeContext context, SymbolId name) {
-            return context.LanguageContext.RemoveName(context.Scope, name);
+        public static void RemoveName(CodeContext context, SymbolId name) {
+            if (!context.Scope.TryRemoveVariable(name)) {
+                throw PythonOps.NameError(name);
+            }
         }
 
         /// &lt;summary&gt;
         /// Called from generated code, helper to do name lookup
         /// &lt;/summary&gt;
         public static object LookupName(CodeContext context, SymbolId name) {
-            return context.LanguageContext.LookupName(context.Scope, name);
+            object value;
+            if (context.TryLookupName(name, out value) &amp;&amp; value != Uninitialized.Instance) {
+                return value;
+            }
+
+            if (context.TryLookupGlobal(name, out value) &amp;&amp; value != Uninitialized.Instance) {
+                return value;
+            }
+
+            throw PythonOps.NameError(name);
         }
 
         /// &lt;summary&gt;
         /// Called from generated code, helper to do name assignment
         /// &lt;/summary&gt;
         public static object SetName(CodeContext context, SymbolId name, object value) {
-            context.LanguageContext.SetName(context.Scope, name, value);
+            context.Scope.SetVariable(name, value);
             return value;
         }
 
@@ -3585,24 +3615,30 @@ namespace IronPython.Runtime.Operations {
             return generator.Context;
         }
 
-        public static object GetGlobal(Scope scope, SymbolId name) {
-            return GetVariable(scope.ModuleScope, name, true);
+        public static object GetGlobal(CodeContext/*!*/ context, SymbolId name) {
+            return GetVariable(context, name, true);
         }
 
-        public static object GetLocal(Scope scope, SymbolId name) {
-            return GetVariable(scope, name, false);
+        public static object GetLocal(CodeContext/*!*/ context, SymbolId name) {
+            return GetVariable(context, name, false);
         }
 
-        private static object GetVariable(Scope scope, SymbolId name, bool isGlobal) {
+        private static object GetVariable(CodeContext/*!*/ context, SymbolId name, bool isGlobal) {
             object res;
-            if (scope.TryLookupName(name, out res)) {
-                return res;
+            if (isGlobal) {
+                if (context.GlobalScope.TryGetVariable(name, out res)) {
+                    return res;
+                }
+            } else {
+                if (context.TryLookupName(name, out res)) {
+                    return res;
+                }
             }
 
             object builtins;
-            if (scope.ModuleScope.TryGetName(Symbols.Builtins, out builtins)) {
+            if (context.GlobalScope.TryGetVariable(Symbols.Builtins, out builtins)) {
                 Scope builtinsScope = builtins as Scope;
-                if (builtinsScope != null &amp;&amp; builtinsScope.TryGetName(name, out res)) {
+                if (builtinsScope != null &amp;&amp; builtinsScope.TryGetVariable(name, out res)) {
                     return res;
                 }
 
@@ -3618,46 +3654,51 @@ namespace IronPython.Runtime.Operations {
             throw NameError(name);
         }
 
-        public static object RawGetGlobal(Scope scope, SymbolId name) {
-            return RawGetLocal(scope.ModuleScope, name);
+        public static object RawGetGlobal(CodeContext/*!*/ context, SymbolId name) {
+            object res;
+            if (context.GlobalScope.TryGetVariable(name, out res)) {
+                return res;
+            }
+
+            return Uninitialized.Instance;
         }
 
-        public static object RawGetLocal(Scope scope, SymbolId name) {
+        public static object RawGetLocal(CodeContext/*!*/ context, SymbolId name) {
             object res;
-            if (scope.TryLookupName(name, out res)) {
+            if (context.TryLookupName(name, out res)) {
                 return res;
             }
 
             return Uninitialized.Instance;
         }
 
-        public static void SetGlobal(Scope scope, SymbolId name, object value) {
-            scope.ModuleScope.Dict[name] = value;
+        public static void SetGlobal(CodeContext/*!*/ context, SymbolId name, object value) {
+            context.GlobalScope.Dict[name] = value;
         }
 
-        public static void SetLocal(Scope scope, SymbolId name, object value) {
-            scope.Dict[name] = value;
+        public static void SetLocal(CodeContext/*!*/ context, SymbolId name, object value) {
+            context.Scope.Dict[name] = value;
         }
 
-        public static void DeleteGlobal(Scope scope, SymbolId name) {
-            if (scope.ModuleScope.Dict.Remove(name)) {
+        public static void DeleteGlobal(CodeContext/*!*/ context, SymbolId name) {
+            if (context.GlobalScope.Dict.Remove(name)) {
                 return;
             }
 
             throw NameError(name);
         }
 
-        public static void DeleteLocal(Scope scope, SymbolId name) {
-            if (scope.Dict.Remove(name)) {
+        public static void DeleteLocal(CodeContext/*!*/ context, SymbolId name) {
+            if (context.Scope.Dict.Remove(name)) {
                 return;
             }
 
             throw NameError(name);
-
         }
+
         public static CodeContext/*!*/ CreateTopLevelCodeContext(Scope/*!*/ scope, LanguageContext/*!*/ context) {
-            context.EnsureScopeExtension(scope.ModuleScope);
-            return new CodeContext(scope, context);
+            context.EnsureScopeExtension(CodeContext.GetModuleScope(scope));
+            return new CodeContext(scope, (PythonContext)context);
         }
 
         public static PythonGlobal/*!*/[]/*!*/ GetGlobalArray(Scope/*!*/ scope) {
@@ -4062,6 +4103,20 @@ namespace IronPython.Runtime.Operations {
                 code.Parameters
             );
         }
+
+        public static void UpdateStackTrace(CodeContext context, MethodBase method, string funcName, string filename, int line) {
+            if (line != -1) {
+                Debug.Assert(filename != null);
+                if (ExceptionHelpers.DynamicStackFrames == null) {
+                    ExceptionHelpers.DynamicStackFrames = new List&lt;DynamicStackFrame&gt;();
+                }
+
+                Debug.Assert(line != SourceLocation.None.Line);
+
+                ExceptionHelpers.DynamicStackFrames.Add(new PythonDynamicStackFrame(context, method, funcName, filename, line));
+            }
+        }
+
     }
 
     public struct FunctionStack {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Operations/PythonOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -52,10 +52,10 @@ namespace IronPython.Runtime.Types {
         }
 
         public static void __init__(Scope/*!*/ scope, string name, string documentation) {
-            scope.SetName(Symbols.Name, name);
+            scope.SetVariable(Symbols.Name, name);
 
             if (documentation != null) {
-                scope.SetName(Symbols.Doc, documentation);
+                scope.SetVariable(Symbols.Doc, documentation);
             }
         }
 
@@ -68,7 +68,7 @@ namespace IronPython.Runtime.Types {
 
             SymbolId si = SymbolTable.StringToId(name);
             object res;
-            if (self.TryGetName(si, out res)) {
+            if (self.TryGetVariable(si, out res)) {
                 return res;
             }
 
@@ -85,7 +85,7 @@ namespace IronPython.Runtime.Types {
 
             SymbolId si = SymbolTable.StringToId(name);
             object res;
-            if (self.TryGetName(si, out res)) {
+            if (self.TryGetVariable(si, out res)) {
                 return res;
             }
 
@@ -98,12 +98,12 @@ namespace IronPython.Runtime.Types {
         }
 
         public static void __setattr__(Scope/*!*/ self, string name, object value) {
-            self.SetName(SymbolTable.StringToId(name), value);
+            self.SetVariable(SymbolTable.StringToId(name), value);
         }
 
         public static void __delattr__(Scope/*!*/ self, string name) {
             SymbolId si = SymbolTable.StringToId(name);
-            if (!self.TryRemoveName(si)) {
+            if (!self.TryRemoveVariable(si)) {
                 throw PythonOps.AttributeErrorForMissingAttribute(&quot;module&quot;, si);
             }
         }
@@ -161,7 +161,7 @@ namespace IronPython.Runtime.Types {
         [SpecialName]
         public static object GetCustomMember(CodeContext/*!*/ context, Scope/*!*/ scope, string name) {
             object value;
-            if (scope.TryGetName(SymbolTable.StringToId(name), out value)) {
+            if (scope.TryGetVariable(SymbolTable.StringToId(name), out value)) {
                 if (value != Uninitialized.Instance) {
                     return value;
                 }
@@ -174,13 +174,13 @@ namespace IronPython.Runtime.Types {
             if (name == &quot;__dict__&quot;) {
                 Set__dict__(scope, value);
             } else {
-                scope.SetName(SymbolTable.StringToId(name), value);
+                scope.SetVariable(SymbolTable.StringToId(name), value);
             }
         }
 
         [SpecialName]
         public static bool DeleteMember(CodeContext/*!*/ context, Scope/*!*/ scope, string name) {
-            return scope.TryRemoveName(SymbolTable.StringToId(name));
+            return scope.TryRemoveVariable(SymbolTable.StringToId(name));
         }
     }
 }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Operations/ScopeOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -61,6 +61,7 @@ namespace IronPython.Runtime {
         private readonly PythonOptions/*!*/ _options;
         private readonly Scope/*!*/ _systemState;
         private readonly Dictionary&lt;string, Type&gt;/*!*/ _builtinsDict;
+        private readonly PythonOverloadResolverFactory _sharedOverloadResolverFactory;
 #if !SILVERLIGHT
         private readonly AssemblyResolveHolder _resolveHolder;
 #endif
@@ -190,6 +191,7 @@ namespace IronPython.Runtime {
             Scope defaultScope = new Scope();
             _defaultContext = new CodeContext(defaultScope, this);
             PythonBinder binder = new PythonBinder(manager, this, _defaultContext);
+            _sharedOverloadResolverFactory = new PythonOverloadResolverFactory(binder, Expression.Constant(_defaultContext));
             Binder = binder;
 
             CodeContext defaultClsContext = DefaultContext.CreateDefaultCLSContext(this);
@@ -251,12 +253,17 @@ namespace IronPython.Runtime {
             if (options == null ||
                 !options.TryGetValue(&quot;NoAssemblyResolveHook&quot;, out asmResolve) ||
                 !System.Convert.ToBoolean(asmResolve)) {
-                HookAssemblyResolve();
+                try {
+                    HookAssemblyResolve();
+                } catch (System.Security.SecurityException) {
+                    // We may not have SecurityPermissionFlag.ControlAppDomain. 
+                    // If so, we will not look up sys.path for module loads
+                }
             }
 #endif
 
             _equalityComparer = new PythonEqualityComparer(this);
-
+            
             EnsureModule(_defaultContext);
         }
 
@@ -967,8 +974,8 @@ namespace IronPython.Runtime {
             }
 
             PythonModule mod = CreateModule(null, new Scope(dict), null, options);
-            mod.Scope.SetName(Symbols.Name, moduleName);
-            mod.Scope.SetName(Symbols.Package, null);
+            mod.Scope.SetVariable(Symbols.Name, moduleName);
+            mod.Scope.SetVariable(Symbols.Package, null);
             return mod;
         }
 
@@ -997,8 +1004,8 @@ namespace IronPython.Runtime {
             if ((options &amp; ModuleOptions.Initialize) != 0) {
                 scriptCode.Run(module.Scope);
                 
-                if (!scope.ContainsName(Symbols.Package)) {
-                    scope.SetName(Symbols.Package, null);
+                if (!scope.ContainsVariable(Symbols.Package)) {
+                    scope.SetVariable(Symbols.Package, null);
                 }
             }
 
@@ -1016,9 +1023,9 @@ namespace IronPython.Runtime {
             // pass the appropriate flags to control this behavior.
             if ((options &amp; ModuleOptions.NoBuiltins) == 0 &amp;&amp; !scope.Dict.ContainsKey(Symbols.Builtins)) {
                 if ((options &amp; ModuleOptions.ModuleBuiltins) != 0) {
-                    module.Scope.SetName(Symbols.Builtins, BuiltinModuleInstance);
+                    module.Scope.SetVariable(Symbols.Builtins, BuiltinModuleInstance);
                 } else {
-                    module.Scope.SetName(Symbols.Builtins, BuiltinModuleInstance.Dict);
+                    module.Scope.SetVariable(Symbols.Builtins, BuiltinModuleInstance.Dict);
                 }
             }
 
@@ -1027,7 +1034,7 @@ namespace IronPython.Runtime {
             if (fileName != null &amp;&amp; Path.GetFileName(fileName) == &quot;__init__.py&quot;) {
                 string dirname = Path.GetDirectoryName(fileName);
                 string dir_path = DomainManager.Platform.GetFullPath(dirname);
-                module.Scope.SetName(Symbols.Path, PythonOps.MakeList(dir_path));
+                module.Scope.SetVariable(Symbols.Path, PythonOps.MakeList(dir_path));
             }
 
             return module;
@@ -1049,7 +1056,7 @@ namespace IronPython.Runtime {
             }
 
             object name;
-            if (!scope.TryLookupName(Symbols.Name, out name) || !(name is string)) {
+            if (!scope.TryGetVariable(Symbols.Name, out name) || !(name is string)) {
                 throw PythonOps.SystemError(&quot;nameless module&quot;);
             }
 
@@ -1085,31 +1092,6 @@ namespace IronPython.Runtime {
             }
         }
 
-        /// &lt;summary&gt;
-        /// Python's global scope includes looking at built-ins.  First check built-ins, and if
-        /// not there then fallback to any DLR globals.
-        /// &lt;/summary&gt;
-        public override bool TryLookupGlobal(Scope scope, SymbolId name, out object value) {
-            object builtins;
-            if (!scope.ModuleScope.TryGetName(Symbols.Builtins, out builtins)) {
-                value = null;
-                return false;
-            }
-
-            Scope builtinsScope = builtins as Scope;
-            if (builtinsScope != null &amp;&amp; builtinsScope.TryGetName(name, out value)) return true;
-
-            IAttributesCollection dict = builtins as IAttributesCollection;
-            if (dict != null &amp;&amp; dict.TryGetValue(name, out value)) return true;
-
-            value = null;
-            return false;
-        }
-
-        protected override Exception MissingName(SymbolId name) {
-            throw PythonOps.NameError(name);
-        }
-
         internal ModuleGlobalCache GetModuleGlobalCache(SymbolId name) {
             ModuleGlobalCache res;
             if (!TryGetModuleGlobalCache(name, out res)) {
@@ -1121,7 +1103,7 @@ namespace IronPython.Runtime {
 
         #region Assembly Loading
 
-        public override Assembly LoadAssemblyFromFile(string file) {
+        internal Assembly LoadAssemblyFromFile(string file) {
 #if !SILVERLIGHT
             // check all files in the path...
             List path;
@@ -1165,13 +1147,9 @@ namespace IronPython.Runtime {
         /// However, when the CLR loader tries to resolve any of assembly references, it will not be able to
         /// find the dependencies, unless we can hook into the CLR loader.
         /// &lt;/summary&gt;
+        [MethodImpl(MethodImplOptions.NoInlining)]   // avoid inlining due to LinkDemand from assembly resolve.
         private void HookAssemblyResolve() {
-            try {
-                AppDomain.CurrentDomain.AssemblyResolve += _resolveHolder.AssemblyResolveEvent;
-            } catch (System.Security.SecurityException) {
-                // We may not have SecurityPermissionFlag.ControlAppDomain. 
-                // If so, we will not look up sys.path for module loads
-            }
+            AppDomain.CurrentDomain.AssemblyResolve += _resolveHolder.AssemblyResolveEvent;
         }
 
         class AssemblyResolveHolder {
@@ -1230,7 +1208,7 @@ namespace IronPython.Runtime {
 #endif
 
             try {
-                if (_systemState.TryGetName(Symbols.SysExitFunc, out callable)) {
+                if (_systemState.TryGetVariable(Symbols.SysExitFunc, out callable)) {
                     PythonCalls.Call(new CodeContext(new Scope(), this), callable);
                 }
             } finally {
@@ -1702,7 +1680,7 @@ namespace IronPython.Runtime {
                     // only cache values currently in built-ins, everything else will have
                     // no caching policy and will fall back to the LanguageContext.
                     object value;
-                    if (BuiltinModuleInstance.TryGetName(name, out value)) {
+                    if (BuiltinModuleInstance.TryGetVariable(name, out value)) {
                         _builtinCache[name] = cache = new ModuleGlobalCache(value);
                     }
                 }
@@ -2775,6 +2753,16 @@ namespace IronPython.Runtime {
         }
 
         /// &lt;summary&gt;
+        /// Returns an overload resolver for the current PythonContext.  The overload
+        /// resolver will flow the shared context through as it's CodeContext.
+        /// &lt;/summary&gt;
+        internal PythonOverloadResolverFactory SharedOverloadResolverFactory {
+            get {
+                return _sharedOverloadResolverFactory;
+            }
+        }
+
+        /// &lt;summary&gt;
         /// Returns a shared code context for the current PythonContext.  This shared
         /// context can be used for doing lookups which need to occur as if they
         /// happened in a module which has done &quot;import clr&quot;.</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/PythonContext.cs</filename>
    </modified>
    <modified>
      <diff>@@ -39,7 +39,7 @@ namespace IronPython.Runtime {
     /// Created for a user-defined function.  
     /// &lt;/summary&gt;
     [PythonType(&quot;function&quot;), DontMapGetMemberNamesToDir]
-    public sealed partial class PythonFunction : PythonTypeSlot, IWeakReferenceable, IMembersList, IDynamicMetaObjectProvider, ICodeFormattable, Binding.IFastInvokable {
+    public sealed partial class PythonFunction : PythonTypeSlot, IWeakReferenceable, IPythonMembersList, IDynamicMetaObjectProvider, ICodeFormattable, Binding.IFastInvokable {
         private readonly CodeContext/*!*/ _context;     // the creating code context of the function
         [PythonHidden]
         public readonly MutableTuple Closure;
@@ -440,7 +440,11 @@ namespace IronPython.Runtime {
             return _dict.Remove(SymbolTable.StringToId(name));
         }
 
-        IList&lt;object&gt; IMembersList.GetMemberNames(CodeContext context) {
+        IList&lt;string&gt; IMembersList.GetMemberNames() {
+            return PythonOps.GetStringMemberList(this);
+        }
+
+        IList&lt;object&gt; IPythonMembersList.GetMemberNames(CodeContext/*!*/ context) {
             List list;
             if (_dict == null) {
                 list = PythonOps.MakeList();</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/PythonFunction.cs</filename>
    </modified>
    <modified>
      <diff>@@ -157,13 +157,13 @@ namespace IronPython.Runtime {
 
         internal object GetName() {
             object result;
-            Scope.TryLookupName(Symbols.Name, out result);
+            Scope.TryGetVariable(Symbols.Name, out result);
             return result;
         }
 
         internal object GetFile() {
             object result;
-            Scope.TryLookupName(Symbols.File, out result);
+            Scope.TryGetVariable(Symbols.File, out result);
             return result;
         }
     }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/PythonModule.cs</filename>
    </modified>
    <modified>
      <diff>@@ -28,14 +28,14 @@ namespace IronPython.Runtime {
         public override void Add(object key, object value) {
             string strKey = key as string;
             if (strKey != null) {
-                Scope.SetName(SymbolTable.StringToId(strKey), value);
+                Scope.SetVariable(SymbolTable.StringToId(strKey), value);
             } else {
                 Scope.SetObjectName(key, value);
             }
         }
 
         public override void Add(SymbolId key, object value) {
-            Scope.SetName(key, value);
+            Scope.SetVariable(key, value);
         }
 
         public override bool Contains(object key) {
@@ -49,7 +49,7 @@ namespace IronPython.Runtime {
 
         public override bool Contains(SymbolId key) {
             foreach (Scope scope in GetVisibleScopes()) {
-                if (scope.ContainsName(key)) {
+                if (scope.ContainsVariable(key)) {
                     return true;
                 }
             }
@@ -60,7 +60,7 @@ namespace IronPython.Runtime {
             foreach (Scope scope in GetVisibleScopes()) {
                 string strKey = key as string;
                 if (strKey != null) {
-                    if (scope.TryRemoveName(SymbolTable.StringToId(strKey))) {
+                    if (scope.TryRemoveVariable(SymbolTable.StringToId(strKey))) {
                         return true;
                     }
                 } else if (scope.TryRemoveObjectName(key)) {
@@ -75,7 +75,7 @@ namespace IronPython.Runtime {
             foreach (Scope scope in GetVisibleScopes()) {
                 string strKey = key as string;
                 if (strKey != null) {
-                    if (scope.TryGetName(SymbolTable.StringToId(strKey), out value)) {
+                    if (scope.TryGetVariable(SymbolTable.StringToId(strKey), out value)) {
                         return true;
                     }
                 } else if (scope.TryGetObjectName(key, out value)) {
@@ -89,7 +89,7 @@ namespace IronPython.Runtime {
 
         public override bool TryGetValue(SymbolId key, out object value) {
             foreach (Scope scope in GetVisibleScopes()) {
-                if (scope.TryGetName(key, out value)) {
+                if (scope.TryGetVariable(key, out value)) {
                     return true;
                 }
             }
@@ -130,7 +130,7 @@ namespace IronPython.Runtime {
             string strKey = key as string;
             if (strKey != null) {
                 object dummy;
-                if (scope.TryGetName(SymbolTable.StringToId(strKey), out dummy)) {
+                if (scope.TryGetVariable(SymbolTable.StringToId(strKey), out dummy)) {
                     return true;
                 }
             } else {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/ScopeDictionaryStorage.cs</filename>
    </modified>
    <modified>
      <diff>@@ -329,7 +329,7 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, Expression instance, Expression/*!*/ owner, ConditionalBuilder/*!*/ builder) {
+        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, DynamicMetaObject instance, DynamicMetaObject/*!*/ owner, ConditionalBuilder/*!*/ builder) {
             builder.FinishCondition(Ast.Constant(this));
         }
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/BuiltinFunction.cs</filename>
    </modified>
    <modified>
      <diff>@@ -51,13 +51,13 @@ namespace IronPython.Runtime.Types {
             return true;
         }
 
-        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, Expression instance, Expression/*!*/ owner, ConditionalBuilder/*!*/ builder) {
+        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, DynamicMetaObject instance, DynamicMetaObject/*!*/ owner, ConditionalBuilder/*!*/ builder) {
             if (instance != null) {
                 builder.FinishCondition(
                     Ast.Call(
                         typeof(PythonOps).GetMethod(&quot;MakeBoundBuiltinFunction&quot;),
                         AstUtils.Constant(_template),
-                        instance
+                        instance.Expression
                     )
                 );
             } else {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/BuiltinMethodDescriptor.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,11 +16,16 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Linq.Expressions;
+using System.Dynamic;
 using System.Reflection;
-using IronPython.Runtime.Operations;
+
 using Microsoft.Scripting;
 using Microsoft.Scripting.Actions;
+using Microsoft.Scripting.Actions.Calls;
+
+using IronPython.Runtime.Binding;
+using IronPython.Runtime.Operations;
+
 using Ast = System.Linq.Expressions.Expression;
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 
@@ -28,52 +33,48 @@ namespace IronPython.Runtime.Types {
     public abstract class PythonCustomTracker : CustomTracker {
         public abstract PythonTypeSlot/*!*/ GetSlot();
 
-        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
-            return AstUtils.Constant(GetSlot(), typeof(PythonTypeSlot));
+        public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
+            return new DynamicMetaObject(AstUtils.Constant(GetSlot(), typeof(PythonTypeSlot)), BindingRestrictions.Empty);
         }
 
-        public override MemberTracker BindToInstance(Expression instance) {
+        public override MemberTracker BindToInstance(DynamicMetaObject instance) {
             return new BoundMemberTracker(this, instance);
         }
 
-        public override Expression SetValue(Expression context, ActionBinder binder, Type type, Expression value) {
-            return SetBoundValue(context, binder, type, value, AstUtils.Constant(null));
+        public override DynamicMetaObject SetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value) {
+            return SetBoundValue(resolverFactory, binder, type, value, new DynamicMetaObject(AstUtils.Constant(null), BindingRestrictions.Empty));
         }
 
-        protected override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
-            return Ast.Call(
-                typeof(PythonOps).GetMethod(&quot;SlotGetValue&quot;),
-                context,
-                AstUtils.Constant(GetSlot(), typeof(PythonTypeSlot)),
-                AstUtils.Convert(
-                    instance,
-                    typeof(object)
+        protected override DynamicMetaObject GetBoundValue(OverloadResolverFactory factory, ActionBinder binder, Type type, DynamicMetaObject instance) {
+            return new DynamicMetaObject(
+                Ast.Call(
+                    typeof(PythonOps).GetMethod(&quot;SlotGetValue&quot;),
+                    ((PythonOverloadResolverFactory)factory)._codeContext,
+                    AstUtils.Constant(GetSlot(), typeof(PythonTypeSlot)),
+                    AstUtils.Convert(
+                        instance.Expression,
+                        typeof(object)
+                    ),
+                    AstUtils.Constant(DynamicHelpers.GetPythonTypeFromType(type))
                 ),
-                AstUtils.Constant(DynamicHelpers.GetPythonTypeFromType(type))
+                BindingRestrictions.Empty
             );
         }
         
-        protected override Expression SetBoundValue(Expression context, ActionBinder binder, Type type, Expression value, Expression instance) {
-            return Ast.Call(
-                typeof(PythonOps).GetMethod(&quot;SlotSetValue&quot;),
-                context,
-                AstUtils.Constant(GetSlot(), typeof(PythonTypeSlot)),
-                AstUtils.Convert(
-                    instance,
-                    typeof(object)
+        protected override DynamicMetaObject SetBoundValue(OverloadResolverFactory factory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject instance) {
+            return new DynamicMetaObject(
+                Ast.Call(
+                    typeof(PythonOps).GetMethod(&quot;SlotSetValue&quot;),
+                    ((PythonOverloadResolverFactory)factory)._codeContext,
+                    AstUtils.Constant(GetSlot(), typeof(PythonTypeSlot)),
+                    AstUtils.Convert(
+                        instance.Expression,
+                        typeof(object)
+                    ),
+                    AstUtils.Constant(DynamicHelpers.GetPythonTypeFromType(type)),
+                    value.Expression
                 ),
-                AstUtils.Constant(DynamicHelpers.GetPythonTypeFromType(type)),
-                value
-            );
-        }
-
-        public Expression GetBoundPythonValue(RuleBuilder builder, ActionBinder binder, PythonType accessing) {
-            return Ast.Call(
-                typeof(PythonOps).GetMethod(&quot;SlotGetValue&quot;),
-                builder.Context,
-                AstUtils.Constant(GetSlot(), typeof(PythonTypeSlot)),
-                AstUtils.Constant(null),
-                AstUtils.Constant(accessing)
+                BindingRestrictions.Empty
             );
         }
     }
@@ -97,8 +98,8 @@ namespace IronPython.Runtime.Types {
             _slot = slot;
         }
 
-        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
-            return GetBoundValue(context, binder, type, AstUtils.Constant(null));
+        public override DynamicMetaObject GetValue(OverloadResolverFactory factory, ActionBinder binder, Type type) {
+            return GetBoundValue(factory, binder, type, new DynamicMetaObject(AstUtils.Constant(null), BindingRestrictions.Empty));
         }
 
         public override string Name {
@@ -143,8 +144,8 @@ namespace IronPython.Runtime.Types {
             );
         }
 
-        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
-            return GetBoundValue(context, binder, type, AstUtils.Constant(null));
+        public override DynamicMetaObject GetValue(OverloadResolverFactory factory, ActionBinder binder, Type type) {
+            return GetBoundValue(factory, binder, type, new DynamicMetaObject(AstUtils.Constant(null), BindingRestrictions.Empty));
         }
 
         public override Type DeclaringType {</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/CustomAttributeTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -55,7 +55,8 @@ namespace IronPython.Runtime.Types {
 #endif
  ICodeFormattable,
         IMembersList,
-        IDynamicMetaObjectProvider {
+        IDynamicMetaObjectProvider, 
+        IPythonMembersList {
 
         [NonSerialized]
         private List&lt;OldClass&gt; _bases;
@@ -77,7 +78,7 @@ namespace IronPython.Runtime.Types {
 
             if (!dict.ContainsKey(Symbols.Module)) {
                 object moduleValue;
-                if (context.GlobalScope.TryGetName(Symbols.Name, out moduleValue)) {
+                if (context.GlobalScope.TryGetVariable(Symbols.Name, out moduleValue)) {
                     dict[Symbols.Module] = moduleValue;
                 }
             }
@@ -410,7 +411,11 @@ namespace IronPython.Runtime.Types {
 
         #region IMembersList Members
 
-        IList&lt;object&gt; IMembersList.GetMemberNames(CodeContext context) {
+        IList&lt;string&gt; IMembersList.GetMemberNames() {
+            return PythonOps.GetStringMemberList(this);
+        }
+
+        IList&lt;object&gt; IPythonMembersList.GetMemberNames(CodeContext/*!*/ context) {
             PythonDictionary attrs = new PythonDictionary(_dict);
             RecurseAttrHierarchy(this, attrs);
             return PythonOps.MakeListFromSequence(attrs);</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/OldClass.cs</filename>
    </modified>
    <modified>
      <diff>@@ -40,8 +40,8 @@ namespace IronPython.Runtime.Types {
 #endif
         ISerializable,
         IWeakReferenceable,
-        IMembersList,
-        IDynamicMetaObjectProvider
+        IDynamicMetaObjectProvider, 
+        IPythonMembersList
     {
 
         private PythonDictionary _dict;
@@ -587,7 +587,11 @@ namespace IronPython.Runtime.Types {
 
         #region IMembersList Members
 
-        IList&lt;object&gt; IMembersList.GetMemberNames(CodeContext context) {
+        IList&lt;string&gt; IMembersList.GetMemberNames() {
+            return PythonOps.GetStringMemberList(this);
+        }
+
+        IList&lt;object&gt; IPythonMembersList.GetMemberNames(CodeContext/*!*/ context) {
             PythonDictionary attrs = new PythonDictionary(_dict);
             OldClass.RecurseAttrHierarchy(this._class, attrs);
             return PythonOps.MakeListFromSequence(attrs);</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/OldInstance.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-&#65279;/* ****************************************************************************
+/* ****************************************************************************
  *
  * Copyright (c) Microsoft Corporation. 
  *
@@ -15,14 +15,19 @@
 
 using System;
 using System.Collections.Generic;
-using System.Text;
+using System.Dynamic;
+using System.Linq.Expressions;
+using System.Reflection;
 using System.Runtime.CompilerServices;
+
+using Microsoft.Scripting.Actions;
 using Microsoft.Scripting.Runtime;
+using Microsoft.Scripting.Utils;
+
 using IronPython.Runtime.Binding;
-using System.Reflection;
 using IronPython.Runtime.Operations;
-using System.Linq.Expressions;
-using Microsoft.Scripting.Actions;
+
+using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace IronPython.Runtime.Types {
     public partial class PythonType {
@@ -36,11 +41,9 @@ namespace IronPython.Runtime.Types {
         /// of the same types and improved startup time due to reduced code generation.
         /// &lt;/summary&gt;
         FastBindResult&lt;T&gt; IFastInvokable.MakeInvokeBinding&lt;T&gt;(CallSite&lt;T&gt; site, PythonInvokeBinder binder, CodeContext context, object[] args) {
-            PythonTypeSlot del;
             if (IsSystemType ||                                         // limited numbers of these, just generate optimal code
                 IsMixedNewStyleOldStyle() ||                            // old-style classes shouldn't be commonly used
-                TryResolveSlot(context, Symbols.Unassign, out del) ||   // same w/ finalizers.
-                args.Length &gt; 5 ||                                     // and we only generate optimal code for a small number of calls.
+                args.Length &gt; 5 ||                                      // and we only generate optimal code for a small number of calls.
                 GetType() != typeof(PythonType)) {                      // and we don't handle meta classes yet (they could override __call__)...
                 return new FastBindResult&lt;T&gt;();
             }
@@ -102,8 +105,7 @@ namespace IronPython.Runtime.Types {
             public FastBindingBuilderBase(CodeContext context, PythonType type, PythonInvokeBinder binder, Type siteType, Type[] genTypeArgs) {
                 _context = context;
                 _type = type;
-                // binder is used for nested call sites which have 1 extra argument (the type passed to __new__, or the instance passed to __init__).
-                _binder = binder.Context.Invoke(binder.Signature.InsertArgument(Argument.Simple));
+                _binder = binder;
                 _siteType = siteType;
                 _genTypeArgs = genTypeArgs;
             }
@@ -116,24 +118,16 @@ namespace IronPython.Runtime.Types {
                 _type.TryResolveSlot(_context, Symbols.Init, out init);
 
                 Delegate newDlg;
-                Delegate initDlg;
-                if (init == InstanceOps.Init) {
-                    if (_genTypeArgs.Length &gt; 0 &amp; newInst == InstanceOps.New) {
-                        // init needs to report an error, we don't optimize for the error case.
+                
+                if (newInst == InstanceOps.New) {
+                    if (_genTypeArgs.Length &gt; 0 &amp;&amp; init == InstanceOps.Init) {
+                        // new needs to report an error, we don't optimize for the error case.
                         return null;
                     }
-                    initDlg = null;
-                } else if (init is PythonFunction) {
-                    initDlg = GetNewOrInitSiteDelegate(_binder, init);
-                } else {
-                    // odd slot in __init__, we don't handle this either.
-                    return null;
-                }
-
-                if (newInst == InstanceOps.New) {
                     newDlg = GetOrCreateFastNew();
                 } else if (newInst.GetType() == typeof(staticmethod) &amp;&amp; ((staticmethod)newInst)._func is PythonFunction) {
-                    newDlg = GetNewOrInitSiteDelegate(_binder, ((staticmethod)newInst)._func);
+                    // need an extra argument to pass the class to __new__
+                    newDlg = GetNewSiteDelegate(_binder.Context.Invoke(_binder.Signature.InsertArgument(Argument.Simple)), ((staticmethod)newInst)._func);
                 } else {
                     // odd slot in __new__, we don't handle this.
                     newDlg = null;
@@ -144,7 +138,7 @@ namespace IronPython.Runtime.Types {
                     return null;
                 }
 
-                return MakeDelegate(version, newDlg, initDlg);
+                return MakeDelegate(version, newDlg, _type.GetLateBoundInitBinder(_binder.Signature));
             }
 
             /// &lt;summary&gt;
@@ -191,8 +185,8 @@ namespace IronPython.Runtime.Types {
                 return newDlg;
             }
 
-            protected abstract Delegate GetNewOrInitSiteDelegate(PythonInvokeBinder binder, object func);
-            protected abstract Delegate MakeDelegate(int version, Delegate newDlg, Delegate initDlg);
+            protected abstract Delegate GetNewSiteDelegate(PythonInvokeBinder binder, object func);
+            protected abstract Delegate MakeDelegate(int version, Delegate newDlg, LateBoundInitBinder initBinder);
         }
 
         class FastBindingBuilder : FastBindingBuilderBase {
@@ -200,16 +194,17 @@ namespace IronPython.Runtime.Types {
                 base(context, type, binder, siteType, genTypeArgs) {
             }
 
-            protected override Delegate GetNewOrInitSiteDelegate(PythonInvokeBinder binder, object func) {
-                return new Func&lt;CodeContext, object, object&gt;(new NewInitSite(binder, func).Call);
+            protected override Delegate GetNewSiteDelegate(PythonInvokeBinder binder, object func) {
+                return new Func&lt;CodeContext, object, object&gt;(new NewSite(binder, func).Call);
             }
 
-            protected override Delegate MakeDelegate(int version, Delegate newDlg, Delegate initDlg) {
+            protected override Delegate MakeDelegate(int version, Delegate newDlg, LateBoundInitBinder initBinder) {
                 return new Func&lt;CallSite, CodeContext, object, object&gt;(
                             new FastTypeSite(
                                 version,
                                 (Func&lt;CodeContext, object, object&gt;)newDlg,
-                                (Func&lt;CodeContext, object, object&gt;)initDlg).CallTarget
+                                initBinder
+                            ).CallTarget
                 );
             }
         }
@@ -217,21 +212,19 @@ namespace IronPython.Runtime.Types {
         class FastTypeSite {
             private readonly int _version;
             private readonly Func&lt;CodeContext, object, object&gt; _new;
-            private readonly Func&lt;CodeContext, object, object&gt; _init;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, object&gt;&gt; _initSite;
 
-            public FastTypeSite(int version, Func&lt;CodeContext, object, object&gt; @new, Func&lt;CodeContext, object, object&gt; init) {
+            public FastTypeSite(int version, Func&lt;CodeContext, object, object&gt; @new, LateBoundInitBinder initBinder) {
                 _version = version;
                 _new = @new;
-                _init = init;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, object, object&gt;&gt;.Create(initBinder);
             }
 
             public object CallTarget(CallSite site, CodeContext context, object type) {
                 PythonType pt = type as PythonType;
                 if (pt != null &amp;&amp; pt.Version == _version) {
                     object res = _new(context, type);
-                    if (_init != null &amp;&amp; res != null &amp;&amp; res.GetType() == pt.UnderlyingSystemType) {
-                        _init(context, res);
-                    }
+                    _initSite.Target(_initSite, context, res);
 
                     return res;
                 }
@@ -240,17 +233,17 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        class NewInitSite {
+        class NewSite {
             private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, object, object&gt;&gt; _site;
             private readonly object _target;
 
-            public NewInitSite(PythonInvokeBinder binder, object target) {
+            public NewSite(PythonInvokeBinder binder, object target) {
                 _site = CallSite&lt;Func&lt;CallSite, CodeContext, object, object, object&gt;&gt;.Create(binder);
                 _target = target;
             }
 
-            public object Call(CodeContext context, object typeOrInstance) {
-                return _site.Target(_site, context, _target, typeOrInstance);
+            public object Call(CodeContext context, object type) {
+                return _site.Target(_site, context, _target, type);
             }
         }
 
@@ -267,16 +260,17 @@ namespace IronPython.Runtime.Types {
                 base(context, type, binder, siteType, genTypeArgs) {
             }
 
-            protected override Delegate GetNewOrInitSiteDelegate(PythonInvokeBinder binder, object func) {
-                return new Func&lt;CodeContext, object, T0, object&gt;(new NewInitSite&lt;T0&gt;(binder, func).Call);
+            protected override Delegate GetNewSiteDelegate(PythonInvokeBinder binder, object func) {
+                return new Func&lt;CodeContext, object, T0, object&gt;(new NewSite&lt;T0&gt;(binder, func).Call);
             }
 
-            protected override Delegate MakeDelegate(int version, Delegate newDlg, Delegate initDlg) {
+            protected override Delegate MakeDelegate(int version, Delegate newDlg, LateBoundInitBinder initBinder) {
                 return new Func&lt;CallSite, CodeContext, object, T0, object&gt;(
-                            new FastTypeSite&lt;T0&gt;
-                                (version, 
-                                (Func&lt;CodeContext, object, T0, object&gt;)newDlg, 
-                                (Func&lt;CodeContext, object, T0, object&gt;)initDlg).CallTarget
+                    new FastTypeSite&lt;T0&gt;(
+                        version, 
+                        (Func&lt;CodeContext, object, T0, object&gt;)newDlg,
+                        initBinder
+                    ).CallTarget
                 );
             }
         }
@@ -284,21 +278,19 @@ namespace IronPython.Runtime.Types {
         class FastTypeSite&lt;T0&gt; {
             private readonly int _version;
             private readonly Func&lt;CodeContext, object, T0, object&gt; _new;
-            private readonly Func&lt;CodeContext, object, T0, object&gt; _init;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, object&gt;&gt; _initSite;
 
-            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, object&gt; @new, Func&lt;CodeContext, object, T0, object&gt; init) {
+            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, object&gt; @new, LateBoundInitBinder initBinder) {
                 _version = version;
                 _new = @new;
-                _init = init;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, object&gt;&gt;.Create(initBinder);
             }
 
             public object CallTarget(CallSite site, CodeContext context, object type, T0 arg0) {
                 PythonType pt = type as PythonType;
                 if (pt != null &amp;&amp; pt.Version == _version) {
                     object res = _new(context, type, arg0);
-                    if (_init != null &amp;&amp; res != null &amp;&amp; res.GetType() == pt.UnderlyingSystemType) {
-                        _init(context, res, arg0);
-                    }
+                    _initSite.Target(_initSite, context, res, arg0);
 
                     return res;
                 }
@@ -307,11 +299,11 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        class NewInitSite&lt;T0&gt; {
+        class NewSite&lt;T0&gt; {
             private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, object&gt;&gt; _site;
             private readonly object _target;
 
-            public NewInitSite(PythonInvokeBinder binder, object target) {
+            public NewSite(PythonInvokeBinder binder, object target) {
                 _site = CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, object&gt;&gt;.Create(binder);
                 _target = target;
             }
@@ -327,16 +319,17 @@ namespace IronPython.Runtime.Types {
                 base(context, type, binder, siteType, genTypeArgs) {
             }
 
-            protected override Delegate GetNewOrInitSiteDelegate(PythonInvokeBinder binder, object func) {
-                return new Func&lt;CodeContext, object, T0, T1, object&gt;(new NewInitSite&lt;T0, T1&gt;(binder, func).Call);
+            protected override Delegate GetNewSiteDelegate(PythonInvokeBinder binder, object func) {
+                return new Func&lt;CodeContext, object, T0, T1, object&gt;(new NewSite&lt;T0, T1&gt;(binder, func).Call);
             }
 
-            protected override Delegate MakeDelegate(int version, Delegate newDlg, Delegate initDlg) {
+            protected override Delegate MakeDelegate(int version, Delegate newDlg, LateBoundInitBinder initBinder) {
                 return new Func&lt;CallSite, CodeContext, object, T0, T1, object&gt;(
-                            new FastTypeSite&lt;T0, T1&gt;
-                                (version, 
-                                (Func&lt;CodeContext, object, T0, T1, object&gt;)newDlg, 
-                                (Func&lt;CodeContext, object, T0, T1, object&gt;)initDlg).CallTarget
+                    new FastTypeSite&lt;T0, T1&gt;(
+                        version, 
+                        (Func&lt;CodeContext, object, T0, T1, object&gt;)newDlg,
+                        initBinder
+                    ).CallTarget
                 );
             }
         }
@@ -344,21 +337,19 @@ namespace IronPython.Runtime.Types {
         class FastTypeSite&lt;T0, T1&gt; {
             private readonly int _version;
             private readonly Func&lt;CodeContext, object, T0, T1, object&gt; _new;
-            private readonly Func&lt;CodeContext, object, T0, T1, object&gt; _init;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, object&gt;&gt; _initSite;
 
-            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, object&gt; @new, Func&lt;CodeContext, object, T0, T1, object&gt; init) {
+            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, object&gt; @new, LateBoundInitBinder initBinder) {
                 _version = version;
                 _new = @new;
-                _init = init;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, object&gt;&gt;.Create(initBinder);
             }
 
             public object CallTarget(CallSite site, CodeContext context, object type, T0 arg0, T1 arg1) {
                 PythonType pt = type as PythonType;
                 if (pt != null &amp;&amp; pt.Version == _version) {
                     object res = _new(context, type, arg0, arg1);
-                    if (_init != null &amp;&amp; res != null &amp;&amp; res.GetType() == pt.UnderlyingSystemType) {
-                        _init(context, res, arg0, arg1);
-                    }
+                    _initSite.Target(_initSite, context, res, arg0, arg1);
 
                     return res;
                 }
@@ -367,11 +358,11 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        class NewInitSite&lt;T0, T1&gt; {
+        class NewSite&lt;T0, T1&gt; {
             private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, object&gt;&gt; _site;
             private readonly object _target;
 
-            public NewInitSite(PythonInvokeBinder binder, object target) {
+            public NewSite(PythonInvokeBinder binder, object target) {
                 _site = CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, object&gt;&gt;.Create(binder);
                 _target = target;
             }
@@ -387,16 +378,17 @@ namespace IronPython.Runtime.Types {
                 base(context, type, binder, siteType, genTypeArgs) {
             }
 
-            protected override Delegate GetNewOrInitSiteDelegate(PythonInvokeBinder binder, object func) {
-                return new Func&lt;CodeContext, object, T0, T1, T2, object&gt;(new NewInitSite&lt;T0, T1, T2&gt;(binder, func).Call);
+            protected override Delegate GetNewSiteDelegate(PythonInvokeBinder binder, object func) {
+                return new Func&lt;CodeContext, object, T0, T1, T2, object&gt;(new NewSite&lt;T0, T1, T2&gt;(binder, func).Call);
             }
 
-            protected override Delegate MakeDelegate(int version, Delegate newDlg, Delegate initDlg) {
+            protected override Delegate MakeDelegate(int version, Delegate newDlg, LateBoundInitBinder initBinder) {
                 return new Func&lt;CallSite, CodeContext, object, T0, T1, T2, object&gt;(
-                            new FastTypeSite&lt;T0, T1, T2&gt;
-                                (version, 
-                                (Func&lt;CodeContext, object, T0, T1, T2, object&gt;)newDlg, 
-                                (Func&lt;CodeContext, object, T0, T1, T2, object&gt;)initDlg).CallTarget
+                    new FastTypeSite&lt;T0, T1, T2&gt;(
+                        version, 
+                        (Func&lt;CodeContext, object, T0, T1, T2, object&gt;)newDlg,
+                        initBinder
+                    ).CallTarget
                 );
             }
         }
@@ -404,21 +396,19 @@ namespace IronPython.Runtime.Types {
         class FastTypeSite&lt;T0, T1, T2&gt; {
             private readonly int _version;
             private readonly Func&lt;CodeContext, object, T0, T1, T2, object&gt; _new;
-            private readonly Func&lt;CodeContext, object, T0, T1, T2, object&gt; _init;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, T2, object&gt;&gt; _initSite;
 
-            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, T2, object&gt; @new, Func&lt;CodeContext, object, T0, T1, T2, object&gt; init) {
+            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, T2, object&gt; @new, LateBoundInitBinder initBinder) {
                 _version = version;
                 _new = @new;
-                _init = init;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, T2, object&gt;&gt;.Create(initBinder);
             }
 
             public object CallTarget(CallSite site, CodeContext context, object type, T0 arg0, T1 arg1, T2 arg2) {
                 PythonType pt = type as PythonType;
                 if (pt != null &amp;&amp; pt.Version == _version) {
                     object res = _new(context, type, arg0, arg1, arg2);
-                    if (_init != null &amp;&amp; res != null &amp;&amp; res.GetType() == pt.UnderlyingSystemType) {
-                        _init(context, res, arg0, arg1, arg2);
-                    }
+                    _initSite.Target(_initSite, context, res, arg0, arg1, arg2);
 
                     return res;
                 }
@@ -427,11 +417,11 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        class NewInitSite&lt;T0, T1, T2&gt; {
+        class NewSite&lt;T0, T1, T2&gt; {
             private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, T2, object&gt;&gt; _site;
             private readonly object _target;
 
-            public NewInitSite(PythonInvokeBinder binder, object target) {
+            public NewSite(PythonInvokeBinder binder, object target) {
                 _site = CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, T2, object&gt;&gt;.Create(binder);
                 _target = target;
             }
@@ -447,16 +437,17 @@ namespace IronPython.Runtime.Types {
                 base(context, type, binder, siteType, genTypeArgs) {
             }
 
-            protected override Delegate GetNewOrInitSiteDelegate(PythonInvokeBinder binder, object func) {
-                return new Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt;(new NewInitSite&lt;T0, T1, T2, T3&gt;(binder, func).Call);
+            protected override Delegate GetNewSiteDelegate(PythonInvokeBinder binder, object func) {
+                return new Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt;(new NewSite&lt;T0, T1, T2, T3&gt;(binder, func).Call);
             }
 
-            protected override Delegate MakeDelegate(int version, Delegate newDlg, Delegate initDlg) {
+            protected override Delegate MakeDelegate(int version, Delegate newDlg, LateBoundInitBinder initBinder) {
                 return new Func&lt;CallSite, CodeContext, object, T0, T1, T2, T3, object&gt;(
-                            new FastTypeSite&lt;T0, T1, T2, T3&gt;
-                                (version, 
-                                (Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt;)newDlg, 
-                                (Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt;)initDlg).CallTarget
+                    new FastTypeSite&lt;T0, T1, T2, T3&gt;(
+                        version, 
+                        (Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt;)newDlg,
+                        initBinder
+                    ).CallTarget
                 );
             }
         }
@@ -464,21 +455,19 @@ namespace IronPython.Runtime.Types {
         class FastTypeSite&lt;T0, T1, T2, T3&gt; {
             private readonly int _version;
             private readonly Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt; _new;
-            private readonly Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt; _init;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, T2, T3, object&gt;&gt; _initSite;
 
-            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt; @new, Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt; init) {
+            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, T2, T3, object&gt; @new, LateBoundInitBinder initBinder) {
                 _version = version;
                 _new = @new;
-                _init = init;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, T2, T3, object&gt;&gt;.Create(initBinder);
             }
 
             public object CallTarget(CallSite site, CodeContext context, object type, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
                 PythonType pt = type as PythonType;
                 if (pt != null &amp;&amp; pt.Version == _version) {
                     object res = _new(context, type, arg0, arg1, arg2, arg3);
-                    if (_init != null &amp;&amp; res != null &amp;&amp; res.GetType() == pt.UnderlyingSystemType) {
-                        _init(context, res, arg0, arg1, arg2, arg3);
-                    }
+                    _initSite.Target(_initSite, context, res, arg0, arg1, arg2, arg3);
 
                     return res;
                 }
@@ -487,11 +476,11 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        class NewInitSite&lt;T0, T1, T2, T3&gt; {
+        class NewSite&lt;T0, T1, T2, T3&gt; {
             private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, T2, T3, object&gt;&gt; _site;
             private readonly object _target;
 
-            public NewInitSite(PythonInvokeBinder binder, object target) {
+            public NewSite(PythonInvokeBinder binder, object target) {
                 _site = CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, T2, T3, object&gt;&gt;.Create(binder);
                 _target = target;
             }
@@ -507,16 +496,17 @@ namespace IronPython.Runtime.Types {
                 base(context, type, binder, siteType, genTypeArgs) {
             }
 
-            protected override Delegate GetNewOrInitSiteDelegate(PythonInvokeBinder binder, object func) {
-                return new Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt;(new NewInitSite&lt;T0, T1, T2, T3, T4&gt;(binder, func).Call);
+            protected override Delegate GetNewSiteDelegate(PythonInvokeBinder binder, object func) {
+                return new Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt;(new NewSite&lt;T0, T1, T2, T3, T4&gt;(binder, func).Call);
             }
 
-            protected override Delegate MakeDelegate(int version, Delegate newDlg, Delegate initDlg) {
+            protected override Delegate MakeDelegate(int version, Delegate newDlg, LateBoundInitBinder initBinder) {
                 return new Func&lt;CallSite, CodeContext, object, T0, T1, T2, T3, T4, object&gt;(
-                            new FastTypeSite&lt;T0, T1, T2, T3, T4&gt;
-                                (version, 
-                                (Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt;)newDlg, 
-                                (Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt;)initDlg).CallTarget
+                    new FastTypeSite&lt;T0, T1, T2, T3, T4&gt;(
+                        version, 
+                        (Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt;)newDlg,
+                        initBinder
+                    ).CallTarget
                 );
             }
         }
@@ -524,21 +514,19 @@ namespace IronPython.Runtime.Types {
         class FastTypeSite&lt;T0, T1, T2, T3, T4&gt; {
             private readonly int _version;
             private readonly Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt; _new;
-            private readonly Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt; _init;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, T2, T3, T4, object&gt;&gt; _initSite;
 
-            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt; @new, Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt; init) {
+            public FastTypeSite(int version, Func&lt;CodeContext, object, T0, T1, T2, T3, T4, object&gt; @new, LateBoundInitBinder initBinder) {
                 _version = version;
                 _new = @new;
-                _init = init;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, object, T0, T1, T2, T3, T4, object&gt;&gt;.Create(initBinder);
             }
 
             public object CallTarget(CallSite site, CodeContext context, object type, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
                 PythonType pt = type as PythonType;
                 if (pt != null &amp;&amp; pt.Version == _version) {
                     object res = _new(context, type, arg0, arg1, arg2, arg3, arg4);
-                    if (_init != null &amp;&amp; res != null &amp;&amp; res.GetType() == pt.UnderlyingSystemType) {
-                        _init(context, res, arg0, arg1, arg2, arg3, arg4);
-                    }
+                    _initSite.Target(_initSite, context, res, arg0, arg1, arg2, arg3, arg4);
 
                     return res;
                 }
@@ -547,11 +535,11 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        class NewInitSite&lt;T0, T1, T2, T3, T4&gt; {
+        class NewSite&lt;T0, T1, T2, T3, T4&gt; {
             private readonly CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, T2, T3, T4, object&gt;&gt; _site;
             private readonly object _target;
 
-            public NewInitSite(PythonInvokeBinder binder, object target) {
+            public NewSite(PythonInvokeBinder binder, object target) {
                 _site = CallSite&lt;Func&lt;CallSite, CodeContext, object, object, T0, T1, T2, T3, T4, object&gt;&gt;.Create(binder);
                 _target = target;
             }
@@ -565,6 +553,456 @@ namespace IronPython.Runtime.Types {
         // *** END GENERATED CODE ***
 
         #endregion
+    }
+
+    /// &lt;summary&gt;
+    /// Used when a type overrides __new__ with a Python function or other object
+    /// that can return an arbitrary value.  If the return value is not the same type
+    /// as the type which had __new__ then we need to lookup __init__ on the type
+    /// and invoke it.  Also handles initialization for finalization when __del__
+    /// is defined for the same reasons.
+    /// &lt;/summary&gt;
+    class LateBoundInitBinder : DynamicMetaObjectBinder {
+        private readonly PythonType _newType;           // the type __new__ was invoked on
+        private readonly CallSignature _signature;      // the call signature for the call
+
+        public LateBoundInitBinder(PythonType type, CallSignature signature) {
+            _newType = type;
+            _signature = signature;
+        }
+
+        /// &lt;summary&gt;
+        /// target is the newly initialized value.
+        /// args are the arguments to be passed to __init__
+        /// &lt;/summary&gt;
+        public override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args) {
+            DynamicMetaObject codeContext = target;
+            CodeContext context = (CodeContext)codeContext.Value;
+            target = args[0];
+            args = ArrayUtils.RemoveFirst(args);
+
+            ValidationInfo valInfo = BindingHelpers.GetValidationInfo(target);
+
+            Expression res;
+            PythonType instType = DynamicHelpers.GetPythonType(target.Value);
+            BindingRestrictions initRestrictions = BindingRestrictions.Empty;
+
+            if (IronPython.Modules.Builtin.isinstance(target.Value, _newType) &amp;&amp;
+                NeedsInitCall((CodeContext)codeContext.Value, instType, args.Length)) {
+
+                // resolve __init__
+                PythonTypeSlot init;
+                instType.TryResolveSlot(context, Symbols.Init, out init);
+
+                if (instType.IsMixedNewStyleOldStyle()) {
+                    // mixed new-style/old-style class, we need to look up __init__ every time
+                    res = MakeDynamicInitInvoke(
+                        context,
+                        args,
+                        Expression.Call(
+                            typeof(PythonOps).GetMethod(&quot;GetMixedMember&quot;),
+                            codeContext.Expression,
+                            Expression.Convert(AstUtils.WeakConstant(instType), typeof(PythonType)),
+                            AstUtils.Convert(target.Expression, typeof(object)),
+                            AstUtils.Constant(Symbols.Init)
+                        ),
+                        codeContext.Expression
+                    );
+                } else if (init is PythonFunction) {
+                    // avoid creating the bound method, just invoke it directly
+                    Expression[] allArgs = new Expression[args.Length + 3];
+                    allArgs[0] = codeContext.Expression;
+                    allArgs[1] = AstUtils.WeakConstant(init);
+                    allArgs[2] = target.Expression;
+                    for (int i = 0; i &lt; args.Length; i++) {
+                        allArgs[3 + i] = args[i].Expression;
+                    }
+
+                    res = Expression.Dynamic(
+                        context.LanguageContext.Invoke(_signature.InsertArgument(Argument.Simple)),
+                        typeof(object),
+                        allArgs
+                    );
+                } else if(init is BuiltinMethodDescriptor || init is BuiltinFunction) {
+                    IList&lt;MethodBase&gt; targets;
+                    if (init is BuiltinMethodDescriptor) {
+                        targets = ((BuiltinMethodDescriptor)init).Template.Targets;
+                    } else {
+                        targets = ((BuiltinFunction)init).Targets;
+                    }
+
+                    PythonBinder binder = context.LanguageContext.Binder;
+
+                    DynamicMetaObject initInvoke = binder.CallMethod(
+                        new PythonOverloadResolver(
+                            binder,
+                            target,
+                            args,
+                            _signature,
+                            codeContext.Expression
+                        ),
+                        targets,
+                        BindingRestrictions.Empty
+                    );
+
+                    res = initInvoke.Expression;
+                    initRestrictions = initInvoke.Restrictions;
+                } else {
+                    // some weird descriptor has been put in place for __init__, we need
+                    // to call __get__ on it each time.
+                    res = MakeDynamicInitInvoke(
+                        context,
+                        args,
+                        Expression.Call(
+                            typeof(PythonOps).GetMethod(&quot;GetInitSlotMember&quot;),
+                            codeContext.Expression,
+                            Expression.Convert(AstUtils.WeakConstant(_newType), typeof(PythonType)),
+                            Expression.Convert(AstUtils.WeakConstant(init), typeof(PythonTypeSlot)),
+                            AstUtils.Convert(target.Expression, typeof(object))
+                        ),
+                        codeContext.Expression
+                    );
+                }
+            } else {
+                // returned something that isn't a subclass of the creating type
+                // __init__ will not be run.
+                res = AstUtils.Empty();
+            }
+
+            // check for __del__
+            PythonTypeSlot delSlot;
+            if (instType.TryResolveSlot(context, Symbols.Unassign, out delSlot)) {
+                res = Expression.Block(
+                    res,
+                    Expression.Call(
+                        typeof(PythonOps).GetMethod(&quot;InitializeForFinalization&quot;),
+                        codeContext.Expression,
+                        AstUtils.Convert(target.Expression, typeof(object))
+                    )
+                );
+            }
+
+            return BindingHelpers.AddDynamicTestAndDefer(
+                this,
+                new DynamicMetaObject(
+                    Expression.Block(
+                        res,
+                        target.Expression
+                    ),
+                    target.Restrict(target.LimitType).Restrictions.Merge(initRestrictions)
+                ),
+                args,
+                valInfo
+            );
+        }
+
+        #region Generated Python Fast Init Max Args
+
+        // *** BEGIN GENERATED CODE ***
+        // generated by function: gen_fast_init_max_args from: generate_calls.py
+
+        public const int MaxFastLateBoundInitArgs = 6;
+
+        // *** END GENERATED CODE ***
+
+        #endregion
+
+        public override T BindDelegate&lt;T&gt;(CallSite&lt;T&gt; site, object[] args) {
+            if (args.Length &lt;= MaxFastLateBoundInitArgs) {
+                CodeContext context = (CodeContext)args[0];
+                object inst = args[1];
+                PythonType instType = DynamicHelpers.GetPythonType(inst);
+
+                PythonTypeSlot delSlot;
+                PythonFunction initFunc = null;
+                string callTarget = null;
+                if (!instType.TryResolveSlot(context, Symbols.Unassign, out delSlot)        // we don't have fast code for classes w/ finalizers
+                    &amp;&amp; !instType.IsMixedNewStyleOldStyle()) {                               // we also don't have fast code for mixed new-style/old-style classes
+
+                    if (IronPython.Modules.Builtin.isinstance(inst, _newType) &amp;&amp;
+                        NeedsInitCall((CodeContext)context, instType, args.Length)) {
+
+                        PythonTypeSlot init;
+                        instType.TryResolveSlot(context, Symbols.Init, out init);
+
+                        if (init is PythonFunction) {
+                            // we can do a fast bind                        
+                            callTarget = &quot;CallTarget&quot;;
+                            initFunc = (PythonFunction)init;
+                        }
+                    } else {
+                        // we need no initialization, we can do a fast bind
+                        callTarget = &quot;EmptyCallTarget&quot;;
+                    }
+                }
+
+                if (callTarget != null) {
+                    int genArgCount = args.Length - 2;
+                    PythonInvokeBinder binder = context.LanguageContext.Invoke(_signature.InsertArgument(Argument.Simple));
+                    if (genArgCount == 0) {
+                        FastInitSite fastSite = new FastInitSite(instType.Version, binder, initFunc);
+                        if (callTarget == &quot;CallTarget&quot;) {
+                            return (T)(object)new Func&lt;CallSite, CodeContext, object, object&gt;(fastSite.CallTarget);
+                        } else {
+                            return (T)(object)new Func&lt;CallSite, CodeContext, object, object&gt;(fastSite.EmptyCallTarget);
+                        }
+
+                    } else {
+                        Type[] genArgs = ArrayUtils.ConvertAll(typeof(T).GetMethod(&quot;Invoke&quot;).GetParameters(), x =&gt; x.ParameterType);
+                        Type initSiteType;
+
+                        switch (args.Length - 2) {
+                            #region Generated Python Fast Init Switch
+
+                            // *** BEGIN GENERATED CODE ***
+                            // generated by function: gen_fast_init_switch from: generate_calls.py
+
+                            case 1: initSiteType = typeof(FastInitSite&lt;&gt;); break;
+                            case 2: initSiteType = typeof(FastInitSite&lt;,&gt;); break;
+                            case 3: initSiteType = typeof(FastInitSite&lt;,,&gt;); break;
+                            case 4: initSiteType = typeof(FastInitSite&lt;,,,&gt;); break;
+                            case 5: initSiteType = typeof(FastInitSite&lt;,,,,&gt;); break;
+
+                            // *** END GENERATED CODE ***
+
+                            #endregion
+
+                            default: throw new InvalidOperationException();
+                        }
+
+                        Type genType = initSiteType.MakeGenericType(ArrayUtils.ShiftLeft(genArgs, 3));
+                        object initSiteInst = Activator.CreateInstance(genType, instType.Version, binder, initFunc);
+                        return (T)(object)Delegate.CreateDelegate(typeof(T), initSiteInst, genType.GetMethod(callTarget));
+                    }
+                }
+            }
+
+            return base.BindDelegate(site, args);
+        }
+
+        class FastInitSite {
+            private readonly int _version;
+            private readonly PythonFunction _slot;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object, object&gt;&gt; _initSite;
+
+            public FastInitSite(int version, PythonInvokeBinder binder, PythonFunction target) {
+                _version = version;
+                _slot = target;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object, object&gt;&gt;.Create(binder);
+            }
+
+            public object CallTarget(CallSite site, CodeContext context, object inst) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if (pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) {
+                    _initSite.Target(_initSite, context, _slot, inst);
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object, object&gt;&gt;)site).Update(site, context, inst);
+            }
+
+            public object EmptyCallTarget(CallSite site, CodeContext context, object inst) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if ((pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) || DynamicHelpers.GetPythonType(inst).Version == _version) {
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object, object&gt;&gt;)site).Update(site, context, inst);
+            }
+        }
+
 
+        #region Generated Python Fast Init Callers
+
+        // *** BEGIN GENERATED CODE ***
+        // generated by function: gen_fast_init_callers from: generate_calls.py
+
+
+        class FastInitSite&lt;T0&gt; {
+            private readonly int _version;
+            private readonly PythonFunction _slot;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object, T0, object&gt;&gt; _initSite;
+
+            public FastInitSite(int version, PythonInvokeBinder binder, PythonFunction target) {
+                _version = version;
+                _slot = target;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object,  T0, object&gt;&gt;.Create(binder);
+            }
+
+            public object CallTarget(CallSite site, CodeContext context, object inst, T0 arg0) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if (pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) {
+                    _initSite.Target(_initSite, context, _slot, inst, arg0);
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, object&gt;&gt;)site).Update(site, context, inst, arg0);
+            }
+
+            public object EmptyCallTarget(CallSite site, CodeContext context, object inst, T0 arg0) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if ((pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) || DynamicHelpers.GetPythonType(inst).Version == _version) {
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, object&gt;&gt;)site).Update(site, context, inst, arg0);
+            }
+        }
+
+
+        class FastInitSite&lt;T0, T1&gt; {
+            private readonly int _version;
+            private readonly PythonFunction _slot;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object, T0, T1, object&gt;&gt; _initSite;
+
+            public FastInitSite(int version, PythonInvokeBinder binder, PythonFunction target) {
+                _version = version;
+                _slot = target;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object,  T0, T1, object&gt;&gt;.Create(binder);
+            }
+
+            public object CallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if (pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) {
+                    _initSite.Target(_initSite, context, _slot, inst, arg0, arg1);
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1);
+            }
+
+            public object EmptyCallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if ((pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) || DynamicHelpers.GetPythonType(inst).Version == _version) {
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1);
+            }
+        }
+
+
+        class FastInitSite&lt;T0, T1, T2&gt; {
+            private readonly int _version;
+            private readonly PythonFunction _slot;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object, T0, T1, T2, object&gt;&gt; _initSite;
+
+            public FastInitSite(int version, PythonInvokeBinder binder, PythonFunction target) {
+                _version = version;
+                _slot = target;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object,  T0, T1, T2, object&gt;&gt;.Create(binder);
+            }
+
+            public object CallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1, T2 arg2) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if (pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) {
+                    _initSite.Target(_initSite, context, _slot, inst, arg0, arg1, arg2);
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, T2, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1, arg2);
+            }
+
+            public object EmptyCallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1, T2 arg2) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if ((pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) || DynamicHelpers.GetPythonType(inst).Version == _version) {
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, T2, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1, arg2);
+            }
+        }
+
+
+        class FastInitSite&lt;T0, T1, T2, T3&gt; {
+            private readonly int _version;
+            private readonly PythonFunction _slot;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object, T0, T1, T2, T3, object&gt;&gt; _initSite;
+
+            public FastInitSite(int version, PythonInvokeBinder binder, PythonFunction target) {
+                _version = version;
+                _slot = target;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object,  T0, T1, T2, T3, object&gt;&gt;.Create(binder);
+            }
+
+            public object CallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if (pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) {
+                    _initSite.Target(_initSite, context, _slot, inst, arg0, arg1, arg2, arg3);
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, T2, T3, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1, arg2, arg3);
+            }
+
+            public object EmptyCallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1, T2 arg2, T3 arg3) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if ((pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) || DynamicHelpers.GetPythonType(inst).Version == _version) {
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, T2, T3, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1, arg2, arg3);
+            }
+        }
+
+
+        class FastInitSite&lt;T0, T1, T2, T3, T4&gt; {
+            private readonly int _version;
+            private readonly PythonFunction _slot;
+            private readonly CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object, T0, T1, T2, T3, T4, object&gt;&gt; _initSite;
+
+            public FastInitSite(int version, PythonInvokeBinder binder, PythonFunction target) {
+                _version = version;
+                _slot = target;
+                _initSite = CallSite&lt;Func&lt;CallSite, CodeContext, PythonFunction, object,  T0, T1, T2, T3, T4, object&gt;&gt;.Create(binder);
+            }
+
+            public object CallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if (pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) {
+                    _initSite.Target(_initSite, context, _slot, inst, arg0, arg1, arg2, arg3, arg4);
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, T2, T3, T4, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1, arg2, arg3, arg4);
+            }
+
+            public object EmptyCallTarget(CallSite site, CodeContext context, object inst, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) {
+                IPythonObject pyObj = inst as IPythonObject;
+                if ((pyObj != null &amp;&amp; pyObj.PythonType.Version == _version) || DynamicHelpers.GetPythonType(inst).Version == _version) {
+                    return inst;
+                }
+
+                return ((CallSite&lt;Func&lt;CallSite, CodeContext, object,  T0, T1, T2, T3, T4, object&gt;&gt;)site).Update(site, context, inst, arg0, arg1, arg2, arg3, arg4);
+            }
+        }
+
+
+        // *** END GENERATED CODE ***
+
+        #endregion
+
+
+        private bool NeedsInitCall(CodeContext context, PythonType type, int argCount) {
+            if (!type.HasObjectInit(context) || type.IsMixedNewStyleOldStyle()) {
+                return true;
+            } else if (_newType.HasObjectNew(context)) {
+                return argCount &gt; 0;
+            }
+
+            return false;
+        }
+
+        private DynamicExpression MakeDynamicInitInvoke(CodeContext context, DynamicMetaObject[] args, Expression initFunc, Expression codeContext) {
+            return Expression.Dynamic(
+                context.LanguageContext.Invoke(_signature),
+                typeof(object),
+                ArrayUtils.Insert(
+                    codeContext,
+                    initFunc,
+                    DynamicUtils.GetExpressions(args)
+                )
+            );
+        }
     }
 }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/PythonType.Generated.cs</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,7 @@ namespace IronPython.Runtime.Types {
     [PythonType(&quot;type&quot;)]
     [Documentation(@&quot;type(object) -&gt; gets the type of the object
 type(name, bases, dict) -&gt; creates a new type instance with the given name, base classes, and members from the dictionary&quot;)]
-    public partial class PythonType : IMembersList, IDynamicMetaObjectProvider, IWeakReferenceable, ICodeFormattable, IFastGettable, IFastSettable, IFastInvokable {
+    public partial class PythonType : IPythonMembersList, IDynamicMetaObjectProvider, IWeakReferenceable, ICodeFormattable, IFastGettable, IFastSettable, IFastInvokable {
         private Type/*!*/ _underlyingSystemType;            // the underlying CLI system type for this type
         private string _name;                               // the name of the type
         private Dictionary&lt;SymbolId, PythonTypeSlot&gt; _dict; // type-level slots &amp; attributes
@@ -75,6 +75,7 @@ type(name, bases, dict) -&gt; creates a new type instance with the given name, base
         private CallSite&lt;Func&lt;CallSite, object, int&gt;&gt; _hashSite;
         private CallSite&lt;Func&lt;CallSite, object, object, bool&gt;&gt; _eqSite;
         private CallSite&lt;Func&lt;CallSite, object, object, int&gt;&gt; _compareSite;
+        private Dictionary&lt;CallSignature, LateBoundInitBinder&gt; _lateBoundInitBinders;
 
         private PythonSiteCache _siteCache = new PythonSiteCache();
 
@@ -1014,7 +1015,25 @@ type(name, bases, dict) -&gt; creates a new type instance with the given name, base
             return !TryResolveSlot(DefaultContext.Default, SymbolTable.StringToId(name), out dummySlot) &amp;&amp;
                     TryResolveSlot(DefaultContext.DefaultCLS, SymbolTable.StringToId(name), out dummySlot);
         }
+        
+        internal LateBoundInitBinder GetLateBoundInitBinder(CallSignature signature) {
+            Debug.Assert(!IsSystemType); // going to hold onto a PythonContext, shouldn't ever be a system type
+            Debug.Assert(_pythonContext != null);
+
+            if (_lateBoundInitBinders == null) {
+                Interlocked.CompareExchange(ref _lateBoundInitBinders, new Dictionary&lt;CallSignature, LateBoundInitBinder&gt;(), null);
+            }
 
+            lock(_lateBoundInitBinders) {
+                LateBoundInitBinder res;
+                if (!_lateBoundInitBinders.TryGetValue(signature, out res)) {
+                    _lateBoundInitBinders[signature] = res = new LateBoundInitBinder(this, signature);
+                }
+
+                return res;
+            }
+        }
+        
         #endregion
 
         #region Type member access
@@ -1893,7 +1912,7 @@ type(name, bases, dict) -&gt; creates a new type instance with the given name, base
             }
 
             object modName;
-            if (context.Scope.TryLookupName(Symbols.Name, out modName)) {
+            if (context.Scope.TryGetVariable(Symbols.Name, out modName)) {
                 PopulateSlot(Symbols.Module, modName);
             }
 
@@ -1974,7 +1993,7 @@ type(name, bases, dict) -&gt; creates a new type instance with the given name, base
         private static void EnsureModule(CodeContext context, IAttributesCollection dict) {
             if (!dict.ContainsKey(Symbols.Module)) {
                 object modName;
-                if (context.Scope.TryLookupName(Symbols.Name, out modName)) {
+                if (context.Scope.TryGetVariable(Symbols.Name, out modName)) {
                     dict[Symbols.Module] = modName;
                 }
             }
@@ -2260,7 +2279,11 @@ type(name, bases, dict) -&gt; creates a new type instance with the given name, base
 
         #region IMembersList Members
 
-        IList&lt;object&gt; IMembersList.GetMemberNames(CodeContext context) {
+        IList&lt;string&gt; IMembersList.GetMemberNames() {
+            return PythonOps.GetStringMemberList(this);
+        }
+
+        IList&lt;object&gt; IPythonMembersList.GetMemberNames(CodeContext/*!*/ context) {
             IList&lt;object&gt; res = GetMemberNames(context);
 
             object[] arr = new object[res.Count];
@@ -2900,5 +2923,7 @@ type(name, bases, dict) -&gt; creates a new type instance with the given name, base
 
             return type == _self;
         }
-    }       
+    }
+
+    
 }</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/PythonType.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,12 +13,10 @@
  *
  * ***************************************************************************/
 
-using System;
+using System.Dynamic;
 using System.Linq.Expressions;
 using System.Runtime.InteropServices;
 
-using Microsoft.Scripting.Runtime;
-
 using IronPython.Runtime.Binding;
 using IronPython.Runtime.Operations;
 
@@ -80,14 +78,14 @@ namespace IronPython.Runtime.Types {
         /// The default implementation just calls the TryGetValue method.  Subtypes of PythonTypeSlot can override
         /// this and provide a more optimal implementation.
         /// &lt;/summary&gt;
-        internal virtual void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, Expression instance, Expression/*!*/ owner, ConditionalBuilder/*!*/ builder) {
+        internal virtual void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, DynamicMetaObject instance, DynamicMetaObject/*!*/ owner, ConditionalBuilder/*!*/ builder) {
             ParameterExpression tmp = Ast.Variable(typeof(object), &quot;slotTmp&quot;);
             Expression call = Ast.Call(
                  typeof(PythonOps).GetMethod(&quot;SlotTryGetValue&quot;),
                  codeContext,
                  AstUtils.Convert(AstUtils.WeakConstant(this), typeof(PythonTypeSlot)),
-                 instance ?? AstUtils.Constant(null),
-                 owner,
+                 instance != null ? instance.Expression : AstUtils.Constant(null),
+                 owner.Expression,
                  tmp
             );
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/PythonTypeSlot.cs</filename>
    </modified>
    <modified>
      <diff>@@ -162,7 +162,7 @@ namespace IronPython.Runtime.Types {
             }
         }
 
-        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, Expression instance, Expression/*!*/ owner, ConditionalBuilder/*!*/ builder) {
+        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, DynamicMetaObject instance, DynamicMetaObject/*!*/ owner, ConditionalBuilder/*!*/ builder) {
             if (!_info.IsPublic || _info.DeclaringType.ContainsGenericParameters) {
                 // fallback to reflection
                 base.MakeGetExpression(binder, codeContext, instance, owner, builder);
@@ -177,10 +177,10 @@ namespace IronPython.Runtime.Types {
                     AstUtils.Convert(
                         Ast.Field(
                             binder.ConvertExpression(
-                                instance,
+                                instance.Expression,
                                 _info.DeclaringType,
                                 ConversionResultKind.ExplicitCast,
-                                codeContext
+                                new PythonOverloadResolverFactory(binder, codeContext)
                             ),
                             _info
                         ),</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/ReflectedField.cs</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,7 @@
 
 using System;
 using System.Diagnostics;
+using System.Dynamic;
 using System.Linq.Expressions;
 using System.Reflection;
 using System.Runtime.CompilerServices;
@@ -22,7 +23,6 @@ using System.Runtime.CompilerServices;
 using Microsoft.Scripting;
 using Microsoft.Scripting.Actions;
 using Microsoft.Scripting.Generation;
-using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
 
 using IronPython.Runtime.Binding;
@@ -160,7 +160,7 @@ namespace IronPython.Runtime.Types {
             return true;
         }
 
-        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, Expression instance, Expression/*!*/ owner, ConditionalBuilder/*!*/ builder) {
+        internal override void MakeGetExpression(PythonBinder/*!*/ binder, Expression/*!*/ codeContext, DynamicMetaObject instance, DynamicMetaObject/*!*/ owner, ConditionalBuilder/*!*/ builder) {
             if (Getter.Length != 0 &amp;&amp; !Getter[0].IsPublic) {
                 // fallback to runtime call
                 base.MakeGetExpression(binder, codeContext, instance, owner, builder);
@@ -173,16 +173,16 @@ namespace IronPython.Runtime.Types {
                             MemberTracker.FromMemberInfo(_info)
                         ),
                         typeof(object)
-                    )
+                    ).Expression
                 );
             } else if (instance != null) {
                 builder.FinishCondition(
                     AstUtils.Convert(
                         binder.MakeCallExpression(
-                            codeContext,
+                            new PythonOverloadResolverFactory(binder, codeContext),
                             Getter[0],
                             instance
-                        ),
+                        ).Expression,
                         typeof(object)
                     )
                 );
@@ -190,9 +190,9 @@ namespace IronPython.Runtime.Types {
                 builder.FinishCondition(
                     AstUtils.Convert(
                         binder.MakeCallExpression(
-                            codeContext,
+                            new PythonOverloadResolverFactory(binder, codeContext),
                             Getter[0]
-                        ),
+                        ).Expression,
                         typeof(object)
                     )
                 );                </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/ReflectedProperty.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Runtime.CompilerServices;
 using System.Text;
-using Microsoft.Scripting.Runtime;
+using IronPython.Runtime;
 
 namespace IronPythonTest {
 </diff>
      <filename>Merlin/Main/Languages/IronPython/IronPythonTest/InheritTest.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
     &lt;SignAssembly Condition=&quot;'$(SignAssembly)' == '' And Exists('$(AssemblyOriginatorKeyFile)')&quot;&gt;true&lt;/SignAssembly&gt;
     &lt;SignedSym Condition=&quot;'$(SignAssembly)' == 'true'&quot;&gt;SIGNED&lt;/SignedSym&gt;
     &lt;DelaySign&gt;true&lt;/DelaySign&gt;
-    &lt;SilverlightPath Condition=&quot;$(SilverlightPath) == ''&quot;&gt;..\..\..\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
+    &lt;SilverlightPath Condition=&quot;'$(SilverlightPath)' == ''&quot;&gt;..\..\..\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
   &lt;/PropertyGroup&gt;
   &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' &quot;&gt;
     &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;</diff>
      <filename>Merlin/Main/Languages/IronPython/IronPythonTest/IronPythonTest.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -655,10 +655,6 @@ internal class LibraryDef {
 
                     var type = parameterInfos[i].ParameterType;
 
-                    if (type == typeof(CodeContext)) {
-                        LogMethodError(&quot;CodeContext is obsolete use RubyContext instead.&quot;, methodDef, overload);
-                    }
-
                     if (type.IsSubclassOf(typeof(RubyCallSiteStorage))) {
                         if (hasSelf || hasContext || hasBlock) {
                             LogMethodError(&quot;RubyCallSiteStorage must precede all other parameters&quot;, methodDef, overload);</diff>
      <filename>Merlin/Main/Languages/Ruby/ClassInitGenerator/Libraries/LibraryDef.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,7 @@
  * ***************************************************************************/
 
 using System;
+using Microsoft.Scripting;
 using Microsoft.Scripting.Hosting;
 using Microsoft.Scripting.Hosting.Shell;
 using IronRuby;
@@ -39,9 +40,23 @@ internal sealed class RubyConsoleHost : ConsoleHost {
         return Ruby.CreateRubySetup();
     }
 
+    private static void SetHome() {
+        try {
+            PlatformAdaptationLayer platform = PlatformAdaptationLayer.Default;
+            string homeDir = RubyUtils.GetHomeDirectory(platform);
+            platform.SetEnvironmentVariable(&quot;HOME&quot;, homeDir);
+        } catch (System.Security.SecurityException e) {
+            // Ignore EnvironmentPermission exception
+            if (e.PermissionType != typeof(System.Security.Permissions.EnvironmentPermission)) {
+                throw;
+            }
+        }
+    }
+
     [STAThread]
     [RubyStackTraceHidden]
     static int Main(string[] args) {
+        SetHome();
         return new RubyConsoleHost().Run(args);
     }
 }
\ No newline at end of file</diff>
      <filename>Merlin/Main/Languages/Ruby/Console/Program.cs</filename>
    </modified>
    <modified>
      <diff>@@ -46,8 +46,8 @@ namespace IronRuby.Tests {
                 Scenario_ParseRegex1,
 
                 Scenario_RubyCategorizer1,
-                Scenario_RubyNameMangling1,
-                Scenario_RubyNameMangling2,
+                NameMangling1,
+                NameMangling2,
 
                 OverloadResolution_Block1,
                 OverloadResolution_ParamArrays1,
@@ -354,6 +354,7 @@ namespace IronRuby.Tests {
 
                 Require1,
                 RequireInterop1,
+                RequireInterop2,
                 Load1,
                 LibraryLoader1,
 
@@ -620,6 +621,7 @@ namespace IronRuby.Tests {
                 Dlr_Comparable,
                 Dlr_RubyObjects,
                 Dlr_Methods,
+                Dlr_Visibility,
                 Dlr_Languages,
             };
         }</diff>
      <filename>Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs</filename>
    </modified>
    <modified>
      <diff>@@ -787,6 +787,50 @@ end
             //assert_equal Methods.with_block {|x| x + 1000}, 1100
         }
 
+        public void Dlr_Visibility() {
+            Engine.Execute(@&quot;
+class D &lt; Hash
+end
+
+class C
+  def public_m
+    0
+  end
+
+  private
+  def private_m
+    1
+  end
+
+  protected
+  def protected_m
+    2
+  end
+end
+&quot;);
+            var classC = Runtime.Globals.GetVariable(&quot;C&quot;);
+            var c = Engine.Operations.CreateInstance(classC);
+
+            AssertExceptionThrown&lt;MissingMethodException&gt;(() =&gt; MyInvokeMemberBinder.Invoke(c, &quot;private_m&quot;));
+            AssertExceptionThrown&lt;MissingMethodException&gt;(() =&gt; MyInvokeMemberBinder.Invoke(c, &quot;protected_m&quot;));
+            var r1 = MyInvokeMemberBinder.Invoke(c, &quot;public_m&quot;);
+            Assert(r1 is int &amp;&amp; (int)r1 == 0);
+
+            Engine.Execute(@&quot;
+class C
+  def method_missing name
+    3
+  end
+end&quot;);
+            var r2 = MyInvokeMemberBinder.Invoke(c, &quot;private_m&quot;);
+            Assert(r2 is int &amp;&amp; (int)r2 == 3);
+
+            // private initialize method can be called if called via new:
+            var classD = Runtime.Globals.GetVariable(&quot;D&quot;);
+            var d = Engine.Operations.CreateInstance(classD);
+            Assert(d is Hash);
+        }
+
         public void Dlr_Languages() {
             //# Pass in ref/out params
             //# Named arguments</diff>
      <filename>Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/DlrInteropTests.cs</filename>
    </modified>
    <modified>
      <diff>@@ -140,6 +140,42 @@ Hello from Python
             }
         }
 
+        public void RequireInterop2() {
+            if (_driver.PartialTrust || !_driver.RunPython) return;
+
+            try {
+                string temp = _driver.MakeTempDir();
+                Context.Loader.SetLoadPaths(new[] { temp });
+
+                File.WriteAllText(Path.Combine(temp, &quot;a.py&quot;), @&quot;
+def WhoIsThis():
+  print 'Python'
+
+Foo = 1
+
+class Bar(object):
+  def baz(self):
+    print Foo
+&quot;);
+
+                TestOutput(@&quot;
+a = IronRuby.require('a')
+scopes = IronRuby.loaded_scripts.collect { |z| z.value }
+a.who_is_this.call
+a.foo += 1
+a.bar.new.baz
+puts scopes[0].Foo
+&quot;, @&quot;
+Python
+2
+2
+&quot;);
+
+            } finally {
+                File.Delete(&quot;b.py&quot;);
+            }
+        }
+
         public class TestLibraryInitializer1 : LibraryInitializer {
             protected override void LoadModules() {
                 Context.ObjectClass.SetConstant(&quot;TEST_LIBRARY&quot;, &quot;hello from library&quot;);</diff>
      <filename>Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/LoaderTests.cs</filename>
    </modified>
    <modified>
      <diff>@@ -17,34 +17,124 @@ using IronRuby.Runtime;
 
 namespace IronRuby.Tests {
     public partial class Tests {
-        public void Scenario_RubyNameMangling1() {
-            Assert(RubyUtils.TryUnmangleName(&quot;ip_stack&quot;) == &quot;IpStack&quot;);  // TODO
+        public void NameMangling1() {
             Assert(RubyUtils.TryUnmangleName(&quot;stack&quot;) == &quot;Stack&quot;);
             Assert(RubyUtils.TryUnmangleName(&quot;this_is_my_long_name&quot;) == &quot;ThisIsMyLongName&quot;);
-            Assert(RubyUtils.TryUnmangleName(&quot;&quot;) == null);
             Assert(RubyUtils.TryUnmangleName(&quot;f&quot;) == &quot;F&quot;);
-            Assert(RubyUtils.TryUnmangleName(&quot;fo&quot;) == &quot;Fo&quot;);
-            Assert(RubyUtils.TryUnmangleName(&quot;foo&quot;) == &quot;Foo&quot;);
-            Assert(RubyUtils.TryUnmangleName(&quot;foo_bar&quot;) == &quot;FooBar&quot;);
-            Assert(RubyUtils.TryUnmangleName(&quot;ma_m&quot;) == &quot;MaM&quot;);
-            Assert(RubyUtils.TryUnmangleName(&quot;initialize&quot;) == &quot;initialize&quot;);
-            Assert(RubyUtils.TryUnmangleName(&quot;Initialize&quot;) == &quot;Initialize&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;initialize&quot;) == &quot;Initialize&quot;);
+
+            // non-alpha characters are treated as lower-case letters: 
+            Assert(RubyUtils.TryUnmangleName(&quot;foo_bar=&quot;) == &quot;FooBar=&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;foo?&quot;) == &quot;Foo?&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;???&quot;) == &quot;???&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;1_2_3&quot;) == &quot;123&quot;);
+            
+            // special cases:
+            Assert(RubyUtils.TryUnmangleName(&quot;on&quot;) == &quot;On&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;up&quot;) == &quot;Up&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;in&quot;) == &quot;In&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;to&quot;) == &quot;To&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;of&quot;) == &quot;Of&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;it&quot;) == &quot;It&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;is&quot;) == &quot;Is&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;if&quot;) == &quot;If&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;go&quot;) == &quot;Go&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;do&quot;) == &quot;Do&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;by&quot;) == &quot;By&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;at&quot;) == &quot;At&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;as&quot;) == &quot;As&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;my&quot;) == &quot;My&quot;);
+            
+            Assert(RubyUtils.TryUnmangleName(&quot;ip&quot;) == &quot;IP&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;rx&quot;) == &quot;RX&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;pi&quot;) == &quot;PI&quot;);
+
+            Assert(RubyUtils.TryUnmangleName(&quot;na_n&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;nan&quot;) == &quot;Nan&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;ip_address&quot;) == &quot;IPAddress&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;i_id_id&quot;) == &quot;IIdId&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;i_ip_ip&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;ip_foo_ip&quot;) == &quot;IPFooIP&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;active_x&quot;) == &quot;ActiveX&quot;);
+
+            Assert(RubyUtils.TryUnmangleName(&quot;get_u_int16&quot;) == &quot;GetUInt16&quot;);
+            Assert(RubyUtils.TryUnmangleName(&quot;get_ui_parent_core&quot;) == &quot;GetUIParentCore&quot;);
+            
+            // TODO: ???
+            Assert(RubyUtils.TryUnmangleName(&quot;i_pv6&quot;) == &quot;IPv6&quot;);
+            
+            // names that cannot be mangled:
+            Assert(RubyUtils.TryUnmangleName(&quot;&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;IPX&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;FO&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;FOOBar&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;FooBAR&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;foo__bar&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;_foo&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;foo_&quot;) == null);
         }
 
-        public void Scenario_RubyNameMangling2() {
-            Assert(RubyUtils.MangleName(&quot;IPStack&quot;) == &quot;ip_stack&quot;); // TODO
-            Assert(RubyUtils.MangleName(&quot;Stack&quot;) == &quot;stack&quot;);
-            Assert(RubyUtils.MangleName(&quot;ThisIsMyLongName&quot;) == &quot;this_is_my_long_name&quot;);
-            Assert(RubyUtils.MangleName(&quot;&quot;) == &quot;&quot;);
-            Assert(RubyUtils.MangleName(&quot;F&quot;) == &quot;f&quot;);
-            Assert(RubyUtils.MangleName(&quot;FO&quot;) == &quot;fo&quot;);
-            Assert(RubyUtils.MangleName(&quot;FOO&quot;) == &quot;foo&quot;);
-            Assert(RubyUtils.MangleName(&quot;FOOBar&quot;) == &quot;foo_bar&quot;);
-            Assert(RubyUtils.MangleName(&quot;MaM&quot;) == &quot;ma_m&quot;);
-            Assert(RubyUtils.MangleName(&quot;foo&quot;) == &quot;foo&quot;);
-            Assert(RubyUtils.MangleName(&quot;foo_bar=&quot;) == &quot;foo_bar=&quot;);
-            Assert(RubyUtils.MangleName(&quot;initialize&quot;) == &quot;initialize&quot;);
-            Assert(RubyUtils.MangleName(&quot;Initialize&quot;) == &quot;Initialize&quot;);
+        public void NameMangling2() {
+            Assert(RubyUtils.TryMangleName(&quot;Stack&quot;) == &quot;stack&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;ThisIsMyLongName&quot;) == &quot;this_is_my_long_name&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;F&quot;) == &quot;f&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;Initialize&quot;) == &quot;initialize&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;fooBar&quot;) == &quot;foo_bar&quot;);
+
+            // characters that are not upper case letters are treated as lower-case:
+            Assert(RubyUtils.TryMangleName(&quot;Foo123bar&quot;) == &quot;foo123bar&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;123Bar&quot;) == &quot;123_bar&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;?Bar&quot;) == &quot;?_bar&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;B__&quot;) == &quot;b__&quot;);
+
+            // special cases:
+            Assert(RubyUtils.TryUnmangleName(&quot;ON&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;UP&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;IN&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;TO&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;OF&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;IT&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;IF&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;IS&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;GO&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;DO&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;BY&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;AT&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;AS&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;MY&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;ID&quot;) == null);
+            Assert(RubyUtils.TryUnmangleName(&quot;OK&quot;) == null);
+
+            Assert(RubyUtils.TryMangleName(&quot;NaN&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;NaNValue&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;At&quot;) == &quot;at&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;IP&quot;) == &quot;ip&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;FO&quot;) == &quot;fo&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;PI&quot;) == &quot;pi&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;IPAddress&quot;) == &quot;ip_address&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;MyDB&quot;) == &quot;my_db&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;PyPy&quot;) == &quot;py_py&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;IPFooIP&quot;) == &quot;ip_foo_ip&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;ActiveX&quot;) == &quot;active_x&quot;);
+
+            Assert(RubyUtils.TryMangleName(&quot;GetUInt16&quot;) == &quot;get_u_int16&quot;);
+            Assert(RubyUtils.TryMangleName(&quot;GetUIParentCore&quot;) == &quot;get_ui_parent_core&quot;);
+
+            // TODO: ???
+            Assert(RubyUtils.TryMangleName(&quot;IPv6&quot;) == &quot;i_pv6&quot;);
+
+            // names that cannot be mangled:
+            Assert(RubyUtils.TryMangleName(&quot;&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;IPX&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;FOO&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;FOOBar&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;FooBAR&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;foo&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;initialize&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;foo_bar=&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;foo__bar&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;_foo&quot;) == null);
+            Assert(RubyUtils.TryMangleName(&quot;foo_&quot;) == null);
         }
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/RubyUtilsTests.cs</filename>
    </modified>
    <modified>
      <diff>@@ -227,10 +227,21 @@ namespace IronRuby.Builtins {
                         }
                         count = Int32.Parse(format.Substring(pos1, (i - pos1)));
                         i--;
+                    } else if (c == '@' &amp;&amp; c2 == '-') {
+                        int pos1 = i;
+                        i += 2;
+                        while (i &lt; format.Length &amp;&amp; Char.IsDigit(format[i])) {
+                            i++;
+                        }
+                        count = Int32.Parse(format.Substring(pos1, (i - pos1)));
+                        i--;
                     } else if (c2 == '*') {
                         count = null;
                     } else {
                         i--;
+                        if (c == '@') {
+                            count = 0;
+                        }
                     }
                     
                     yield return new FormatDirective(c, count);</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ArrayOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -100,7 +100,7 @@ namespace IronRuby.Builtins {
         [RubyMethod(&quot;chdir&quot;, RubyMethodAttributes.PublicSingleton)]
         public static object ChangeDirectory(RubyContext/*!*/ context, object self) {
 #if !SILVERLIGHT
-            string defaultDirectory = RubyFileOps.GetHomeDirectory(context);
+            string defaultDirectory = RubyUtils.GetHomeDirectory(context.DomainManager.Platform);
             if (defaultDirectory == null)
                 throw RubyExceptions.CreateArgumentError(&quot;HOME / USERPROFILE not set&quot;);
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Dir.cs</filename>
    </modified>
    <modified>
      <diff>@@ -441,26 +441,21 @@ namespace IronRuby.Builtins {
 
         #region zip
 
-        [RubyMethod(&quot;zip&quot;)]
-        public static RubyArray/*!*/ Zip(CallSiteStorage&lt;EachSite&gt;/*!*/ each, ConversionStorage&lt;IList&gt;/*!*/ tryToA, BlockParam block,
-            object self, [NotNull]params object[] args) {
-            RubyArray results = (block == null) ? new RubyArray() : null;
+        internal static RubyArray/*!*/ Zip(CallSiteStorage&lt;EachSite&gt;/*!*/ each, ConversionStorage&lt;IList&gt;/*!*/ tryToA, BlockParam block,
+            object self, params IList[]/*!*/ args) {
 
-            // Call to_a on each argument
-            IList[] otherArrays = new IList[args.Length];
-            for (int i = 0; i &lt; args.Length; i++) {
-                otherArrays[i] = Protocols.TryConvertToArray(tryToA, args[i]);
-            }
+            RubyArray results = (block == null) ? new RubyArray() : null;
 
             int index = 0;
             Each(each, self, Proc.Create(each.Context, delegate(BlockParam/*!*/ selfBlock, object _, object item) {
                 // Collect items
-                RubyArray array = new RubyArray(otherArrays.Length + 1);
+                RubyArray array = new RubyArray(args.Length + 1);
                 array.Add(item);
-                foreach (IList otherArray in otherArrays) {
+                foreach (IList otherArray in args) {
                     if (index &lt; otherArray.Count) {
                         array.Add(otherArray[index]);
-                    } else {
+                    }
+                    else {
                         array.Add(null);
                     }
                 }
@@ -472,7 +467,8 @@ namespace IronRuby.Builtins {
                     if (block.Yield(array, out blockResult)) {
                         return blockResult;
                     }
-                } else {
+                }
+                else {
                     results.Add(array);
                 }
                 return null;
@@ -481,6 +477,19 @@ namespace IronRuby.Builtins {
             return results;
         }
 
+        [RubyMethod(&quot;zip&quot;)]
+        public static RubyArray/*!*/ Zip(CallSiteStorage&lt;EachSite&gt;/*!*/ each, ConversionStorage&lt;IList&gt;/*!*/ tryToA, BlockParam block,
+            object self, [NotNull]params object[] args) {
+
+            // Call to_a on each argument
+            IList[] otherArrays = new IList[args.Length];
+            for (int i = 0; i &lt; args.Length; i++) {
+                otherArrays[i] = args[i] as IList != null ? args[i] as IList : Protocols.TryConvertToArray(tryToA, args[i]);
+            }
+
+            return Zip(each, tryToA, block, self, otherArrays);
+        }
+
         #endregion
 
         #region TODO: count, none?, one?, first (1.9)</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Enumerable.cs</filename>
    </modified>
    <modified>
      <diff>@@ -483,146 +483,7 @@ namespace IronRuby.Builtins {
 
         #endregion
 
-        #region expand_path
-
 #if !SILVERLIGHT
-        // Algorithm to find HOME equivalents under Windows. This is equivalent to Ruby 1.9 behavior:
-        // 
-        // 1. Try get HOME
-        // 2. Try to generate HOME equivalent using HOMEDRIVE + HOMEPATH
-        // 3. Try to generate HOME equivalent from USERPROFILE
-        // 4. Try to generate HOME equivalent from Personal special folder 
-
-        internal static string/*!*/ GetHomeDirectory(RubyContext/*!*/ context) {
-            PlatformAdaptationLayer pal = context.DomainManager.Platform;
-            string result = pal.GetEnvironmentVariable(&quot;HOME&quot;);
-
-            if (result == null) {
-                string homeDrive = pal.GetEnvironmentVariable(&quot;HOMEDRIVE&quot;);
-                string homePath = pal.GetEnvironmentVariable(&quot;HOMEPATH&quot;);
-                if (homeDrive == null &amp;&amp; homePath == null) {
-                    string userEnvironment = pal.GetEnvironmentVariable(&quot;USERPROFILE&quot;);
-                    if (userEnvironment == null) {
-                        // This will always succeed with a non-null string, but it can fail
-                        // if the Personal folder was renamed or deleted. In this case it returns
-                        // an empty string.
-                        result = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
-                    } else {
-                        result = userEnvironment;
-                    }
-                } else if (homeDrive == null) {
-                    result = homePath;
-                } else if (homePath == null) {
-                    result = homeDrive;
-                } else {
-                    result = Path.Combine(homeDrive, homePath);
-                }
-            }
-            return result;
-        }
-
-        class PathExpander {
-            List&lt;string&gt; _pathComponents = new List&lt;string&gt;(); // does not include the root
-            string _root; // Typically &quot;c:/&quot; on Windows, and &quot;/&quot; on Unix
-
-            internal PathExpander(RubyContext/*!*/ context, string absoluteBasePath) {
-                Debug.Assert(RubyUtils.IsAbsolutePath(absoluteBasePath));
-                
-                string basePathAfterRoot = null;
-                _root = RubyUtils.GetPathRoot(context, absoluteBasePath, out basePathAfterRoot);
-                
-                // Normally, basePathAfterRoot[0] will not be '/', but here we deal with cases like &quot;c:////foo&quot;
-                basePathAfterRoot = basePathAfterRoot.TrimStart('/'); 
-                
-                AddRelativePath(basePathAfterRoot);
-            }
-
-            internal void AddRelativePath(string relPath) {
-                Debug.Assert(!RubyUtils.IsAbsolutePath(relPath));
-                
-                string[] relPathComponents = relPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
-
-                foreach (string pathComponent in relPathComponents) {
-                    if (pathComponent == &quot;..&quot;) {
-                        if (_pathComponents.Count == 0) {
-                            // MRI allows more pops than the base path components
-                            continue;
-                        }
-                        _pathComponents.RemoveAt(_pathComponents.Count - 1);
-                    } else if (pathComponent == &quot;.&quot;) {
-                        continue;
-                    } else {
-                        _pathComponents.Add(pathComponent);
-                    }
-                }
-            }
-
-            internal MutableString/*!*/ GetResult() {
-                StringBuilder result = new StringBuilder(_root);
-                
-                if (_pathComponents.Count &gt;= 1) {
-                    // Here we make this work:
-                    //   File.expand_path(&quot;c:/..a..&quot;) -&gt; &quot;c:/..a&quot;
-                    string lastComponent = _pathComponents[_pathComponents.Count - 1];
-                    if (RubyUtils.FileSystemUsesDriveLetters &amp;&amp; !String.IsNullOrEmpty(lastComponent.TrimEnd('.'))) {
-                        _pathComponents[_pathComponents.Count - 1] = lastComponent.TrimEnd('.');
-                    }
-                }
-
-                for(int i = 0; i &lt; _pathComponents.Count; i++) {
-                    result.Append(_pathComponents[i]);
-                    if (i &lt; (_pathComponents.Count - 1)) {
-                        result.Append('/');
-                    }
-                }
-#if DEBUG
-                _pathComponents = null;
-                _root = null;
-#endif
-                return MutableString.CreateMutable(result.ToString());
-            }
-        }
-
-        // Expand directory path - these cases exist:
-        //
-        // 1. Empty string or nil means return current directory
-        // 2. ~ with non-existent HOME directory throws exception
-        // 3. ~, ~/ or ~\ which expands to HOME
-        // 4. ~foo is left unexpanded
-        // 5. Expand to full path if path is a relative path
-        // 
-        // No attempt is made to determine whether the path is valid or not
-        // Returned path is always canonicalized to forward slashes
-
-        private static MutableString/*!*/ ExpandPath(RubyContext/*!*/ context, RubyClass/*!*/ self, MutableString/*!*/ path) {
-            if (MutableString.IsNullOrEmpty(path)) {
-                return MutableString.Create(RubyUtils.CanonicalizePath(context.DomainManager.Platform.CurrentDirectory));
-            }
-
-            int length = path.Length;
-
-            if (path.GetChar(0) == '~') {
-                if (length == 1 || (path.GetChar(1) == '/')) {
-
-                    string homeDirectory = context.DomainManager.Platform.GetEnvironmentVariable(&quot;HOME&quot;);
-                    if (homeDirectory == null) {
-                        throw RubyExceptions.CreateArgumentError(&quot;couldn't find HOME environment -- expanding `~'&quot;);
-                    }
-
-                    if (length &lt;= 2) {
-                        path = MutableString.Create(homeDirectory);
-                    } else {
-                        path = MutableString.Create(Path.Combine(homeDirectory, path.GetSlice(2).ConvertToString()));
-                    }
-                    return RubyUtils.CanonicalizePath(path);
-                } else {
-                    return path;
-                }
-            } else {
-                MutableString currentDirectory = ExpandPath(context, self, null);
-                return ExpandPath(context, self, path, currentDirectory);
-            }
-        }
 
         [RubyMethod(&quot;expand_path&quot;, RubyMethodAttributes.PublicSingleton, BuildConfig = &quot;!SILVERLIGHT&quot;)]
         public static MutableString/*!*/ ExpandPath(
@@ -631,53 +492,14 @@ namespace IronRuby.Builtins {
             [DefaultProtocol, NotNull]MutableString/*!*/ path,
             [DefaultProtocol, Optional]MutableString basePath) {
 
-            // We ignore basePath parameter if first string starts with a ~
-            if (basePath == null || path.GetFirstChar() == '~') {
-                return ExpandPath(context, self, path);
-            } 
-
-            string pathStr = RubyUtils.CanonicalizePath(path).ConvertToString();
-            string basePathStr = RubyUtils.CanonicalizePath(basePath).ConvertToString();
-            char partialDriveLetter;
-            string relativePath;
-
-            if (RubyUtils.IsAbsolutePath(pathStr)) {
-                // &quot;basePath&quot; can be ignored is &quot;path&quot; is an absolute path
-                PathExpander pathExpander = new PathExpander(context, pathStr);
-                return pathExpander.GetResult();
-            } else if (RubyUtils.HasPartialDriveLetter(pathStr, out partialDriveLetter, out relativePath)) {
-                string currentDirectory = partialDriveLetter.ToString() + &quot;:/&quot;;
-                if (DirectoryExists(context, currentDirectory)) {
-                    // File.expand_path(&quot;c:foo&quot;) returns &quot;c:/current_folder_for_c_drive/foo&quot;
-                    currentDirectory = Path.GetFullPath(partialDriveLetter.ToString() + &quot;:&quot;);
-                }
-
-                return ExpandPath(
-                    context, 
-                    self, 
-                    MutableString.CreateMutable(relativePath), 
-                    MutableString.CreateMutable(currentDirectory));
-            } else if (RubyUtils.IsAbsolutePath(basePathStr)) {
-                PathExpander pathExpander = new PathExpander(context, basePathStr);
-                pathExpander.AddRelativePath(pathStr);
-                return pathExpander.GetResult();
-            } else if (RubyUtils.HasPartialDriveLetter(basePathStr, out partialDriveLetter, out relativePath)) {
-                // First expand basePath
-                MutableString expandedBasePath = ExpandPath(context, self, basePath);
-
-                return ExpandPath(context, self, path, expandedBasePath);
-            } else {
-                // First expand basePath
-                MutableString expandedBasePath = ExpandPath(context, self, basePath);
-                Debug.Assert(RubyUtils.IsAbsolutePath(expandedBasePath.ConvertToString()));
-
-                return ExpandPath(context, self, path, expandedBasePath);
-            }
+            string result = RubyUtils.ExpandPath(
+                context.DomainManager.Platform, 
+                path.ConvertToString(),
+                basePath == null ? null : basePath.ConvertToString());
+            return MutableString.Create(result);
         }
 #endif
 
-        #endregion
-
         //lchmod
         //lchown
         //link
@@ -710,12 +532,14 @@ namespace IronRuby.Builtins {
             if (!FileExists(context, strOldPath) &amp;&amp; !DirectoryExists(context, strOldPath)) {
                 throw RubyErrno.CreateENOENT(String.Format(&quot;No such file or directory - {0}&quot;, oldPath));
             }
+
+            string strNewPath = newPath.ConvertToString();
 #if !SILVERLIGHT
-            if (ExpandPath(context, self, oldPath) == ExpandPath(context, self, newPath)) {
+            PlatformAdaptationLayer platform = context.DomainManager.Platform;
+            if (RubyUtils.ExpandPath(platform, strOldPath) == RubyUtils.ExpandPath(platform, strNewPath)) {
                 return 0;
             }
 #endif
-            string strNewPath = newPath.ConvertToString();
             if (FileExists(context, strNewPath)) {
                 Delete(self, newPath);
             }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -134,14 +134,19 @@ namespace IronRuby.Builtins {
 
 #if !SILVERLIGHT
         // Looks for RUBYSHELL and then COMSPEC under Windows
-        // It appears that COMSPEC is a special environment variable that cannot be undefined
         internal static ProcessStartInfo/*!*/ GetShell(RubyContext/*!*/ context, MutableString/*!*/ command) {
             PlatformAdaptationLayer pal = context.DomainManager.Platform;
             string shell = pal.GetEnvironmentVariable(&quot;RUBYSHELL&quot;);
             if (shell == null) {
                 shell = pal.GetEnvironmentVariable(&quot;COMSPEC&quot;);
             }
-            return new ProcessStartInfo(shell, String.Format(&quot;/C \&quot;{0}\&quot;&quot;, command.ConvertToString()));
+
+            if (shell == null) {
+                string [] commandParts = command.ConvertToString().Split(new char[] { ' ' }, 2);
+                return new ProcessStartInfo(commandParts[0], commandParts.Length == 2 ? commandParts[1] : null);
+            } else {
+                return new ProcessStartInfo(shell, String.Format(&quot;/C \&quot;{0}\&quot;&quot;, command.ConvertToString()));
+            }
         }
 
         private static MutableString/*!*/ JoinArguments(MutableString/*!*/[]/*!*/ args) {
@@ -398,12 +403,11 @@ namespace IronRuby.Builtins {
             return block.Proc.ToLambda();
         }
 
-        #region load, require
+        #region load, load_assembly, require
 
         [RubyMethod(&quot;load&quot;, RubyMethodAttributes.PrivateInstance)]
         [RubyMethod(&quot;load&quot;, RubyMethodAttributes.PublicSingleton)]
-        public static bool Load(RubyScope/*!*/ scope, object self,
-            [DefaultProtocol, NotNull]MutableString/*!*/ libraryName, [Optional]bool wrap) {
+        public static bool Load(RubyScope/*!*/ scope, object self, [DefaultProtocol, NotNull]MutableString/*!*/ libraryName, [Optional]bool wrap) {
             return scope.RubyContext.Loader.LoadFile(scope.GlobalScope.Scope, self, libraryName, wrap ? LoadFlags.LoadIsolated : LoadFlags.None);
         }
 
@@ -413,13 +417,12 @@ namespace IronRuby.Builtins {
             [DefaultProtocol, NotNull]MutableString/*!*/ assemblyName, [DefaultProtocol, Optional, NotNull]MutableString libraryNamespace) {
 
             string initializer = libraryNamespace != null ? LibraryInitializer.GetFullTypeName(libraryNamespace.ConvertToString()) : null;
-            return context.Loader.LoadAssembly(assemblyName.ConvertToString(), initializer, true, true);
+            return context.Loader.LoadAssembly(assemblyName.ConvertToString(), initializer, true, true) != null;
         }
 
         [RubyMethod(&quot;require&quot;, RubyMethodAttributes.PrivateInstance)]
         [RubyMethod(&quot;require&quot;, RubyMethodAttributes.PublicSingleton)]
-        public static bool Require(RubyScope/*!*/ scope, object self, 
-            [DefaultProtocol, NotNull]MutableString/*!*/ libraryName) {
+        public static bool Require(RubyScope/*!*/ scope, object self, [DefaultProtocol, NotNull]MutableString/*!*/ libraryName) {
             return scope.RubyContext.Loader.LoadFile(scope.GlobalScope.Scope, self, libraryName, LoadFlags.LoadOnce | LoadFlags.AppendExtensions);
         }
 
@@ -1537,7 +1540,7 @@ namespace IronRuby.Builtins {
         // thread-safe:
         [RubyMethod(&quot;method&quot;)]
         public static RubyMethod/*!*/ GetMethod(RubyContext/*!*/ context, object self, [DefaultProtocol, NotNull]string/*!*/ name) {
-            RubyMemberInfo info = context.ResolveMethod(self, name, RubyClass.IgnoreVisibility).Info;
+            RubyMemberInfo info = context.ResolveMethod(self, name, VisibilityContext.AllVisible).Info;
             if (info == null) {
                 throw RubyExceptions.CreateUndefinedMethodError(context.GetClassOf(self), name);
             }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,7 @@ using Microsoft.Scripting.Math;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
 using Microsoft.Scripting.Generation;
+using IronRuby.Runtime.Calls;
 
 namespace IronRuby.Builtins {
 
@@ -384,8 +385,8 @@ namespace IronRuby.Builtins {
 
                         // TODO: replace with a table-driven implementation
                         // TODO: visibility?
-                        bool implementsDump = _context.ResolveMethod(obj, &quot;_dump&quot;, RubyClass.IgnoreVisibility).Found;
-                        bool implementsMarshalDump = _context.ResolveMethod(obj, &quot;marshal_dump&quot;, RubyClass.IgnoreVisibility).Found;
+                        bool implementsDump = _context.ResolveMethod(obj, &quot;_dump&quot;, VisibilityContext.AllVisible).Found;
+                        bool implementsMarshalDump = _context.ResolveMethod(obj, &quot;marshal_dump&quot;, VisibilityContext.AllVisible).Found;
 
                         bool writeInstanceData = false;
                         string[] instanceNames = null;</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Marshal.cs</filename>
    </modified>
    <modified>
      <diff>@@ -266,7 +266,7 @@ namespace IronRuby.Builtins {
                         options |= MethodLookup.ReturnForwarder;
                     }
 
-                    method = module.ResolveMethodNoLock(methodName, RubyClass.IgnoreVisibility, options).Info;
+                    method = module.ResolveMethodNoLock(methodName, VisibilityContext.AllVisible, options).Info;
                     if (method == null) {
                         throw RubyExceptions.CreateNameError(RubyExceptions.FormatMethodMissingMessage(context, module, methodName));
                     }
@@ -310,7 +310,9 @@ namespace IronRuby.Builtins {
         public static RubyMethod/*!*/ DefineMethod(RubyScope/*!*/ scope, RubyModule/*!*/ self,
             [NotNull]ClrName/*!*/ methodName, [NotNull]RubyMethod/*!*/ method) {
             var result = DefineMethod(scope, self, methodName.MangledName, method);
-            self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            if (methodName.HasMangledName) {
+                self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            }
             return result;
         }
 
@@ -329,7 +331,9 @@ namespace IronRuby.Builtins {
         public static UnboundMethod/*!*/ DefineMethod(RubyScope/*!*/ scope, RubyModule/*!*/ self,
             [NotNull]ClrName/*!*/ methodName, [NotNull]UnboundMethod/*!*/ method) {
             var result = DefineMethod(scope, self, methodName.MangledName, method);
-            self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            if (methodName.HasMangledName) {
+                self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            }
             return result;
         }
 
@@ -366,7 +370,9 @@ namespace IronRuby.Builtins {
             RubyModule/*!*/ self, [NotNull]ClrName/*!*/ methodName) {
 
             var result = DefineMethod(scope, block, self, methodName.MangledName);
-            self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            if (methodName.HasMangledName) {
+                self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            }
             return result;
         }
 
@@ -386,7 +392,9 @@ namespace IronRuby.Builtins {
             [NotNull]ClrName/*!*/ methodName, [NotNull]Proc/*!*/ method) {
 
             var result = DefineMethod(scope, self, methodName.MangledName, method);
-            self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            if (methodName.HasMangledName) {
+                self.AddMethodAlias(methodName.ActualName, methodName.MangledName);
+            }
             return result;
         }
 
@@ -528,7 +536,7 @@ namespace IronRuby.Builtins {
         // thread-safe:
         [RubyMethod(&quot;undef_method&quot;, RubyMethodAttributes.PrivateInstance)]
         public static RubyModule/*!*/ UndefineMethod(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
-            if (!self.ResolveMethod(methodName, RubyClass.IgnoreVisibility).Found) {
+            if (!self.ResolveMethod(methodName, VisibilityContext.AllVisible).Found) {
                 throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
             }
             self.UndefineMethod(methodName);
@@ -882,28 +890,28 @@ namespace IronRuby.Builtins {
         // thread-safe:
         [RubyMethod(&quot;method_defined?&quot;)]
         public static bool MethodDefined(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
-            RubyMemberInfo method = self.ResolveMethod(methodName, RubyClass.IgnoreVisibility).Info;
+            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;
             return method != null &amp;&amp; method.Visibility != RubyMethodVisibility.Private;
         }
 
         // thread-safe:
         [RubyMethod(&quot;private_method_defined?&quot;)]
         public static bool PrivateMethodDefined(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
-            RubyMemberInfo method = self.ResolveMethod(methodName, RubyClass.IgnoreVisibility).Info;
+            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;
             return method != null &amp;&amp; method.Visibility == RubyMethodVisibility.Private;
         }
 
         // thread-safe:
         [RubyMethod(&quot;protected_method_defined?&quot;)]
         public static bool ProtectedMethodDefined(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
-            RubyMemberInfo method = self.ResolveMethod(methodName, RubyClass.IgnoreVisibility).Info;
+            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;
             return method != null &amp;&amp; method.Visibility == RubyMethodVisibility.Protected;
         }
 
         // thread-safe:
         [RubyMethod(&quot;public_method_defined?&quot;)]
         public static bool PublicMethodDefined(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
-            RubyMemberInfo method = self.ResolveMethod(methodName, RubyClass.IgnoreVisibility).Info;
+            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;
             return method != null &amp;&amp; method.Visibility == RubyMethodVisibility.Public;
         }
 
@@ -914,7 +922,7 @@ namespace IronRuby.Builtins {
         // thread-safe:
         [RubyMethod(&quot;instance_method&quot;)]
         public static UnboundMethod/*!*/ GetInstanceMethod(RubyModule/*!*/ self, [DefaultProtocol, NotNull]string/*!*/ methodName) {
-            RubyMemberInfo method = self.ResolveMethod(methodName, RubyClass.IgnoreVisibility).Info;
+            RubyMemberInfo method = self.ResolveMethod(methodName, VisibilityContext.AllVisible).Info;
             if (method == null) {
                 throw RubyExceptions.CreateUndefinedMethodError(self, methodName);
             }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ModuleOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -2613,7 +2613,15 @@ namespace IronRuby.Builtins {
                     int nilCount = 0;
                     switch (directive.Directive) {
                         case '@':
-                            stream.Position = directive.Count.HasValue ? directive.Count.Value : stream.Position;
+                            if (directive.Count.HasValue) {
+                                if (directive.Count.Value &gt; stream.Length) {
+                                    throw RubyExceptions.CreateArgumentError(&quot;@ outside of string&quot;);
+                                }
+                                stream.Position = directive.Count.Value &gt; 0 ? directive.Count.Value : 0;
+                            }
+                            else {
+                                stream.Position = stream.Length;
+                            }
                             break;
 
                         case 'A':
@@ -2683,6 +2691,9 @@ namespace IronRuby.Builtins {
                             for (int pos = 0; pos &lt; count; pos++) {
                                 if (buffer[pos] == 0) {
                                     str.Remove(pos, count - pos);
+                                    if (!directive.Count.HasValue) {
+                                        stream.Seek(pos - count + 1, SeekOrigin.End);
+                                    }
                                     break;
                                 }
                             }
@@ -2755,6 +2766,55 @@ namespace IronRuby.Builtins {
                             }
                             break;
 
+                        case 'q':
+                            count = CalculateCounts(stream, directive.Count, sizeof(long), out nilCount);
+                            for (int j = 0; j &lt; count; j++) {
+                                long value = reader.ReadInt64();
+                                if (!BitConverter.IsLittleEndian) {
+                                    ulong uvalue = (ulong)value;
+                                    uvalue = (0x00000000000000FF &amp; (uvalue &gt;&gt; 56)) |
+                                             (0x000000000000FF00 &amp; (uvalue &gt;&gt; 40)) |
+                                             (0x0000000000FF0000 &amp; (uvalue &gt;&gt; 24)) |
+                                             (0x00000000FF000000 &amp; (uvalue &gt;&gt; 8))  |
+                                             (0x000000FF00000000 &amp; (uvalue &lt;&lt; 8))  |
+                                             (0x0000FF0000000000 &amp; (uvalue &lt;&lt; 24)) |
+                                             (0x00FF000000000000 &amp; (uvalue &lt;&lt; 40)) |
+                                             (0xFF00000000000000 &amp; (uvalue &lt;&lt; 56));
+                                    value = (long)uvalue;
+                                }
+                                if (value &lt;= Int32.MaxValue &amp;&amp; value &gt;= Int32.MinValue) {
+                                    result.Add((int)value);
+                                }
+                                else {
+                                    result.Add((BigInteger)value);
+                                }
+                            }
+                            break;
+
+                        case 'Q':
+                            count = CalculateCounts(stream, directive.Count, sizeof(ulong), out nilCount);
+                            nilCount = 0;
+                            for (int j = 0; j &lt; count; j++) {
+                                ulong value = reader.ReadUInt64();
+                                if (!BitConverter.IsLittleEndian) {
+                                    value = (0x00000000000000FF &amp; (value &gt;&gt; 56)) |
+                                            (0x000000000000FF00 &amp; (value &gt;&gt; 40)) |
+                                            (0x0000000000FF0000 &amp; (value &gt;&gt; 24)) |
+                                            (0x00000000FF000000 &amp; (value &gt;&gt; 8))  |
+                                            (0x000000FF00000000 &amp; (value &lt;&lt; 8))  |
+                                            (0x0000FF0000000000 &amp; (value &lt;&lt; 24)) |
+                                            (0x00FF000000000000 &amp; (value &lt;&lt; 40)) |
+                                            (0xFF00000000000000 &amp; (value &lt;&lt; 56));
+                                }
+                                if (value &lt;= Int32.MaxValue) {
+                                    result.Add((int)value);
+                                }
+                                else {
+                                    result.Add((BigInteger)value);
+                                }
+                            }
+                            break;
+
                         case 'm':
                             // TODO: Recognize &quot;==&quot; as end of base 64 encoding
                             int len = (int)(stream.Length - stream.Position);</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MutableStringOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -172,12 +172,21 @@ namespace IronRuby.Builtins {
         /// Divides self by other, where other is Float
         /// &lt;/summary&gt;
         /// &lt;returns&gt;self / other as Float&lt;/returns&gt;
-        [RubyMethod(&quot;/&quot;), RubyMethod(&quot;div&quot;)]
-        public static object Divide(BigInteger/*!*/ self, double other) {
+        [RubyMethod(&quot;/&quot;)]
+        public static object DivideOp(BigInteger/*!*/ self, double other) {
             return self.ToFloat64() / other;
         }
 
         /// &lt;summary&gt;
+        /// Divides self by other, where other is Float
+        /// &lt;/summary&gt;
+        /// &lt;returns&gt;self divided by other as Float&lt;/returns&gt;
+        [RubyMethod(&quot;div&quot;)]
+        public static object Divide(BigInteger/*!*/ self, double other) {
+            return DivMod(self, other)[0];
+        }
+
+        /// &lt;summary&gt;
         /// Divides self by other, where other is not a Float, Fixnum or Bignum
         /// &lt;/summary&gt;
         /// &lt;returns&gt;self / other&lt;/returns&gt;
@@ -300,6 +309,20 @@ namespace IronRuby.Builtins {
         }
 
         /// &lt;summary&gt;
+        /// Returns self modulo other, where other is Float.
+        /// &lt;/summary&gt;
+        /// &lt;returns&gt;self modulo other, as Float&lt;/returns&gt;
+        /// &lt;remarks&gt;Calls divmod directly to get the modulus.&lt;/remarks&gt;
+        [RubyMethod(&quot;%&quot;), RubyMethod(&quot;modulo&quot;)]
+        public static object Modulo(BigInteger/*!*/ self, double other) {
+            if (other == 0.0) {
+                return Double.NaN;
+            }
+            RubyArray result = DivMod(self, other);
+            return result[1];
+        }
+
+        /// &lt;summary&gt;
         /// Returns self % other, where other is not Fixnum or Bignum.
         /// &lt;/summary&gt;
         /// &lt;returns&gt;self % other, as Fixnum or Bignum&lt;/returns&gt;
@@ -343,6 +366,27 @@ namespace IronRuby.Builtins {
         }
 
         /// &lt;summary&gt;
+        /// Returns an array containing the quotient and modulus obtained by dividing self by other, where other is Float.
+        /// If &lt;code&gt;q, r = x.divmod(y)&lt;/code&gt;, then 
+        ///     &lt;code&gt;q = floor(float(x)/float(y))&lt;/code&gt;
+        ///     &lt;code&gt;x = q*y + r&lt;/code&gt;
+        /// &lt;/summary&gt;
+        /// &lt;returns&gt;[self div other, self modulo other] as RubyArray&lt;/returns&gt;
+        /// &lt;remarks&gt;Normalizes div to Fixnum as necessary&lt;/remarks&gt;
+        [RubyMethod(&quot;divmod&quot;)]
+        public static RubyArray DivMod(BigInteger/*!*/ self, double other) {
+            if (other == 0.0) {
+                throw new FloatDomainError(&quot;NaN&quot;);
+            }
+
+            double selfFloat = self.ToFloat64();
+            BigInteger div = BigInteger.Create(selfFloat / other);
+            double mod = selfFloat % other;
+
+            return RubyOps.MakeArray2(Protocols.Normalize(div), mod);
+        }
+
+        /// &lt;summary&gt;
         /// Returns an array containing the quotient and modulus obtained by dividing self by other, where other is not Fixnum or Bignum.
         /// If &lt;code&gt;q, r = x.divmod(y)&lt;/code&gt;, then 
         ///     &lt;code&gt;q = floor(float(x)/float(y))&lt;/code&gt;
@@ -374,12 +418,24 @@ namespace IronRuby.Builtins {
         }
 
         /// &lt;summary&gt;
-        /// Returns the remainder after dividing self by other, where other is not Fixnum or Bignum.
+        /// Returns the remainder after dividing self by other, where other is Float.
         /// &lt;/summary&gt;
         /// &lt;example&gt;
         /// -1234567890987654321.remainder(13731.24)   #=&gt; -9906.22531493148
         /// &lt;/example&gt;
-        /// &lt;returns&gt;Float, Fixnum or Bignum&lt;/returns&gt;
+        /// &lt;returns&gt;Float&lt;/returns&gt;
+        [RubyMethod(&quot;remainder&quot;)]
+        public static double Remainder(BigInteger/*!*/ self, double other) {
+            return self.ToFloat64() % other;
+        }
+
+        /// &lt;summary&gt;
+        /// Returns the remainder after dividing self by other, where other is not Fixnum or Bignum.
+        /// &lt;/summary&gt;
+        /// &lt;example&gt;
+        /// -1234567890987654321.remainder(13731)      #=&gt; -6966
+        /// &lt;/example&gt;
+        /// &lt;returns&gt;Fixnum or Bignum&lt;/returns&gt;
         /// &lt;remarks&gt;Coerces self and other using other.coerce(self) then dynamically invokes remainder&lt;/remarks&gt;
         [RubyMethod(&quot;remainder&quot;)]
         public static object Remainder(BinaryOpStorage/*!*/ coercionStorage, BinaryOpStorage/*!*/ binaryOpSite, object/*!*/ self, object other) {
@@ -762,7 +818,7 @@ namespace IronRuby.Builtins {
         /// &lt;/summary&gt;
         /// &lt;param name=&quot;radix&quot;&gt;An integer between 2 and 36 inclusive&lt;/param&gt;
         [RubyMethod(&quot;to_s&quot;)]
-        public static MutableString/*!*/ ToString(BigInteger/*!*/ self, uint radix) {
+        public static MutableString/*!*/ ToString(BigInteger/*!*/ self, int radix) {
             if (radix &lt; 2 || radix &gt; 36) {
                 throw RubyExceptions.CreateArgumentError(String.Format(&quot;illegal radix {0}&quot;, radix));
             }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/ClrBigInteger.cs</filename>
    </modified>
    <modified>
      <diff>@@ -88,5 +88,29 @@ namespace IronRuby.Builtins {
         public static object Compare(BinaryOpStorage/*!*/ comparisonStorage, RespondToStorage/*!*/ respondToStorage, ClrName/*!*/ self, object other) {
             return MutableStringOps.Compare(comparisonStorage, respondToStorage, self.MangledName, other);
         }
+
+        /// &lt;summary&gt;
+        /// Converts a Ruby name to PascalCase name (e.g. &quot;foo_bar&quot; to &quot;FooBar&quot;).
+        /// Returns null if the name is not a well-formed Ruby name (it contains upper-case latter or subsequent underscores).
+        /// Characters that are not upper case letters are treated as lower-case letters.
+        /// &lt;/summary&gt;
+        [RubyMethod(&quot;ruby_to_clr&quot;, RubyMethodAttributes.PublicSingleton)]
+        [RubyMethod(&quot;unmangle&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static MutableString Unmangle(RubyClass/*!*/ self, [DefaultProtocol]string/*!*/ rubyName) {
+            var clr = RubyUtils.TryUnmangleName(rubyName);
+            return clr != null ? MutableString.Create(clr) : null;
+        }
+
+        /// &lt;summary&gt;
+        /// Converts a camelCase or PascalCase name to a Ruby name (e.g. &quot;FooBar&quot; to &quot;foo_bar&quot;).
+        /// Returns null if the name is not in camelCase or PascalCase (FooBAR, foo, etc.).
+        /// Characters that are not upper case letters are treated as lower-case letters.
+        /// &lt;/summary&gt;
+        [RubyMethod(&quot;clr_to_ruby&quot;, RubyMethodAttributes.PublicSingleton)]
+        [RubyMethod(&quot;mangle&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static MutableString Mangle(RubyClass/*!*/ self, [DefaultProtocol]string/*!*/ clrName) {
+            var ruby = RubyUtils.TryMangleName(clrName);
+            return ruby != null ? MutableString.Create(ruby) : null;
+        }
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/ClrNameOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -30,6 +30,10 @@ namespace IronRuby.Builtins {
         public static object Each(BlockParam block, IEnumerable/*!*/ self) {
             foreach (object obj in self) {
                 object result;
+                if (block == null) {
+                    throw RubyExceptions.NoBlockGiven();
+                }
+
                 if (block.Yield(obj, out result)) {
                     return result;
                 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IEnumerableOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,8 @@ using Microsoft.Scripting.Utils;
 using IronRuby.Runtime;
 using IronRuby.Runtime.Calls;
 
+using EachSite = System.Func&lt;System.Runtime.CompilerServices.CallSite, object, IronRuby.Builtins.Proc, object&gt;;
+
 namespace IronRuby.Builtins {
 
     [RubyModule(Extends = typeof(IList), Restrictions = ModuleRestrictions.None)]
@@ -302,8 +304,8 @@ namespace IronRuby.Builtins {
         #region ==, &lt;=&gt;, eql?, hash
 
         [RubyMethod(&quot;==&quot;)]
-        public static bool Equals(ConversionStorage&lt;IList&gt;/*!*/ arrayTryCast, BinaryOpStorage/*!*/ equals, IList/*!*/ self, object other) {
-            IList otherAsArray = Protocols.TryCastToArray(arrayTryCast, other);
+        public static bool Equals(ConversionStorage&lt;IList&gt;/*!*/ arrayTryConvert, BinaryOpStorage/*!*/ equals, IList/*!*/ self, object other) {
+            IList otherAsArray = Protocols.TryConvertToArray(arrayTryConvert, other);
             return otherAsArray != null ? Equals(equals, self, otherAsArray) : false;
         }
 
@@ -1533,5 +1535,16 @@ namespace IronRuby.Builtins {
         }
 
         #endregion
+
+        #region zip 
+
+        [RubyMethod(&quot;zip&quot;)]
+        public static IList/*!*/ Zip(CallSiteStorage&lt;EachSite&gt;/*!*/ each, ConversionStorage&lt;IList&gt;/*!*/ tryToAry, BlockParam block,
+            object self, [DefaultProtocol, NotNull, NotNullItems]params IList[]/*!*/ args) {
+
+            return Enumerable.Zip(each, tryToAry, block, self, args);
+        }
+
+        #endregion
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,16 +19,64 @@ using IronRuby.Runtime;
 using Microsoft.Scripting.Runtime;
 using System.Diagnostics;
 using System;
+using System.Collections.Generic;
+using Microsoft.Scripting.Utils;
+using System.Reflection;
+using System.Runtime.InteropServices;
 
 namespace IronRuby.Builtins {
     [RubyModule(&quot;IronRuby&quot;, Extends = typeof(Ruby), Restrictions = ModuleRestrictions.None)]
     public static class IronRubyOps {
 
-        [RubyMethod(&quot;dlr_config&quot;, RubyMethodAttributes.PublicSingleton)]
-        public static DlrConfiguration/*!*/ GetCurrentRuntimeConfiguration(RubyContext/*!*/ context, object self) {
+        [RubyMethod(&quot;configuration&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static DlrConfiguration/*!*/ GetConfiguration(RubyContext/*!*/ context, RubyModule/*!*/ self) {
             return context.DomainManager.Configuration;
         }
 
+        [RubyMethod(&quot;globals&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static Scope/*!*/ GetGlobalScope(RubyContext/*!*/ context, RubyModule/*!*/ self) {
+            return context.DomainManager.Globals;
+        }
+
+        [RubyMethod(&quot;loaded_assemblies&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static RubyArray/*!*/ GetLoadedAssemblies(RubyContext/*!*/ context, RubyModule/*!*/ self) {
+            return new RubyArray(context.DomainManager.GetLoadedAssemblyList());
+        }
+
+        /// &lt;summary&gt;
+        /// Gets a live read-only and thread-safe dictionary that maps full paths of the loaded scripts to their scopes.
+        /// &lt;/summary&gt;
+        [RubyMethod(&quot;loaded_scripts&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static IDictionary&lt;string, Scope&gt;/*!*/ GetLoadedScripts(RubyContext/*!*/ context, RubyModule/*!*/ self) {
+            return new ReadOnlyDictionary&lt;string, Scope&gt;(context.Loader.LoadedScripts);
+        }
+
+        /// &lt;summary&gt;
+        /// The same as Kernel#require except for that it returns the loaded Assembly or Scope (even if already loaded).
+        /// &lt;/summary&gt;
+        [RubyMethod(&quot;require&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static object/*!*/ Require(RubyScope/*!*/ scope, RubyModule/*!*/ self, MutableString/*!*/ libraryName) {
+            object loaded;
+            
+            scope.RubyContext.Loader.LoadFile(
+                null, self, libraryName, LoadFlags.LoadOnce | LoadFlags.AppendExtensions | LoadFlags.ResolveLoaded, out loaded
+            );
+
+            Debug.Assert(loaded != null);
+            return loaded;
+        }
+
+        /// &lt;summary&gt;
+        /// The same as Kernel#require except for that it returns the loaded Assembly or Scope.
+        /// &lt;/summary&gt;
+        [RubyMethod(&quot;load&quot;, RubyMethodAttributes.PublicSingleton)]
+        public static object/*!*/ Load(RubyScope/*!*/ scope, RubyModule/*!*/ self, MutableString/*!*/ libraryName) {
+            object loaded;
+            scope.RubyContext.Loader.LoadFile(null, self, libraryName, LoadFlags.ResolveLoaded, out loaded);
+            Debug.Assert(loaded != null);
+            return loaded;
+        }
+
         [RubyModule(&quot;Clr&quot;, Restrictions = ModuleRestrictions.None)]
         public static class ClrOps {
             [RubyMethod(&quot;profile&quot;, RubyMethodAttributes.PublicSingleton)]</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IronRubyOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -44,8 +44,8 @@ namespace IronRuby.Builtins {
             
             // Skipped primitive: __ClassSingleton
             // Skipped primitive: __MainSingleton
-            IronRuby.Builtins.RubyModule def42 = DefineGlobalModule(&quot;Comparable&quot;, typeof(IronRuby.Builtins.Comparable), 0x00000103, LoadComparable_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyModule def33 = DefineGlobalModule(&quot;Enumerable&quot;, typeof(IronRuby.Builtins.Enumerable), 0x00000103, LoadEnumerable_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyModule def43 = DefineGlobalModule(&quot;Comparable&quot;, typeof(IronRuby.Builtins.Comparable), 0x00000103, LoadComparable_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyModule def34 = DefineGlobalModule(&quot;Enumerable&quot;, typeof(IronRuby.Builtins.Enumerable), 0x00000103, LoadEnumerable_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             IronRuby.Builtins.RubyModule def8 = DefineGlobalModule(&quot;Errno&quot;, typeof(IronRuby.Builtins.Errno), 0x00000103, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             IronRuby.Builtins.RubyModule def25 = DefineModule(&quot;File::Constants&quot;, typeof(IronRuby.Builtins.RubyFileOps.Constants), 0x00000103, null, null, LoadFile__Constants_Constants, IronRuby.Builtins.RubyModule.EmptyArray);
             DefineGlobalModule(&quot;FileTest&quot;, typeof(IronRuby.Builtins.FileTest), 0x00000103, null, LoadFileTest_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
@@ -63,7 +63,7 @@ namespace IronRuby.Builtins {
             DefineGlobalModule(&quot;Math&quot;, typeof(IronRuby.Builtins.RubyMath), 0x00000103, LoadMath_Instance, LoadMath_Class, LoadMath_Constants, IronRuby.Builtins.RubyModule.EmptyArray);
             ExtendClass(typeof(Microsoft.Scripting.Actions.TypeTracker), null, LoadMicrosoft__Scripting__Actions__TypeTracker_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             DefineGlobalModule(&quot;ObjectSpace&quot;, typeof(IronRuby.Builtins.ObjectSpace), 0x00000103, null, LoadObjectSpace_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyModule def39 = DefineGlobalModule(&quot;Precision&quot;, typeof(IronRuby.Builtins.Precision), 0x00000103, LoadPrecision_Instance, LoadPrecision_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyModule def40 = DefineGlobalModule(&quot;Precision&quot;, typeof(IronRuby.Builtins.Precision), 0x00000103, LoadPrecision_Instance, LoadPrecision_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
             #if !SILVERLIGHT
             IronRuby.Builtins.RubyModule def26 = DefineGlobalModule(&quot;Process&quot;, typeof(IronRuby.Builtins.RubyProcess), 0x00000103, LoadProcess_Instance, LoadProcess_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
             #endif
@@ -73,227 +73,228 @@ namespace IronRuby.Builtins {
             ExtendClass(typeof(System.Type), null, LoadSystem__Type_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             // Skipped primitive: __ClassSingletonSingleton
             #if !SILVERLIGHT
-            object def1 = DefineSingleton(Load__Singleton_ArgFilesSingletonOps_Instance, null, null, def33);
+            object def1 = DefineSingleton(Load__Singleton_ArgFilesSingletonOps_Instance, null, null, def34);
             #endif
-            object def7 = DefineSingleton(Load__Singleton_EnvironmentSingletonOps_Instance, null, null, def33);
-            ExtendClass(typeof(Microsoft.Scripting.Actions.TypeGroup), null, LoadMicrosoft__Scripting__Actions__TypeGroup_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def33});
+            object def7 = DefineSingleton(Load__Singleton_EnvironmentSingletonOps_Instance, null, null, def34);
+            ExtendClass(typeof(Microsoft.Scripting.Actions.TypeGroup), null, LoadMicrosoft__Scripting__Actions__TypeGroup_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def34});
             // Skipped primitive: Object
-            ExtendClass(typeof(System.Char), null, null, null, null, new IronRuby.Builtins.RubyModule[] {def6, def33, def42}, 
+            ExtendClass(typeof(System.Char), null, null, null, null, new IronRuby.Builtins.RubyModule[] {def6, def34, def43}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Char, System.Char&gt;(IronRuby.Builtins.CharOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Char[], System.Char&gt;(IronRuby.Builtins.CharOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.String, System.Char&gt;(IronRuby.Builtins.CharOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.Char&gt;(IronRuby.Builtins.CharOps.Create)
             );
-            ExtendModule(typeof(System.Collections.Generic.IDictionary&lt;System.Object, System.Object&gt;), LoadSystem__Collections__Generic__IDictionary_Instance, null, null, def33);
-            ExtendModule(typeof(System.Collections.IEnumerable), LoadSystem__Collections__IEnumerable_Instance, null, null, def33);
-            ExtendModule(typeof(System.Collections.IList), LoadSystem__Collections__IList_Instance, null, null, def33);
-            ExtendModule(typeof(System.IComparable), LoadSystem__IComparable_Instance, null, null, def42);
-            ExtendClass(typeof(System.String), null, null, null, null, new IronRuby.Builtins.RubyModule[] {def6, def33, def42}, 
+            ExtendModule(typeof(System.Collections.Generic.IDictionary&lt;System.Object, System.Object&gt;), LoadSystem__Collections__Generic__IDictionary_Instance, null, null, def34);
+            ExtendModule(typeof(System.Collections.IEnumerable), LoadSystem__Collections__IEnumerable_Instance, null, null, def34);
+            ExtendModule(typeof(System.Collections.IList), LoadSystem__Collections__IList_Instance, null, null, def34);
+            ExtendModule(typeof(System.IComparable), LoadSystem__IComparable_Instance, null, null, def43);
+            ExtendClass(typeof(System.String), null, null, null, null, new IronRuby.Builtins.RubyModule[] {def6, def34, def43}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.String&gt;(IronRuby.Builtins.ClrStringOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Char, System.Int32, System.String&gt;(IronRuby.Builtins.ClrStringOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Char[], System.String&gt;(IronRuby.Builtins.ClrStringOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Char[], System.Int32, System.Int32, System.String&gt;(IronRuby.Builtins.ClrStringOps.Create)
             );
-            DefineGlobalClass(&quot;Array&quot;, typeof(IronRuby.Builtins.RubyArray), 0x00000003, Context.ObjectClass, LoadArray_Instance, LoadArray_Class, null, new IronRuby.Builtins.RubyModule[] {def33}, 
+            DefineGlobalClass(&quot;Array&quot;, typeof(IronRuby.Builtins.RubyArray), 0x00000003, Context.ObjectClass, LoadArray_Instance, LoadArray_Class, null, new IronRuby.Builtins.RubyModule[] {def34}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.RubyArray&gt;(IronRuby.Builtins.ArrayOps.CreateArray), 
                 new System.Func&lt;IronRuby.Runtime.ConversionStorage&lt;IronRuby.Runtime.Union&lt;System.Collections.IList, System.Int32&gt;&gt;, IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyClass, System.Object, System.Object&gt;(IronRuby.Builtins.ArrayOps.CreateArray), 
                 new System.Func&lt;IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyClass, System.Int32, System.Object, IronRuby.Builtins.RubyArray&gt;(IronRuby.Builtins.ArrayOps.CreateArray), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.Object, IronRuby.Builtins.RubyArray&gt;(IronRuby.Builtins.ArrayOps.CreateArray)
             );
             DefineGlobalClass(&quot;Binding&quot;, typeof(IronRuby.Builtins.Binding), 0x00000003, Context.ObjectClass, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            DefineGlobalClass(&quot;Dir&quot;, typeof(IronRuby.Builtins.RubyDir), 0x00000103, Context.ObjectClass, LoadDir_Instance, LoadDir_Class, null, new IronRuby.Builtins.RubyModule[] {def33});
+            DefineGlobalClass(&quot;Dir&quot;, typeof(IronRuby.Builtins.RubyDir), 0x00000103, Context.ObjectClass, LoadDir_Instance, LoadDir_Class, null, new IronRuby.Builtins.RubyModule[] {def34});
             #if !SILVERLIGHT
             if (Context.RubyOptions.Compatibility &gt;= RubyCompatibility.Ruby19) {
             DefineGlobalClass(&quot;Encoding&quot;, typeof(IronRuby.Builtins.RubyEncoding), 0x00000003, Context.ObjectClass, LoadEncoding_Instance, LoadEncoding_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
             }
             #endif
-            IronRuby.Builtins.RubyClass def43 = Context.ExceptionClass = DefineGlobalClass(&quot;Exception&quot;, typeof(System.Exception), 0x00000003, Context.ObjectClass, LoadException_Instance, LoadException_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def44 = Context.ExceptionClass = DefineGlobalClass(&quot;Exception&quot;, typeof(System.Exception), 0x00000003, Context.ObjectClass, LoadException_Instance, LoadException_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__Exception));
             Context.FalseClass = DefineGlobalClass(&quot;FalseClass&quot;, typeof(IronRuby.Builtins.FalseClass), 0x00000103, Context.ObjectClass, LoadFalseClass_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             #if !SILVERLIGHT
-            IronRuby.Builtins.RubyClass def31 = DefineClass(&quot;File::Stat&quot;, typeof(System.IO.FileSystemInfo), 0x00000003, Context.ObjectClass, LoadFile__Stat_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def42}, 
+            IronRuby.Builtins.RubyClass def32 = DefineClass(&quot;File::Stat&quot;, typeof(System.IO.FileSystemInfo), 0x00000003, Context.ObjectClass, LoadFile__Stat_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def43}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.IO.FileSystemInfo&gt;(IronRuby.Builtins.RubyFileOps.RubyStatOps.Create)
             );
             #endif
-            DefineGlobalClass(&quot;Hash&quot;, typeof(IronRuby.Builtins.Hash), 0x00000003, Context.ObjectClass, LoadHash_Instance, LoadHash_Class, null, new IronRuby.Builtins.RubyModule[] {def33}, 
+            DefineGlobalClass(&quot;Hash&quot;, typeof(IronRuby.Builtins.Hash), 0x00000003, Context.ObjectClass, LoadHash_Instance, LoadHash_Class, null, new IronRuby.Builtins.RubyModule[] {def34}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.Hash&gt;(IronRuby.Builtins.HashOps.CreateHash), 
                 new System.Func&lt;IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyClass, System.Object, IronRuby.Builtins.Hash&gt;(IronRuby.Builtins.HashOps.CreateHash), 
                 new System.Func&lt;IronRuby.Runtime.BlockParam, IronRuby.Builtins.RubyClass, IronRuby.Builtins.Hash&gt;(IronRuby.Builtins.HashOps.CreateHash)
             );
-            IronRuby.Builtins.RubyClass def44 = DefineGlobalClass(&quot;IO&quot;, typeof(IronRuby.Builtins.RubyIO), 0x00000003, Context.ObjectClass, LoadIO_Instance, LoadIO_Class, LoadIO_Constants, new IronRuby.Builtins.RubyModule[] {def25, def33}, 
+            IronRuby.Builtins.RubyClass def45 = DefineGlobalClass(&quot;IO&quot;, typeof(IronRuby.Builtins.RubyIO), 0x00000003, Context.ObjectClass, LoadIO_Instance, LoadIO_Class, LoadIO_Constants, new IronRuby.Builtins.RubyModule[] {def25, def34}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.RubyIO&gt;(IronRuby.Builtins.RubyIOOps.CreateIO), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, IronRuby.Builtins.MutableString, IronRuby.Builtins.RubyIO&gt;(IronRuby.Builtins.RubyIOOps.CreateIO)
             );
-            IronRuby.Builtins.RubyClass def28 = DefineClass(&quot;IronRuby::Clr::Name&quot;, typeof(IronRuby.Runtime.ClrName), 0x00000003, Context.ObjectClass, LoadIronRuby__Clr__Name_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def28 = DefineClass(&quot;IronRuby::Clr::Name&quot;, typeof(IronRuby.Runtime.ClrName), 0x00000003, Context.ObjectClass, LoadIronRuby__Clr__Name_Instance, LoadIronRuby__Clr__Name_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def29 = DefineClass(&quot;IronRuby::Clr::Scope&quot;, typeof(Microsoft.Scripting.Runtime.Scope), 0x00000003, Context.ObjectClass, LoadIronRuby__Clr__Scope_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             DefineGlobalClass(&quot;MatchData&quot;, typeof(IronRuby.Builtins.MatchData), 0x00000003, Context.ObjectClass, LoadMatchData_Instance, LoadMatchData_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
             DefineGlobalClass(&quot;Method&quot;, typeof(IronRuby.Builtins.RubyMethod), 0x00000003, Context.ObjectClass, LoadMethod_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             // Skipped primitive: Module
             Context.NilClass = DefineGlobalClass(&quot;NilClass&quot;, typeof(Microsoft.Scripting.Runtime.DynamicNull), 0x00000003, Context.ObjectClass, LoadNilClass_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def38 = DefineGlobalClass(&quot;Numeric&quot;, typeof(IronRuby.Builtins.Numeric), 0x00000103, Context.ObjectClass, LoadNumeric_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def42});
+            IronRuby.Builtins.RubyClass def39 = DefineGlobalClass(&quot;Numeric&quot;, typeof(IronRuby.Builtins.Numeric), 0x00000103, Context.ObjectClass, LoadNumeric_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def43});
             DefineGlobalClass(&quot;Proc&quot;, typeof(IronRuby.Builtins.Proc), 0x00000003, Context.ObjectClass, LoadProc_Instance, LoadProc_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Action&lt;IronRuby.Builtins.RubyClass, System.Object[]&gt;(IronRuby.Builtins.ProcOps.Error)
             );
             #if !SILVERLIGHT &amp;&amp; !SILVERLIGHT
             IronRuby.Builtins.RubyClass def27 = DefineClass(&quot;Process::Status&quot;, typeof(IronRuby.Builtins.RubyProcess.Status), 0x00000103, Context.ObjectClass, LoadProcess__Status_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             #endif
-            DefineGlobalClass(&quot;Range&quot;, typeof(IronRuby.Builtins.Range), 0x00000003, Context.ObjectClass, LoadRange_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def33}, 
+            DefineGlobalClass(&quot;Range&quot;, typeof(IronRuby.Builtins.Range), 0x00000003, Context.ObjectClass, LoadRange_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def34}, 
                 new System.Func&lt;IronRuby.Runtime.BinaryOpStorage, IronRuby.Builtins.RubyClass, System.Object, System.Object, System.Boolean, IronRuby.Builtins.Range&gt;(IronRuby.Builtins.RangeOps.CreateRange)
             );
-            DefineGlobalClass(&quot;Regexp&quot;, typeof(IronRuby.Builtins.RubyRegex), 0x00000003, Context.ObjectClass, LoadRegexp_Instance, LoadRegexp_Class, LoadRegexp_Constants, new IronRuby.Builtins.RubyModule[] {def33}, 
+            DefineGlobalClass(&quot;Regexp&quot;, typeof(IronRuby.Builtins.RubyRegex), 0x00000003, Context.ObjectClass, LoadRegexp_Instance, LoadRegexp_Class, LoadRegexp_Constants, new IronRuby.Builtins.RubyModule[] {def34}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.RubyRegex, IronRuby.Builtins.RubyRegex&gt;(IronRuby.Builtins.RegexpOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.RubyRegex, System.Int32, System.Object, IronRuby.Builtins.RubyRegex&gt;(IronRuby.Builtins.RegexpOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.RubyRegex, System.Object, System.Object, IronRuby.Builtins.RubyRegex&gt;(IronRuby.Builtins.RegexpOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.Int32, IronRuby.Builtins.MutableString, IronRuby.Builtins.RubyRegex&gt;(IronRuby.Builtins.RegexpOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.Boolean, IronRuby.Builtins.MutableString, IronRuby.Builtins.RubyRegex&gt;(IronRuby.Builtins.RegexpOps.Create)
             );
-            DefineGlobalClass(&quot;String&quot;, typeof(IronRuby.Builtins.MutableString), 0x00000003, Context.ObjectClass, LoadString_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def33, def42}, 
+            DefineGlobalClass(&quot;String&quot;, typeof(IronRuby.Builtins.MutableString), 0x00000003, Context.ObjectClass, LoadString_Instance, null, null, new IronRuby.Builtins.RubyModule[] {def34, def43}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.MutableStringOps.Create), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.MutableStringOps.Create)
             );
-            DefineGlobalClass(&quot;Struct&quot;, typeof(IronRuby.Builtins.RubyStruct), 0x00000003, Context.ObjectClass, LoadStruct_Instance, LoadStruct_Class, LoadStruct_Constants, new IronRuby.Builtins.RubyModule[] {def33}, 
+            DefineGlobalClass(&quot;Struct&quot;, typeof(IronRuby.Builtins.RubyStruct), 0x00000003, Context.ObjectClass, LoadStruct_Instance, LoadStruct_Class, LoadStruct_Constants, new IronRuby.Builtins.RubyModule[] {def34}, 
                 new System.Action&lt;IronRuby.Builtins.RubyClass, System.Object[]&gt;(IronRuby.Builtins.RubyStructOps.AllocatorUndefined)
             );
             DefineGlobalClass(&quot;Symbol&quot;, typeof(Microsoft.Scripting.SymbolId), 0x00000003, Context.ObjectClass, LoadSymbol_Instance, LoadSymbol_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
             DefineGlobalClass(&quot;Thread&quot;, typeof(System.Threading.Thread), 0x00000003, Context.ObjectClass, LoadThread_Instance, LoadThread_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
             DefineGlobalClass(&quot;ThreadGroup&quot;, typeof(IronRuby.Builtins.ThreadGroup), 0x00000103, Context.ObjectClass, LoadThreadGroup_Instance, null, LoadThreadGroup_Constants, IronRuby.Builtins.RubyModule.EmptyArray);
-            DefineGlobalClass(&quot;Time&quot;, typeof(System.DateTime), 0x00000003, Context.ObjectClass, LoadTime_Instance, LoadTime_Class, null, new IronRuby.Builtins.RubyModule[] {def42}, 
+            DefineGlobalClass(&quot;Time&quot;, typeof(System.DateTime), 0x00000003, Context.ObjectClass, LoadTime_Instance, LoadTime_Class, null, new IronRuby.Builtins.RubyModule[] {def43}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.DateTime&gt;(IronRuby.Builtins.TimeOps.Create)
             );
             Context.TrueClass = DefineGlobalClass(&quot;TrueClass&quot;, typeof(IronRuby.Builtins.TrueClass), 0x00000103, Context.ObjectClass, LoadTrueClass_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             DefineGlobalClass(&quot;UnboundMethod&quot;, typeof(IronRuby.Builtins.UnboundMethod), 0x00000103, Context.ObjectClass, LoadUnboundMethod_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
             // Skipped primitive: Class
-            IronRuby.Builtins.RubyClass def24 = DefineGlobalClass(&quot;File&quot;, typeof(IronRuby.Builtins.RubyFile), 0x00000003, def44, LoadFile_Instance, LoadFile_Class, LoadFile_Constants, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def24 = DefineGlobalClass(&quot;File&quot;, typeof(IronRuby.Builtins.RubyFile), 0x00000003, def45, LoadFile_Instance, LoadFile_Class, LoadFile_Constants, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Runtime.Union&lt;System.Int32, IronRuby.Builtins.MutableString&gt;, IronRuby.Builtins.MutableString, System.Int32, IronRuby.Builtins.RubyFile&gt;(IronRuby.Builtins.RubyFileOps.CreateFile), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Runtime.Union&lt;System.Int32, IronRuby.Builtins.MutableString&gt;, System.Int32, System.Int32, IronRuby.Builtins.RubyFile&gt;(IronRuby.Builtins.RubyFileOps.CreateFile), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, IronRuby.Builtins.RubyFile&gt;(IronRuby.Builtins.RubyFileOps.CreateFile), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, IronRuby.Builtins.MutableString, IronRuby.Builtins.RubyFile&gt;(IronRuby.Builtins.RubyFileOps.CreateFile), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.Int32, IronRuby.Builtins.RubyFile&gt;(IronRuby.Builtins.RubyFileOps.CreateFile)
             );
-            DefineGlobalClass(&quot;Float&quot;, typeof(System.Double), 0x00000003, def38, LoadFloat_Instance, LoadFloat_Class, LoadFloat_Constants, new IronRuby.Builtins.RubyModule[] {def39});
-            IronRuby.Builtins.RubyClass def45 = DefineGlobalClass(&quot;Integer&quot;, typeof(IronRuby.Builtins.Integer), 0x00000103, def38, LoadInteger_Instance, LoadInteger_Class, null, new IronRuby.Builtins.RubyModule[] {def39});
-            DefineGlobalClass(&quot;NoMemoryError&quot;, typeof(IronRuby.Builtins.NoMemoryError), 0x00000103, def43, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;Float&quot;, typeof(System.Double), 0x00000003, def39, LoadFloat_Instance, LoadFloat_Class, LoadFloat_Constants, new IronRuby.Builtins.RubyModule[] {def40});
+            IronRuby.Builtins.RubyClass def46 = DefineGlobalClass(&quot;Integer&quot;, typeof(IronRuby.Builtins.Integer), 0x00000103, def39, LoadInteger_Instance, LoadInteger_Class, null, new IronRuby.Builtins.RubyModule[] {def40});
+            DefineGlobalClass(&quot;NoMemoryError&quot;, typeof(IronRuby.Builtins.NoMemoryError), 0x00000103, def44, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__NoMemoryError));
-            IronRuby.Builtins.RubyClass def41 = DefineGlobalClass(&quot;ScriptError&quot;, typeof(IronRuby.Builtins.ScriptError), 0x00000003, def43, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def42 = DefineGlobalClass(&quot;ScriptError&quot;, typeof(IronRuby.Builtins.ScriptError), 0x00000003, def44, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__ScriptError));
-            IronRuby.Builtins.RubyClass def40 = DefineGlobalClass(&quot;SignalException&quot;, typeof(IronRuby.Builtins.SignalException), 0x00000103, def43, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def41 = DefineGlobalClass(&quot;SignalException&quot;, typeof(IronRuby.Builtins.SignalException), 0x00000103, def44, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__SignalException));
-            IronRuby.Builtins.RubyClass def34 = Context.StandardErrorClass = DefineGlobalClass(&quot;StandardError&quot;, typeof(System.SystemException), 0x00000003, def43, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def35 = Context.StandardErrorClass = DefineGlobalClass(&quot;StandardError&quot;, typeof(System.SystemException), 0x00000003, def44, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__StandardError));
-            ExtendClass(typeof(System.Single), def38, LoadSystem__Single_Instance, LoadSystem__Single_Class, null, new IronRuby.Builtins.RubyModule[] {def39}, 
+            ExtendClass(typeof(System.Single), def39, LoadSystem__Single_Instance, LoadSystem__Single_Class, null, new IronRuby.Builtins.RubyModule[] {def40}, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.Single&gt;(IronRuby.Builtins.SingleOps.Create)
             );
-            DefineGlobalClass(&quot;SystemExit&quot;, typeof(IronRuby.Builtins.SystemExit), 0x00000003, def43, LoadSystemExit_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;SystemExit&quot;, typeof(IronRuby.Builtins.SystemExit), 0x00000003, def44, LoadSystemExit_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, IronRuby.Builtins.SystemExit&gt;(IronRuby.Builtins.SystemExitOps.Factory), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.Object, IronRuby.Builtins.SystemExit&gt;(IronRuby.Builtins.SystemExitOps.Factory)
             );
-            DefineGlobalClass(&quot;ArgumentError&quot;, typeof(System.ArgumentException), 0x00000003, def34, LoadArgumentError_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;ArgumentError&quot;, typeof(System.ArgumentException), 0x00000003, def35, LoadArgumentError_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__ArgumentError));
-            DefineGlobalClass(&quot;Bignum&quot;, typeof(Microsoft.Scripting.Math.BigInteger), 0x00000003, def45, LoadBignum_Instance, LoadBignum_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            DefineGlobalClass(&quot;EncodingError&quot;, typeof(IronRuby.Builtins.EncodingError), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;Bignum&quot;, typeof(Microsoft.Scripting.Math.BigInteger), 0x00000003, def46, LoadBignum_Instance, LoadBignum_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            DefineGlobalClass(&quot;EncodingError&quot;, typeof(IronRuby.Builtins.EncodingError), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__EncodingError));
-            DefineGlobalClass(&quot;Fixnum&quot;, typeof(System.Int32), 0x00000003, def45, LoadFixnum_Instance, LoadFixnum_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            DefineGlobalClass(&quot;IndexError&quot;, typeof(System.IndexOutOfRangeException), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;Fixnum&quot;, typeof(System.Int32), 0x00000003, def46, LoadFixnum_Instance, LoadFixnum_Class, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            DefineGlobalClass(&quot;IndexError&quot;, typeof(System.IndexOutOfRangeException), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__IndexError));
-            DefineGlobalClass(&quot;Interrupt&quot;, typeof(IronRuby.Builtins.Interrupt), 0x00000103, def40, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;Interrupt&quot;, typeof(IronRuby.Builtins.Interrupt), 0x00000103, def41, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__Interrupt));
-            IronRuby.Builtins.RubyClass def35 = DefineGlobalClass(&quot;IOError&quot;, typeof(System.IO.IOException), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def36 = DefineGlobalClass(&quot;IOError&quot;, typeof(System.IO.IOException), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__IOError));
-            DefineGlobalClass(&quot;LoadError&quot;, typeof(IronRuby.Builtins.LoadError), 0x00000003, def41, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;LoadError&quot;, typeof(IronRuby.Builtins.LoadError), 0x00000003, def42, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__LoadError));
-            DefineGlobalClass(&quot;LocalJumpError&quot;, typeof(IronRuby.Builtins.LocalJumpError), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;LocalJumpError&quot;, typeof(IronRuby.Builtins.LocalJumpError), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__LocalJumpError));
-            IronRuby.Builtins.RubyClass def46 = DefineGlobalClass(&quot;NameError&quot;, typeof(System.MemberAccessException), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def47 = DefineGlobalClass(&quot;NameError&quot;, typeof(System.MemberAccessException), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__NameError));
-            DefineGlobalClass(&quot;NotImplementedError&quot;, typeof(IronRuby.Builtins.NotImplementedError), 0x00000003, def41, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;NotImplementedError&quot;, typeof(IronRuby.Builtins.NotImplementedError), 0x00000003, def42, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__NotImplementedError));
-            IronRuby.Builtins.RubyClass def37 = DefineGlobalClass(&quot;RangeError&quot;, typeof(System.ArgumentOutOfRangeException), 0x00000003, def34, LoadRangeError_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def38 = DefineGlobalClass(&quot;RangeError&quot;, typeof(System.ArgumentOutOfRangeException), 0x00000003, def35, LoadRangeError_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__RangeError));
-            DefineGlobalClass(&quot;RegexpError&quot;, typeof(IronRuby.Builtins.RegexpError), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;RegexpError&quot;, typeof(IronRuby.Builtins.RegexpError), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__RegexpError));
-            DefineGlobalClass(&quot;RuntimeError&quot;, typeof(IronRuby.Builtins.RuntimeError), 0x00000103, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;RuntimeError&quot;, typeof(IronRuby.Builtins.RuntimeError), 0x00000103, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__RuntimeError));
-            DefineGlobalClass(&quot;SecurityError&quot;, typeof(System.Security.SecurityException), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;SecurityError&quot;, typeof(System.Security.SecurityException), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__SecurityError));
-            DefineGlobalClass(&quot;SyntaxError&quot;, typeof(IronRuby.Builtins.SyntaxError), 0x00000003, def41, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;SyntaxError&quot;, typeof(IronRuby.Builtins.SyntaxError), 0x00000003, def42, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__SyntaxError));
-            ExtendClass(typeof(System.Byte), def45, LoadSystem__Byte_Instance, LoadSystem__Byte_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            ExtendClass(typeof(System.Byte), def46, LoadSystem__Byte_Instance, LoadSystem__Byte_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.Byte&gt;(IronRuby.Builtins.ByteOps.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, Microsoft.Scripting.Math.BigInteger, System.Byte&gt;(IronRuby.Builtins.ByteOps.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.Byte&gt;(IronRuby.Builtins.ByteOps.InducedFrom)
             );
-            ExtendClass(typeof(System.Int16), def45, LoadSystem__Int16_Instance, LoadSystem__Int16_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            ExtendClass(typeof(System.Int16), def46, LoadSystem__Int16_Instance, LoadSystem__Int16_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.Int16&gt;(IronRuby.Builtins.Int16Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, Microsoft.Scripting.Math.BigInteger, System.Int16&gt;(IronRuby.Builtins.Int16Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.Int16&gt;(IronRuby.Builtins.Int16Ops.InducedFrom)
             );
-            ExtendClass(typeof(System.Int64), def45, LoadSystem__Int64_Instance, LoadSystem__Int64_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            ExtendClass(typeof(System.Int64), def46, LoadSystem__Int64_Instance, LoadSystem__Int64_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.Int64&gt;(IronRuby.Builtins.Int64Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, Microsoft.Scripting.Math.BigInteger, System.Int64&gt;(IronRuby.Builtins.Int64Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.Int64&gt;(IronRuby.Builtins.Int64Ops.InducedFrom)
             );
-            ExtendClass(typeof(System.SByte), def45, LoadSystem__SByte_Instance, LoadSystem__SByte_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            ExtendClass(typeof(System.SByte), def46, LoadSystem__SByte_Instance, LoadSystem__SByte_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.SByte&gt;(IronRuby.Builtins.SByteOps.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, Microsoft.Scripting.Math.BigInteger, System.SByte&gt;(IronRuby.Builtins.SByteOps.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.SByte&gt;(IronRuby.Builtins.SByteOps.InducedFrom)
             );
-            ExtendClass(typeof(System.UInt16), def45, LoadSystem__UInt16_Instance, LoadSystem__UInt16_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            ExtendClass(typeof(System.UInt16), def46, LoadSystem__UInt16_Instance, LoadSystem__UInt16_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.UInt16&gt;(IronRuby.Builtins.UInt16Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, Microsoft.Scripting.Math.BigInteger, System.UInt16&gt;(IronRuby.Builtins.UInt16Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.UInt16&gt;(IronRuby.Builtins.UInt16Ops.InducedFrom)
             );
-            ExtendClass(typeof(System.UInt32), def45, LoadSystem__UInt32_Instance, LoadSystem__UInt32_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            ExtendClass(typeof(System.UInt32), def46, LoadSystem__UInt32_Instance, LoadSystem__UInt32_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.UInt32&gt;(IronRuby.Builtins.UInt32Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, Microsoft.Scripting.Math.BigInteger, System.UInt32&gt;(IronRuby.Builtins.UInt32Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.UInt32&gt;(IronRuby.Builtins.UInt32Ops.InducedFrom)
             );
-            ExtendClass(typeof(System.UInt64), def45, LoadSystem__UInt64_Instance, LoadSystem__UInt64_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            ExtendClass(typeof(System.UInt64), def46, LoadSystem__UInt64_Instance, LoadSystem__UInt64_Class, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.UInt64&gt;(IronRuby.Builtins.UInt64Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, Microsoft.Scripting.Math.BigInteger, System.UInt64&gt;(IronRuby.Builtins.UInt64Ops.InducedFrom), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Double, System.UInt64&gt;(IronRuby.Builtins.UInt64Ops.InducedFrom)
             );
-            IronRuby.Builtins.RubyClass def36 = DefineGlobalClass(&quot;SystemCallError&quot;, typeof(System.Runtime.InteropServices.ExternalException), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def37 = DefineGlobalClass(&quot;SystemCallError&quot;, typeof(System.Runtime.InteropServices.ExternalException), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.Runtime.InteropServices.ExternalException&gt;(IronRuby.Builtins.SystemCallErrorOps.Factory), 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, System.Int32, System.Runtime.InteropServices.ExternalException&gt;(IronRuby.Builtins.SystemCallErrorOps.Factory)
             );
-            DefineGlobalClass(&quot;SystemStackError&quot;, typeof(IronRuby.Builtins.SystemStackError), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;SystemStackError&quot;, typeof(IronRuby.Builtins.SystemStackError), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__SystemStackError));
-            DefineGlobalClass(&quot;ThreadError&quot;, typeof(IronRuby.Builtins.ThreadError), 0x00000103, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;ThreadError&quot;, typeof(IronRuby.Builtins.ThreadError), 0x00000103, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__ThreadError));
-            DefineGlobalClass(&quot;TypeError&quot;, typeof(System.InvalidOperationException), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;TypeError&quot;, typeof(System.InvalidOperationException), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__TypeError));
-            DefineGlobalClass(&quot;ZeroDivisionError&quot;, typeof(System.DivideByZeroException), 0x00000003, def34, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;ZeroDivisionError&quot;, typeof(System.DivideByZeroException), 0x00000003, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__ZeroDivisionError));
-            DefineGlobalClass(&quot;EOFError&quot;, typeof(IronRuby.Builtins.EOFError), 0x00000103, def35, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;EOFError&quot;, typeof(IronRuby.Builtins.EOFError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__EOFError));
-            IronRuby.Builtins.RubyClass def32 = DefineClass(&quot;Errno::EACCES&quot;, typeof(System.UnauthorizedAccessException), 0x00000003, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def33 = DefineClass(&quot;Errno::EACCES&quot;, typeof(System.UnauthorizedAccessException), 0x00000003, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.UnauthorizedAccessException&gt;(IronRuby.Builtins.Errno.UnauthorizedAccessExceptionOps.Create)
             );
-            IronRuby.Builtins.RubyClass def9 = DefineClass(&quot;Errno::EADDRINUSE&quot;, typeof(IronRuby.Builtins.Errno.AddressInUseError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def10 = DefineClass(&quot;Errno::EBADF&quot;, typeof(IronRuby.Builtins.Errno.BadFileDescriptorError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def11 = DefineClass(&quot;Errno::ECHILD&quot;, typeof(IronRuby.Builtins.Errno.ChildError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def12 = DefineClass(&quot;Errno::ECONNABORTED&quot;, typeof(IronRuby.Builtins.Errno.ConnectionAbortError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def13 = DefineClass(&quot;Errno::ECONNREFUSED&quot;, typeof(IronRuby.Builtins.Errno.ConnectionRefusedError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def14 = DefineClass(&quot;Errno::ECONNRESET&quot;, typeof(IronRuby.Builtins.Errno.ConnectionResetError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def15 = DefineClass(&quot;Errno::EDOM&quot;, typeof(IronRuby.Builtins.Errno.DomainError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def19 = DefineClass(&quot;Errno::EEXIST&quot;, typeof(IronRuby.Builtins.ExistError), 0x00000003, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def9 = DefineClass(&quot;Errno::EADDRINUSE&quot;, typeof(IronRuby.Builtins.Errno.AddressInUseError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def10 = DefineClass(&quot;Errno::EBADF&quot;, typeof(IronRuby.Builtins.Errno.BadFileDescriptorError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def11 = DefineClass(&quot;Errno::ECHILD&quot;, typeof(IronRuby.Builtins.Errno.ChildError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def12 = DefineClass(&quot;Errno::ECONNABORTED&quot;, typeof(IronRuby.Builtins.Errno.ConnectionAbortError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def13 = DefineClass(&quot;Errno::ECONNREFUSED&quot;, typeof(IronRuby.Builtins.Errno.ConnectionRefusedError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def14 = DefineClass(&quot;Errno::ECONNRESET&quot;, typeof(IronRuby.Builtins.Errno.ConnectionResetError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def15 = DefineClass(&quot;Errno::EDOM&quot;, typeof(IronRuby.Builtins.Errno.DomainError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def19 = DefineClass(&quot;Errno::EEXIST&quot;, typeof(IronRuby.Builtins.ExistError), 0x00000003, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, IronRuby.Builtins.ExistError&gt;(IronRuby.Builtins.Errno.ExistErrorOps.Create)
             );
-            IronRuby.Builtins.RubyClass def21 = DefineClass(&quot;Errno::EINVAL&quot;, typeof(IronRuby.Builtins.InvalidError), 0x00000003, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def21 = DefineClass(&quot;Errno::EINVAL&quot;, typeof(IronRuby.Builtins.InvalidError), 0x00000003, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, IronRuby.Builtins.InvalidError&gt;(IronRuby.Builtins.Errno.InvalidErrorOps.Create)
             );
-            IronRuby.Builtins.RubyClass def30 = DefineClass(&quot;Errno::ENOENT&quot;, typeof(System.IO.FileNotFoundException), 0x00000003, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def31 = DefineClass(&quot;Errno::ENOENT&quot;, typeof(System.IO.FileNotFoundException), 0x00000003, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.IO.FileNotFoundException&gt;(IronRuby.Builtins.Errno.FileNotFoundExceptionOps.Create)
             );
-            IronRuby.Builtins.RubyClass def17 = DefineClass(&quot;Errno::ENOTCONN&quot;, typeof(IronRuby.Builtins.Errno.NotConnectedError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def29 = DefineClass(&quot;Errno::ENOTDIR&quot;, typeof(System.IO.DirectoryNotFoundException), 0x00000003, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def17 = DefineClass(&quot;Errno::ENOTCONN&quot;, typeof(IronRuby.Builtins.Errno.NotConnectedError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def30 = DefineClass(&quot;Errno::ENOTDIR&quot;, typeof(System.IO.DirectoryNotFoundException), 0x00000003, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
                 new System.Func&lt;IronRuby.Builtins.RubyClass, IronRuby.Builtins.MutableString, System.IO.DirectoryNotFoundException&gt;(IronRuby.Builtins.Errno.DirectoryNotFoundExceptionOps.Create)
             );
-            IronRuby.Builtins.RubyClass def18 = DefineClass(&quot;Errno::EPIPE&quot;, typeof(IronRuby.Builtins.Errno.PipeError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            IronRuby.Builtins.RubyClass def16 = DefineClass(&quot;Errno::EXDEV&quot;, typeof(IronRuby.Builtins.Errno.ImproperLinkError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            DefineGlobalClass(&quot;ESPIPE&quot;, typeof(IronRuby.Builtins.InvalidSeekError), 0x00000103, def36, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
-            DefineGlobalClass(&quot;FloatDomainError&quot;, typeof(IronRuby.Builtins.FloatDomainError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            IronRuby.Builtins.RubyClass def18 = DefineClass(&quot;Errno::EPIPE&quot;, typeof(IronRuby.Builtins.Errno.PipeError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            IronRuby.Builtins.RubyClass def16 = DefineClass(&quot;Errno::EXDEV&quot;, typeof(IronRuby.Builtins.Errno.ImproperLinkError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            DefineGlobalClass(&quot;ESPIPE&quot;, typeof(IronRuby.Builtins.InvalidSeekError), 0x00000103, def37, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray);
+            DefineGlobalClass(&quot;FloatDomainError&quot;, typeof(IronRuby.Builtins.FloatDomainError), 0x00000103, def38, null, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__FloatDomainError));
-            DefineGlobalClass(&quot;NoMethodError&quot;, typeof(System.MissingMethodException), 0x00000003, def46, LoadNoMethodError_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
+            DefineGlobalClass(&quot;NoMethodError&quot;, typeof(System.MissingMethodException), 0x00000003, def47, LoadNoMethodError_Instance, null, null, IronRuby.Builtins.RubyModule.EmptyArray, 
             new System.Func&lt;IronRuby.Builtins.RubyClass, System.Object, System.Exception&gt;(BuiltinsLibraryInitializer.ExceptionFactory__NoMethodError));
             def24.SetBuiltinConstant(&quot;Constants&quot;, def25);
             def22.SetBuiltinConstant(&quot;Clr&quot;, def2);
@@ -308,13 +309,14 @@ namespace IronRuby.Builtins {
             #endif
             Context.ObjectClass.SetBuiltinConstant(&quot;ENV&quot;, def7);
             #if !SILVERLIGHT
-            def24.SetBuiltinConstant(&quot;Stat&quot;, def31);
+            def24.SetBuiltinConstant(&quot;Stat&quot;, def32);
             #endif
             def2.SetBuiltinConstant(&quot;Name&quot;, def28);
+            def2.SetBuiltinConstant(&quot;Scope&quot;, def29);
             #if !SILVERLIGHT &amp;&amp; !SILVERLIGHT
             def26.SetBuiltinConstant(&quot;Status&quot;, def27);
             #endif
-            def8.SetBuiltinConstant(&quot;EACCES&quot;, def32);
+            def8.SetBuiltinConstant(&quot;EACCES&quot;, def33);
             def8.SetBuiltinConstant(&quot;EADDRINUSE&quot;, def9);
             def8.SetBuiltinConstant(&quot;EBADF&quot;, def10);
             def8.SetBuiltinConstant(&quot;ECHILD&quot;, def11);
@@ -324,9 +326,9 @@ namespace IronRuby.Builtins {
             def8.SetBuiltinConstant(&quot;EDOM&quot;, def15);
             def8.SetBuiltinConstant(&quot;EEXIST&quot;, def19);
             def8.SetBuiltinConstant(&quot;EINVAL&quot;, def21);
-            def8.SetBuiltinConstant(&quot;ENOENT&quot;, def30);
+            def8.SetBuiltinConstant(&quot;ENOENT&quot;, def31);
             def8.SetBuiltinConstant(&quot;ENOTCONN&quot;, def17);
-            def8.SetBuiltinConstant(&quot;ENOTDIR&quot;, def29);
+            def8.SetBuiltinConstant(&quot;ENOTDIR&quot;, def30);
             def8.SetBuiltinConstant(&quot;EPIPE&quot;, def18);
             def8.SetBuiltinConstant(&quot;EXDEV&quot;, def16);
         }
@@ -1859,8 +1861,28 @@ namespace IronRuby.Builtins {
         }
         
         private static void LoadIronRuby_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
-            module.DefineLibraryMethod(&quot;dlr_config&quot;, 0x61, 
-                new System.Func&lt;IronRuby.Runtime.RubyContext, System.Object, Microsoft.Scripting.Runtime.DlrConfiguration&gt;(IronRuby.Builtins.IronRubyOps.GetCurrentRuntimeConfiguration)
+            module.DefineLibraryMethod(&quot;configuration&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Builtins.RubyModule, Microsoft.Scripting.Runtime.DlrConfiguration&gt;(IronRuby.Builtins.IronRubyOps.GetConfiguration)
+            );
+            
+            module.DefineLibraryMethod(&quot;globals&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Builtins.RubyModule, Microsoft.Scripting.Runtime.Scope&gt;(IronRuby.Builtins.IronRubyOps.GetGlobalScope)
+            );
+            
+            module.DefineLibraryMethod(&quot;load&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Runtime.RubyScope, IronRuby.Builtins.RubyModule, IronRuby.Builtins.MutableString, System.Object&gt;(IronRuby.Builtins.IronRubyOps.Load)
+            );
+            
+            module.DefineLibraryMethod(&quot;loaded_assemblies&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Builtins.RubyModule, IronRuby.Builtins.RubyArray&gt;(IronRuby.Builtins.IronRubyOps.GetLoadedAssemblies)
+            );
+            
+            module.DefineLibraryMethod(&quot;loaded_scripts&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Builtins.RubyModule, System.Collections.Generic.IDictionary&lt;System.String, Microsoft.Scripting.Runtime.Scope&gt;&gt;(IronRuby.Builtins.IronRubyOps.GetLoadedScripts)
+            );
+            
+            module.DefineLibraryMethod(&quot;require&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Runtime.RubyScope, IronRuby.Builtins.RubyModule, IronRuby.Builtins.MutableString, System.Object&gt;(IronRuby.Builtins.IronRubyOps.Require)
             );
             
         }
@@ -1882,6 +1904,7 @@ namespace IronRuby.Builtins {
             
             module.DefineLibraryMethod(&quot;%&quot;, 0x51, 
                 new System.Func&lt;Microsoft.Scripting.Math.BigInteger, Microsoft.Scripting.Math.BigInteger, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Modulo), 
+                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.Double, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Modulo), 
                 new System.Func&lt;IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.BinaryOpStorage, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.ModuloOp)
             );
             
@@ -1906,7 +1929,7 @@ namespace IronRuby.Builtins {
             
             module.DefineLibraryMethod(&quot;/&quot;, 0x51, 
                 new System.Func&lt;Microsoft.Scripting.Math.BigInteger, Microsoft.Scripting.Math.BigInteger, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Divide), 
-                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.Double, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Divide), 
+                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.Double, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.DivideOp), 
                 new System.Func&lt;IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.BinaryOpStorage, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Divide)
             );
             
@@ -1982,6 +2005,7 @@ namespace IronRuby.Builtins {
             
             module.DefineLibraryMethod(&quot;divmod&quot;, 0x51, 
                 new System.Func&lt;Microsoft.Scripting.Math.BigInteger, Microsoft.Scripting.Math.BigInteger, IronRuby.Builtins.RubyArray&gt;(IronRuby.Builtins.ClrBigInteger.DivMod), 
+                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.Double, IronRuby.Builtins.RubyArray&gt;(IronRuby.Builtins.ClrBigInteger.DivMod), 
                 new System.Func&lt;IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.BinaryOpStorage, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.DivMod)
             );
             
@@ -1997,6 +2021,7 @@ namespace IronRuby.Builtins {
             
             module.DefineLibraryMethod(&quot;modulo&quot;, 0x51, 
                 new System.Func&lt;Microsoft.Scripting.Math.BigInteger, Microsoft.Scripting.Math.BigInteger, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Modulo), 
+                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.Double, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Modulo), 
                 new System.Func&lt;IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.BinaryOpStorage, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Modulo)
             );
             
@@ -2008,6 +2033,7 @@ namespace IronRuby.Builtins {
             
             module.DefineLibraryMethod(&quot;remainder&quot;, 0x51, 
                 new System.Func&lt;Microsoft.Scripting.Math.BigInteger, Microsoft.Scripting.Math.BigInteger, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Remainder), 
+                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.Double, System.Double&gt;(IronRuby.Builtins.ClrBigInteger.Remainder), 
                 new System.Func&lt;IronRuby.Runtime.BinaryOpStorage, IronRuby.Runtime.BinaryOpStorage, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.ClrBigInteger.Remainder)
             );
             
@@ -2017,7 +2043,7 @@ namespace IronRuby.Builtins {
             
             module.DefineLibraryMethod(&quot;to_s&quot;, 0x51, 
                 new System.Func&lt;Microsoft.Scripting.Math.BigInteger, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.ClrBigInteger.ToString), 
-                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.UInt32, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.ClrBigInteger.ToString)
+                new System.Func&lt;Microsoft.Scripting.Math.BigInteger, System.Int32, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.ClrBigInteger.ToString)
             );
             
         }
@@ -2417,6 +2443,32 @@ namespace IronRuby.Builtins {
             
         }
         
+        private static void LoadIronRuby__Clr__Name_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
+            module.DefineLibraryMethod(&quot;clr_to_ruby&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Builtins.RubyClass, System.String, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.ClrNameOps.Mangle)
+            );
+            
+            module.DefineLibraryMethod(&quot;mangle&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Builtins.RubyClass, System.String, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.ClrNameOps.Mangle)
+            );
+            
+            module.DefineLibraryMethod(&quot;ruby_to_clr&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Builtins.RubyClass, System.String, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.ClrNameOps.Unmangle)
+            );
+            
+            module.DefineLibraryMethod(&quot;unmangle&quot;, 0x61, 
+                new System.Func&lt;IronRuby.Builtins.RubyClass, System.String, IronRuby.Builtins.MutableString&gt;(IronRuby.Builtins.ClrNameOps.Unmangle)
+            );
+            
+        }
+        
+        private static void LoadIronRuby__Clr__Scope_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
+            module.DefineLibraryMethod(&quot;method_missing&quot;, 0x52, 
+                new System.Func&lt;IronRuby.Runtime.RubyScope, IronRuby.Runtime.BlockParam, Microsoft.Scripting.Runtime.Scope, Microsoft.Scripting.SymbolId, System.Object[], System.Object&gt;(IronRuby.Builtins.ScopeOps.MethodMissing)
+            );
+            
+        }
+        
         private static void LoadIronRuby__Clr__String_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {
             module.DefineLibraryMethod(&quot;%&quot;, 0x51, 
                 new System.Func&lt;IronRuby.Builtins.StringFormatterSiteStorage, System.String, System.Object, System.String&gt;(IronRuby.Builtins.ClrString.Format)
@@ -2944,8 +2996,8 @@ namespace IronRuby.Builtins {
             
             #if !SILVERLIGHT
             module.DefineLibraryMethod(&quot;trap&quot;, 0x52, 
-                new System.Func&lt;IronRuby.Runtime.RubyContext, System.Object, System.Object, IronRuby.Builtins.Proc, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap), 
-                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap)
+                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap), 
+                new System.Func&lt;IronRuby.Runtime.RubyContext, System.Object, System.Object, IronRuby.Builtins.Proc, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap)
             );
             
             #endif
@@ -3179,8 +3231,8 @@ namespace IronRuby.Builtins {
             
             #if !SILVERLIGHT
             module.DefineLibraryMethod(&quot;trap&quot;, 0x61, 
-                new System.Func&lt;IronRuby.Runtime.RubyContext, System.Object, System.Object, IronRuby.Builtins.Proc, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap), 
-                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap)
+                new System.Func&lt;IronRuby.Runtime.RubyContext, IronRuby.Runtime.BlockParam, System.Object, System.Object, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap), 
+                new System.Func&lt;IronRuby.Runtime.RubyContext, System.Object, System.Object, IronRuby.Builtins.Proc, System.Object&gt;(IronRuby.Builtins.KernelOps.Trap)
             );
             
             #endif
@@ -5419,6 +5471,10 @@ namespace IronRuby.Builtins {
                 new System.Func&lt;IronRuby.Runtime.ConversionStorage&lt;System.Int32&gt;, IronRuby.Runtime.CallSiteStorage&lt;System.Func&lt;System.Runtime.CompilerServices.CallSite, IronRuby.Builtins.RubyClass, System.Object&gt;&gt;, System.Collections.IList, System.Object[], IronRuby.Builtins.RubyArray&gt;(IronRuby.Builtins.IListOps.ValuesAt)
             );
             
+            module.DefineLibraryMethod(&quot;zip&quot;, 0x51, 
+                new System.Func&lt;IronRuby.Runtime.CallSiteStorage&lt;System.Func&lt;System.Runtime.CompilerServices.CallSite, System.Object, IronRuby.Builtins.Proc, System.Object&gt;&gt;, IronRuby.Runtime.ConversionStorage&lt;System.Collections.IList&gt;, IronRuby.Runtime.BlockParam, System.Object, System.Collections.IList[], System.Collections.IList&gt;(IronRuby.Builtins.IListOps.Zip)
+            );
+            
         }
         
         private static void LoadSystem__IComparable_Instance(IronRuby.Builtins.RubyModule/*!*/ module) {</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.Build.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
   &lt;PropertyGroup&gt;
     &lt;Configuration Condition=&quot; '$(Configuration)' == '' &quot;&gt;Debug&lt;/Configuration&gt;
     &lt;Platform Condition=&quot; '$(Platform)' == '' &quot;&gt;AnyCPU&lt;/Platform&gt;
-    &lt;ProductVersion&gt;9.0.21022&lt;/ProductVersion&gt;
+    &lt;ProductVersion&gt;9.0.30729&lt;/ProductVersion&gt;
     &lt;SchemaVersion&gt;2.0&lt;/SchemaVersion&gt;
     &lt;ProjectGuid&gt;{77323B06-15A2-4CF4-8A7A-86EAA2B66498}&lt;/ProjectGuid&gt;
     &lt;OutputType&gt;Library&lt;/OutputType&gt;
@@ -132,6 +132,7 @@
     &lt;Compile Include=&quot;Extensions\IListOps.cs&quot; /&gt;
     &lt;Compile Include=&quot;Extensions\IronRubyOps.cs&quot; /&gt;
     &lt;Compile Include=&quot;Extensions\MultiDimensionalArrayOps.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Extensions\ScopeOps.cs&quot; /&gt;
     &lt;Compile Include=&quot;Extensions\SingleOps.cs&quot; /&gt;
     &lt;Compile Include=&quot;Extensions\TypeGroupOps.cs&quot; /&gt;
     &lt;Compile Include=&quot;Extensions\TypeOps.cs&quot; /&gt;</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -122,17 +122,11 @@ namespace IronRuby.StandardLibrary.OpenSsl {
                     return MutableString.Create(&quot;&quot;);
                 }
 
-                var result = new StringBuilder(length);
-
                 byte[] data = new byte[length];
                 var generator = new Crypto.RNGCryptoServiceProvider();
                 generator.GetBytes(data);
 
-                for (int i = 0; i &lt; length; i++) {
-                    result.Append(Convert.ToChar(data[i]));
-                }
-
-                return MutableString.Create(result.ToString());
+                return MutableString.CreateBinary(data);
             }
 
             // add(str, entropy) -&gt; self</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/OpenSSL/OpenSSL.cs</filename>
    </modified>
    <modified>
      <diff>@@ -107,7 +107,7 @@ namespace IronRuby.StandardLibrary.StringIO {
                 return;
             }
 
-            self.Data.String.SetByte((int)(offset - 1), (byte)ch);
+            self.Data.String.SetByte((int)(offset - 1), unchecked((byte)ch));
             self.Data.Seek(-1, System.IO.SeekOrigin.Current);
         }
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/StringIO/StringIO.cs</filename>
    </modified>
    <modified>
      <diff>@@ -49,10 +49,15 @@ namespace IronRuby.StandardLibrary.Sockets {
         }
 
         public override void Flush() {
+            if (_internalWriteBuffer.Count == 0) {
+                return;
+            }
+
             byte[] bufferedData = _internalWriteBuffer.ToArray();
             int bytesSent = _socket.Send(bufferedData);
             if (bytesSent &lt; bufferedData.Length) {
                 // TODO: Resend the rest
+                System.Diagnostics.Debug.Assert(false, &quot;Partial data sent&quot;);
             }
             _internalWriteBuffer.Clear();
         }
@@ -119,6 +124,7 @@ namespace IronRuby.StandardLibrary.Sockets {
                     Flush();
                 }
             }
+            Flush();
         }
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/socket/SocketStream.cs</filename>
    </modified>
    <modified>
      <diff>@@ -17,28 +17,24 @@ Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;IronRuby.Libraries&quot;, &quot;Libra
 EndProject
 Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;Microsoft.Scripting&quot;, &quot;..\..\Runtime\Microsoft.Scripting\Microsoft.Scripting.csproj&quot;, &quot;{EB66B766-6354-4208-A3D4-AACBDCB5C3B3}&quot;
 EndProject
-Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;IronRuby.Libraries.Yaml&quot;, &quot;..\..\..\External.LCA_RESTRICTED\Languages\IronRuby\Yaml\IronRuby.Libraries.Yaml\IronRuby.Libraries.Yaml.csproj&quot;, &quot;{AA18A245-E342-4368-A474-83178311A742}&quot;
+Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;IronRuby.Libraries.Yaml&quot;, &quot;..\..\..\External.LCA_RESTRICTED\Languages\IronRuby\yaml\IronRuby.Libraries.Yaml\IronRuby.Libraries.Yaml.csproj&quot;, &quot;{AA18A245-E342-4368-A474-83178311A742}&quot;
 EndProject
 Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;Microsoft.Scripting.ExtensionAttribute&quot;, &quot;..\..\..\..\ndp\fx\src\Core\Microsoft\Scripting\Microsoft.Scripting.ExtensionAttribute.csproj&quot;, &quot;{8B0F1074-750E-4D64-BF23-A1E0F54261E5}&quot;
 EndProject
 Project(&quot;{2150E333-8FDC-42A3-9474-1A3956D46DE8}&quot;) = &quot;Solution Items&quot;, &quot;Solution Items&quot;, &quot;{A6B6A5B5-335A-4515-8535-954DE8A953EF}&quot;
 	ProjectSection(SolutionItems) = preProject
 		Scripts\CodeGenerator.rb = Scripts\CodeGenerator.rb
-		RubyCodeCoverage.testrunconfig = RubyCodeCoverage.testrunconfig
-		RubyCodeCoverage.vsmdi = RubyCodeCoverage.vsmdi
 	EndProjectSection
 EndProject
 Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;RubySpec&quot;, &quot;Tests\RubySpec\RubySpec.csproj&quot;, &quot;{534A82C6-3EB0-4888-ABD2-A15284683E8D}&quot;
 EndProject
-Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;IronRuby.Tests.VS&quot;, &quot;IronRuby.Tests.VS\IronRuby.Tests.VS.csproj&quot;, &quot;{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}&quot;
-EndProject
 Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;Ruby.ConsoleAny&quot;, &quot;Console\Ruby.ConsoleAny.csproj&quot;, &quot;{6EE7A428-D803-41BC-8248-1297C3ACE369}&quot;
 EndProject
 Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;Microsoft.Scripting.Debugging&quot;, &quot;..\..\Debugging\Microsoft.Scripting.Debugging\Microsoft.Scripting.Debugging.csproj&quot;, &quot;{ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}&quot;
 EndProject
 Global
 	GlobalSection(TeamFoundationVersionControl) = preSolution
-		SccNumberOfProjects = 15
+		SccNumberOfProjects = 14
 		SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
 		SccTeamFoundationServer = http://vstfdevdiv:8080/
 		SccLocalPath0 = .
@@ -75,18 +71,12 @@ Global
 		SccProjectUniqueName11 = ..\\..\\..\\..\\ndp\\fx\\src\\Dynamic\\System\\Dynamic\\Microsoft.Dynamic.csproj
 		SccProjectName11 = ../../../../ndp/fx/src/Dynamic/System/Dynamic
 		SccLocalPath11 = ..\\..\\..\\..\\ndp\\fx\\src\\Dynamic\\System\\Dynamic
-		SccProjectUniqueName12 = IronRuby.Tests.VS\\IronRuby.Tests.VS.csproj
-		SccProjectName12 = IronRuby.Tests.VS
-		SccLocalPath12 = IronRuby.Tests.VS
-		SccProjectUniqueName13 = Console\\Ruby.ConsoleAny.csproj
-		SccProjectName13 = Console
-		SccLocalPath13 = Console
-		SccProjectUniqueName14 = ..\\..\\Debugging\\Microsoft.Scripting.Debugging\\Microsoft.Scripting.Debugging.csproj
-		SccProjectName14 = ../../Debugging/Microsoft.Scripting.Debugging
-		SccLocalPath14 = ..\\..\\Debugging\\Microsoft.Scripting.Debugging
-	EndGlobalSection
-	GlobalSection(TestCaseManagementSettings) = postSolution
-		CategoryFile = RubyCodeCoverage.vsmdi
+		SccProjectUniqueName12 = Console\\Ruby.ConsoleAny.csproj
+		SccProjectName12 = Console
+		SccLocalPath12 = Console
+		SccProjectUniqueName13 = ..\\..\\Debugging\\Microsoft.Scripting.Debugging\\Microsoft.Scripting.Debugging.csproj
+		SccProjectName13 = ../../Debugging/Microsoft.Scripting.Debugging
+		SccLocalPath13 = ..\\..\\Debugging\\Microsoft.Scripting.Debugging
 	EndGlobalSection
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -191,14 +181,6 @@ Global
 		{534A82C6-3EB0-4888-ABD2-A15284683E8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{534A82C6-3EB0-4888-ABD2-A15284683E8D}.Silverlight Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{534A82C6-3EB0-4888-ABD2-A15284683E8D}.Silverlight Release|Any CPU.ActiveCfg = Release|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.FxCop|Any CPU.Build.0 = Release|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.Silverlight Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{7FE874FB-A5C8-4EE6-A725-472CFA16BE7E}.Silverlight Release|Any CPU.ActiveCfg = Release|Any CPU
 		{6EE7A428-D803-41BC-8248-1297C3ACE369}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{6EE7A428-D803-41BC-8248-1297C3ACE369}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{6EE7A428-D803-41BC-8248-1297C3ACE369}.FxCop|Any CPU.ActiveCfg = Release|Any CPU</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby.sln</filename>
    </modified>
    <modified>
      <diff>@@ -35,11 +35,6 @@ using Microsoft.Scripting.Generation;
 
 namespace IronRuby.Builtins {
     public sealed partial class RubyClass : RubyModule, IDuplicable {
-        /// &lt;summary&gt;
-        /// Visibility context within which all methods are visible.
-        /// &lt;/summary&gt;
-        public const RubyClass IgnoreVisibility = null;
-
         public const string/*!*/ ClassSingletonName = &quot;__ClassSingleton&quot;;
         public const string/*!*/ ClassSingletonSingletonName = &quot;__ClassSingletonSingleton&quot;;
         public const string/*!*/ MainSingletonName = &quot;__MainSingleton&quot;;
@@ -641,7 +636,7 @@ namespace IronRuby.Builtins {
 
         internal RubyMemberInfo ResolveMethodMissingForSite(string/*!*/ name, RubyMethodVisibility incompatibleVisibility) {
             Context.RequiresClassHierarchyLock();
-            var methodMissing = ResolveMethodForSiteNoLock(Symbols.MethodMissing, null);
+            var methodMissing = ResolveMethodForSiteNoLock(Symbols.MethodMissing, VisibilityContext.AllVisible);
             if (incompatibleVisibility == RubyMethodVisibility.None) {
                 methodMissing.InvalidateSitesOnMissingMethodAddition(name, Context);
             }
@@ -1158,7 +1153,6 @@ namespace IronRuby.Builtins {
 
         #endregion
 
-
         #region Dynamic operations
 
         /// &lt;summary&gt;
@@ -1208,7 +1202,7 @@ namespace IronRuby.Builtins {
                 // check version of the class so that we invalidate the rule whenever the initializer changes:
                 metaBuilder.AddVersionTest(this);
 
-                initializer = ResolveMethodForSiteNoLock(Symbols.Initialize, IgnoreVisibility).Info;
+                initializer = ResolveMethodForSiteNoLock(Symbols.Initialize, VisibilityContext.AllVisible).Info;
 
                 // Initializer resolves to Object#initializer unless overridden in a derived class.
                 // We ensure that this method cannot be removed.
@@ -1293,8 +1287,11 @@ namespace IronRuby.Builtins {
             } else {
                 // TODO: we need more refactoring of RubyMethodGroupInfo.BuildCall to be able to inline this:
                 metaBuilder.Result = Ast.Dynamic(
-                    RubyCallAction.Make(args.RubyContext, &quot;initialize&quot;, 
-                        new RubyCallSignature(args.Signature.ArgumentCount, args.Signature.Flags | RubyCallFlags.HasImplicitSelf)
+                    RubyCallAction.Make(args.RubyContext, &quot;initialize&quot;,
+                        new RubyCallSignature(
+                            args.Signature.ArgumentCount, 
+                            (args.Signature.Flags &amp; ~RubyCallFlags.IsInteropCall) | RubyCallFlags.HasImplicitSelf
+                        )
                     ),
                     typeof(object),
                     args.GetCallSiteArguments(instanceVariable)</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs</filename>
    </modified>
    <modified>
      <diff>@@ -382,7 +382,7 @@ namespace IronRuby.Builtins {
             ContractUtils.RequiresNotNull(encoding, &quot;encoding&quot;);
             if (encoding == BinaryEncoding.Instance) {
                 return Binary;
-            } else if (encoding.ToString() == Encoding.UTF8.ToString()) {
+            } else if (encoding.ToString() == Encoding.UTF8.ToString()) {
                 return UTF8;
             } else {
                 throw new ArgumentException(String.Format(&quot;Unknown encoding: '{0}'&quot;, encoding));</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyEncoding.cs</filename>
    </modified>
    <modified>
      <diff>@@ -72,6 +72,7 @@ namespace IronRuby.Builtins {
 #if DEBUG
     [DebuggerDisplay(&quot;{DebugName}&quot;)]
 #endif
+    [DebuggerTypeProxy(typeof(RubyModule.DebugView))]
     public partial class RubyModule : IDuplicable, IRubyObject {
         [System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Security&quot;, &quot;CA2105:ArrayFieldsShouldNotBeReadOnly&quot;)]
         public static readonly RubyModule[]/*!*/ EmptyArray = new RubyModule[0];
@@ -1109,8 +1110,8 @@ namespace IronRuby.Builtins {
                 SymbolId symbol = SymbolTable.StringToId(name);
 
                 using (Context.ClassHierarchyUnlocker()) {
-                    return _context.TopGlobalScope.TryGetName(symbol, out value) 
-                        &amp;&amp; _context.TopGlobalScope.TryRemoveName(symbol);
+                    return _context.TopGlobalScope.TryGetVariable(symbol, out value) 
+                        &amp;&amp; _context.TopGlobalScope.TryRemoveVariable(symbol);
                 }
             }
 
@@ -1215,7 +1216,7 @@ namespace IronRuby.Builtins {
             RubyMemberInfo method;
             using (Context.ClassHierarchyLocker()) {
                 // MRI: aliases a super-forwarder not the real method.
-                method = ResolveMethodNoLock(oldName, RubyClass.IgnoreVisibility, MethodLookup.FallbackToObject | MethodLookup.ReturnForwarder).Info;
+                method = ResolveMethodNoLock(oldName, VisibilityContext.AllVisible, MethodLookup.FallbackToObject | MethodLookup.ReturnForwarder).Info;
                 if (method == null) {
                     throw RubyExceptions.CreateUndefinedMethodError(this, oldName);
                 }
@@ -1496,32 +1497,32 @@ namespace IronRuby.Builtins {
         }
 
         // thread-safe:
-        public MethodResolutionResult ResolveMethodForSite(string/*!*/ name, RubyClass visibilityContext) {
+        public MethodResolutionResult ResolveMethodForSite(string/*!*/ name, VisibilityContext visibility) {
             using (Context.ClassHierarchyLocker()) {
-                return ResolveMethodForSiteNoLock(name, visibilityContext);
+                return ResolveMethodForSiteNoLock(name, visibility);
             }
         }
 
         // thread-safe:
-        public MethodResolutionResult ResolveMethod(string/*!*/ name, RubyClass visibilityContext) {
+        public MethodResolutionResult ResolveMethod(string/*!*/ name, VisibilityContext visibility) {
             using (Context.ClassHierarchyLocker()) {
-                return ResolveMethodNoLock(name, visibilityContext);
+                return ResolveMethodNoLock(name, visibility);
             }
         }
 
-        public MethodResolutionResult ResolveMethodForSiteNoLock(string/*!*/ name, RubyClass visibilityContext) {
-            return ResolveMethodForSiteNoLock(name, visibilityContext, MethodLookup.Default);
+        public MethodResolutionResult ResolveMethodForSiteNoLock(string/*!*/ name, VisibilityContext visibility) {
+            return ResolveMethodForSiteNoLock(name, visibility, MethodLookup.Default);
         }
 
-        internal MethodResolutionResult ResolveMethodForSiteNoLock(string/*!*/ name, RubyClass visibilityContext, MethodLookup options) {
-            return ResolveMethodNoLock(name, visibilityContext, options).InvalidateSitesOnOverride();
+        internal MethodResolutionResult ResolveMethodForSiteNoLock(string/*!*/ name, VisibilityContext visibility, MethodLookup options) {
+            return ResolveMethodNoLock(name, visibility, options).InvalidateSitesOnOverride();
         }
 
-        public MethodResolutionResult ResolveMethodNoLock(string/*!*/ name, RubyClass visibilityContext) {
-            return ResolveMethodNoLock(name, visibilityContext, MethodLookup.Default);
+        public MethodResolutionResult ResolveMethodNoLock(string/*!*/ name, VisibilityContext visibility) {
+            return ResolveMethodNoLock(name, visibility, MethodLookup.Default);
         }
 
-        public MethodResolutionResult ResolveMethodNoLock(string/*!*/ name, RubyClass visibilityContext, MethodLookup options) {
+        public MethodResolutionResult ResolveMethodNoLock(string/*!*/ name, VisibilityContext visibility, MethodLookup options) {
             Context.RequiresClassHierarchyLock();
             Assert.NotNull(name);
 
@@ -1534,12 +1535,12 @@ namespace IronRuby.Builtins {
 
             if (ForEachAncestor((module) =&gt; {
                 owner = module;
-                foundCallerSelf |= module == visibilityContext;
+                foundCallerSelf |= module == visibility.Class;
                 return module.TryGetMethod(name, ref skipHidden, (options &amp; MethodLookup.Virtual) != 0, out info);
             })) {
                 if (info == null || info.IsUndefined) {
                     result = MethodResolutionResult.NotFound;
-                } else if (!IsMethodVisible(info, owner, visibilityContext, foundCallerSelf)) {
+                } else if (!IsMethodVisible(info, owner, visibility, foundCallerSelf)) {
                     result = new MethodResolutionResult(info, owner, false);
                 } else if (info.IsSuperForwarder) {
                     if ((options &amp; MethodLookup.ReturnForwarder) != 0) {
@@ -1557,16 +1558,18 @@ namespace IronRuby.Builtins {
 
             // Note: all classes include Object in ancestors, so we don't need to search it again:
             if (!result.Found &amp;&amp; (options &amp; MethodLookup.FallbackToObject) != 0 &amp;&amp; !IsClass) {
-                return _context.ObjectClass.ResolveMethodNoLock(name, visibilityContext, options &amp; ~MethodLookup.FallbackToObject);
+                return _context.ObjectClass.ResolveMethodNoLock(name, visibility, options &amp; ~MethodLookup.FallbackToObject);
             }
 
             return result;
         }
 
-        private bool IsMethodVisible(RubyMemberInfo/*!*/ method, RubyModule/*!*/ owner, RubyClass visibilityContext, bool foundCallerSelf) {
-            // call with implicit self =&gt; all methods are visible
-            if (visibilityContext == RubyClass.IgnoreVisibility) {
-                return true;
+        private bool IsMethodVisible(RubyMemberInfo/*!*/ method, RubyModule/*!*/ owner, VisibilityContext visibility, bool foundCallerSelf) {
+            // Visibility not constrained by a class:
+            // - call with implicit self =&gt; all methods are visible.
+            // - interop call =&gt; only public methods are visible.
+            if (visibility.Class == null) {
+                return visibility.IsVisible(method.Visibility);
             } 
             
             if (method.Visibility == RubyMethodVisibility.Protected) {
@@ -1576,7 +1579,7 @@ namespace IronRuby.Builtins {
                 }
                 // walk ancestors from caller's self class (visibilityContext)
                 // until the method owner is found or this module is found (this module is a descendant of the owner):
-                return visibilityContext.ForEachAncestor((module) =&gt; module == owner || module == this);
+                return visibility.Class.ForEachAncestor((module) =&gt; module == owner || module == this);
             } 
 
             return method.Visibility == RubyMethodVisibility.Public;
@@ -1639,7 +1642,7 @@ namespace IronRuby.Builtins {
 
             if (virtualLookup) {
                 string mangled;
-                if ((mangled = RubyUtils.MangleName(name)) != name &amp;&amp; TryGetDefinedMethod(mangled, ref skipHidden, out method)
+                if ((mangled = RubyUtils.TryMangleName(name)) != null &amp;&amp; TryGetDefinedMethod(mangled, ref skipHidden, out method)
                     &amp;&amp; method.IsRubyMember) {
                     return true;
                 }
@@ -2111,5 +2114,103 @@ namespace IronRuby.Builtins {
         }
 
         #endregion      
+
+        #region Debug View
+
+        // see: RubyObject.DebuggerDisplayValue
+        internal string/*!*/ GetDebuggerDisplayValue(object obj) {
+            return Context.Inspect(obj).ConvertToString();
+        }
+
+        // see: RubyObject.DebuggerDisplayType
+        internal string/*!*/ GetDebuggerDisplayType() {
+            return Name;
+        }
+
+        internal sealed class DebugView {
+            private readonly RubyModule/*!*/ _obj;
+
+            public DebugView(RubyModule/*!*/ obj) {
+                Assert.NotNull(obj);
+                _obj = obj;
+            }
+
+            #region RubyObjectDebugView
+
+            [DebuggerDisplay(&quot;{GetModuleName(A),nq}&quot;, Name = &quot;{GetClassKind(),nq}&quot;, Type = &quot;&quot;)]
+            public object A {
+                get { return _obj.ImmediateClass; }
+            }
+
+            [DebuggerDisplay(&quot;{B}&quot;, Name = &quot;tainted?&quot;, Type = &quot;&quot;)]
+            public bool B {
+                get { return _obj.IsTainted; }
+                set { _obj.IsTainted = value; }
+            }
+
+            [DebuggerDisplay(&quot;{C}&quot;, Name = &quot;frozen?&quot;, Type = &quot;&quot;)]
+            public bool C {
+                get { return _obj.IsFrozen; }
+                set { if (value) { _obj.Freeze(); } }
+            }
+
+            [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
+            public object D {
+                get {
+                    var instanceData = _obj.TryGetInstanceData();
+                    if (instanceData == null) {
+                        return new RubyInstanceData.VariableDebugView[0];
+                    }
+
+                    return instanceData.GetInstanceVariablesDebugView(_obj.ImmediateClass.Context);
+                }
+            }
+
+            private string GetClassKind() {
+                return _obj.ImmediateClass.IsSingletonClass ? &quot;singleton class&quot; : &quot;class&quot;;
+            }
+
+            private static string GetModuleName(object module) {
+                var m = (RubyModule)module;
+                return m != null ? m.GetDisplayName(m.Context, false).ToString() : String.Empty;
+            }
+
+            #endregion
+
+            [DebuggerDisplay(&quot;{GetModuleName(E),nq}&quot;, Name = &quot;super&quot;, Type = &quot;&quot;)]
+            public object E {
+                get { return _obj.GetSuperClass(); }
+            }
+
+            [DebuggerDisplay(&quot;&quot;, Name = &quot;mixins&quot;, Type = &quot;&quot;)]
+            public object F {
+                get { return _obj.GetMixins(); }
+            }
+
+            [DebuggerDisplay(&quot;&quot;, Name = &quot;instance methods&quot;, Type = &quot;&quot;)]
+            public object G {
+                get { return GetMethods(RubyMethodAttributes.Instance); }
+            }
+
+            [DebuggerDisplay(&quot;&quot;, Name = &quot;singleton methods&quot;, Type = &quot;&quot;)]
+            public object H {
+                get { return GetMethods(RubyMethodAttributes.Singleton); }
+            }
+
+            private Dictionary&lt;string, RubyMemberInfo&gt; GetMethods(RubyMethodAttributes attributes) {
+                // TODO: custom view for methods, sorted
+                var result = new Dictionary&lt;string, RubyMemberInfo&gt;();
+                using (_obj.Context.ClassHierarchyLocker()) {
+                    _obj.ForEachMember(false, attributes | RubyMethodAttributes.VisibilityMask, (name, _, info) =&gt; {
+                        result[name] = info;
+                    });
+                }
+                return result;
+            }
+
+            // TODO: class variables
+        }
+
+        #endregion
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyModule.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,15 +13,13 @@
  *
  * ***************************************************************************/
 
+using System.Diagnostics;
 using System.Runtime.Serialization;
-using Microsoft.Scripting.Actions;
-using Microsoft.Scripting.Runtime;
-using Microsoft.Scripting.Utils;
-using IronRuby.Runtime;
-using IronRuby.Runtime.Calls;
 using System.Security.Permissions;
 using IronRuby.Compiler.Generation;
-using System.Diagnostics;
+using IronRuby.Runtime;
+using IronRuby.Runtime.Calls;
+using Microsoft.Scripting.Utils;
 
 namespace IronRuby.Builtins {
     /// &lt;summary&gt;
@@ -29,8 +27,14 @@ namespace IronRuby.Builtins {
     /// 
     /// Note that for classes that inherit from some other class, RubyTypeDispenser gets used
     /// &lt;/summary&gt;
-    [DebuggerDisplay(&quot;{Inspect().ConvertToString()}&quot;)]
+    [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+    [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
     public partial class RubyObject : IRubyObject, IDuplicable, ISerializable {
+        internal const string ImmediateClassFieldName = &quot;_immediateClass&quot;; 
+        internal const string InstanceDataFieldName = &quot;_instanceData&quot;;
+        internal const string DebuggerDisplayValue = &quot;{&quot; + ImmediateClassFieldName + &quot;.GetDebuggerDisplayValue(this),nq}&quot;;
+        internal const string DebuggerDisplayType = &quot;{&quot; + ImmediateClassFieldName + &quot;.GetDebuggerDisplayType(),nq}&quot;;
+
         private RubyInstanceData _instanceData;
         private RubyClass/*!*/ _immediateClass;
 
@@ -93,17 +97,6 @@ namespace IronRuby.Builtins {
             return _immediateClass.Context.Inspect(this);
         }
 
-#if !SILVERLIGHT
-        protected RubyObject(SerializationInfo/*!*/ info, StreamingContext context) {
-            RubyOps.DeserializeObject(out _instanceData, out _immediateClass, info);
-        }
-
-        [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
-        public virtual void GetObjectData(SerializationInfo/*!*/ info, StreamingContext context) {
-            RubyOps.SerializeObject(_instanceData, _immediateClass, info);
-        }
-#endif
-
         protected virtual RubyObject/*!*/ CreateInstance() {
             return new RubyObject(_immediateClass.NominalClass);
         }
@@ -144,5 +137,16 @@ namespace IronRuby.Builtins {
         }
 
         #endregion
+
+#if !SILVERLIGHT
+        protected RubyObject(SerializationInfo/*!*/ info, StreamingContext context) {
+            RubyOps.DeserializeObject(out _instanceData, out _immediateClass, info);
+        }
+
+        [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
+        public virtual void GetObjectData(SerializationInfo/*!*/ info, StreamingContext context) {
+            RubyOps.SerializeObject(_instanceData, _immediateClass, info);
+        }
+#endif
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyObject.cs</filename>
    </modified>
    <modified>
      <diff>@@ -34,6 +34,8 @@ namespace IronRuby.Builtins {
     end
 #else
     public partial class /*$Class{*/Hash/*}*/ {
+        [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+        [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
         public sealed partial class Subclass : /*$Class{*/Hash/*}*/, IRubyObject {
             private RubyInstanceData _instanceData;
             private RubyClass/*!*/ _immediateClass;
@@ -83,6 +85,8 @@ namespace IronRuby.Builtins {
 #endif
 #region Generated by Subclasses.Generator.rb
     public partial class MatchData {
+        [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+        [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
         public sealed partial class Subclass : MatchData, IRubyObject {
             private RubyInstanceData _instanceData;
             private RubyClass/*!*/ _immediateClass;
@@ -130,6 +134,8 @@ namespace IronRuby.Builtins {
         }
     }
     public partial class Proc {
+        [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+        [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
         public sealed partial class Subclass : Proc, IRubyObject {
             private RubyInstanceData _instanceData;
             private RubyClass/*!*/ _immediateClass;
@@ -177,6 +183,8 @@ namespace IronRuby.Builtins {
         }
     }
     public partial class Range {
+        [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+        [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
         public sealed partial class Subclass : Range, IRubyObject {
             private RubyInstanceData _instanceData;
             private RubyClass/*!*/ _immediateClass;
@@ -224,6 +232,8 @@ namespace IronRuby.Builtins {
         }
     }
     public partial class RubyRegex {
+        [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+        [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
         public sealed partial class Subclass : RubyRegex, IRubyObject {
             private RubyInstanceData _instanceData;
             private RubyClass/*!*/ _immediateClass;
@@ -287,6 +297,8 @@ namespace IronRuby.Builtins {
     end
 #else
     public partial class /*$Class{*/MutableString/*}*/ {
+        [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+        [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
         public sealed partial class Subclass : /*$Class{*/MutableString/*}*/, IRubyObject {
             private RubyInstanceData _instanceData;
             private RubyClass/*!*/ _immediateClass;
@@ -323,6 +335,8 @@ namespace IronRuby.Builtins {
 #endif
 #region Generated by Subclasses.Generator.rb
     public partial class RubyArray {
+        [DebuggerTypeProxy(typeof(RubyObjectDebugView))]
+        [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)]
         public sealed partial class Subclass : RubyArray, IRubyObject {
             private RubyInstanceData _instanceData;
             private RubyClass/*!*/ _immediateClass;</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Builtins/Subclasses.Generated.cs</filename>
    </modified>
    <modified>
      <diff>@@ -69,8 +69,8 @@ namespace IronRuby.Compiler.Generation {
 
         internal RubyTypeBuilder(TypeBuilder/*!*/ tb) {
             _tb = tb;
-            _immediateClassField = _tb.DefineField(&quot;_immediateClass&quot;, typeof(RubyClass), FieldAttributes.Private);
-            _instanceDataField = _tb.DefineField(&quot;_instanceData&quot;, typeof(RubyInstanceData), FieldAttributes.Private);
+            _immediateClassField = _tb.DefineField(RubyObject.ImmediateClassFieldName, typeof(RubyClass), FieldAttributes.Private);
+            _instanceDataField = _tb.DefineField(RubyObject.InstanceDataFieldName, typeof(RubyInstanceData), FieldAttributes.Private);
         }
 
         public void Implement(ClsTypeEmitter/*!*/ emitter) {
@@ -286,6 +286,18 @@ namespace IronRuby.Compiler.Generation {
         private void DefineRubyObjectImplementation() {
             _tb.AddInterfaceImplementation(typeof(IRubyObject));
 
+            _tb.SetCustomAttribute(new CustomAttributeBuilder(
+                typeof(DebuggerTypeProxyAttribute).GetConstructor(new[] { typeof(Type) }),
+                new[] { typeof(RubyObjectDebugView) }
+            ));
+
+            _tb.SetCustomAttribute(new CustomAttributeBuilder(
+                typeof(DebuggerDisplayAttribute).GetConstructor(new[] { typeof(string) }),
+                new[] { RubyObject.DebuggerDisplayValue },
+                new[] { typeof(DebuggerDisplayAttribute).GetProperty(&quot;Type&quot;) },
+                new[] { RubyObject.DebuggerDisplayType }
+            ));
+
             ILGen il;
 
             // RubyClass! IRubyObject.ImmediateClass { get { return _immediateClassField; } }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Compiler/Generation/RubyTypeBuilder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -508,7 +508,7 @@ namespace IronRuby.Compiler {
         public static string/*!*/ TerminalToString(int terminal) {
             Debug.Assert(terminal &gt;= 0);
             if (((Tokens)terminal).ToString() != terminal.ToString()) {
-                return IronRuby.Runtime.RubyUtils.MangleName(((Tokens)terminal).ToString()).ToUpper();
+                return IronRuby.Runtime.RubyUtils.TryMangleName(((Tokens)terminal).ToString()).ToUpper();
             } else {
                 return CharToString((char)terminal);
             }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Compiler/Parser/Parser.cs</filename>
    </modified>
    <modified>
      <diff>@@ -67,7 +67,7 @@ namespace IronRuby.Hosting {
 
         protected override Scope/*!*/ CreateScope() {
             Scope scope = base.CreateScope();
-            scope.SetName(SymbolTable.StringToId(&quot;iron_ruby&quot;), Engine);
+            scope.SetVariable(SymbolTable.StringToId(&quot;iron_ruby&quot;), Engine);
             return scope;
         }
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Ruby.Build.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
   &lt;PropertyGroup&gt;
     &lt;Configuration Condition=&quot; '$(Configuration)' == '' &quot;&gt;Debug&lt;/Configuration&gt;
     &lt;Platform Condition=&quot; '$(Platform)' == '' &quot;&gt;AnyCPU&lt;/Platform&gt;
-    &lt;ProductVersion&gt;9.0.21022&lt;/ProductVersion&gt;
+    &lt;ProductVersion&gt;9.0.30729&lt;/ProductVersion&gt;
     &lt;SchemaVersion&gt;2.0&lt;/SchemaVersion&gt;
     &lt;ProjectGuid&gt;{7F6984B4-EE6D-4E6F-ABB1-E210D7DC4FDD}&lt;/ProjectGuid&gt;
     &lt;OutputType&gt;Library&lt;/OutputType&gt;
@@ -131,6 +131,7 @@
     &lt;Compile Include=&quot;Builtins\RubyArray.Subclass.cs&quot; /&gt;
     &lt;Compile Include=&quot;Builtins\RubyEvent.cs&quot; /&gt;
     &lt;Compile Include=&quot;Builtins\RubyIO.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Builtins\RubyObjectDebugView.cs&quot; /&gt;
     &lt;Compile Include=&quot;Builtins\RubyRegex.Subclass.cs&quot; /&gt;
     &lt;Compile Include=&quot;Builtins\MutableString.Content.cs&quot;&gt;
       &lt;SubType&gt;Code&lt;/SubType&gt;
@@ -192,6 +193,7 @@
     &lt;Compile Include=&quot;Runtime\Calls\RubyOverloadResolver.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Calls\SuperForwarderInfo.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Calls\VersionHandle.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Runtime\Calls\VisibilityContext.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\CheckedMonitor.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\ClrName.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\CustomTypeDescHelpers.cs&quot; /&gt;</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -78,7 +78,7 @@ namespace IronRuby.Runtime.Calls {
                     new[] { ToS, Symbols.MethodMissing }
                 );
 
-                conversionMethod = targetClass.ResolveMethodForSiteNoLock(ToS, RubyClass.IgnoreVisibility).Info;
+                conversionMethod = targetClass.ResolveMethodForSiteNoLock(ToS, VisibilityContext.AllVisible).Info;
 
                 // find method_missing - we need to add &quot;to_xxx&quot; methods to the missing methods table:
                 if (conversionMethod == null) {</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/ConvertToSAction.cs</filename>
    </modified>
    <modified>
      <diff>@@ -248,7 +248,7 @@ namespace IronRuby.Runtime.Calls {
                 Func&lt;DynamicMetaObject, DynamicMetaObject[], DynamicMetaObject&gt;/*!*/ fallback) {
                 Debug.Assert(fallback != null);
 
-                var callArgs = new CallArguments(context, target, args, RubyCallSignature.WithImplicitSelf(callInfo.ArgumentCount));
+                var callArgs = new CallArguments(context, target, args, RubyCallSignature.Interop(callInfo.ArgumentCount));
                 var metaBuilder = new MetaObjectBuilder(target, args);
 
                 if (!RubyCallAction.BuildCall(metaBuilder, methodName, callArgs, false, false)) {
@@ -301,7 +301,7 @@ namespace IronRuby.Runtime.Calls {
                 Func&lt;DynamicMetaObject, DynamicMetaObject&gt;/*!*/ fallback) {
                 Debug.Assert(fallback != null);
 
-                var callArgs = new CallArguments(context, target, DynamicMetaObject.EmptyMetaObjects, RubyCallSignature.WithImplicitSelf(0));
+                var callArgs = new CallArguments(context, target, DynamicMetaObject.EmptyMetaObjects, RubyCallSignature.Interop(0));
                 var metaBuilder = new MetaObjectBuilder(target);
 
                 if (!RubyCallAction.BuildAccess(metaBuilder, binder.Name, callArgs, false, false)) {
@@ -357,7 +357,7 @@ namespace IronRuby.Runtime.Calls {
                 Debug.Assert(fallback != null);
 
                 var args = new[] { value };
-                var callArgs = new CallArguments(context, target, args, RubyCallSignature.WithImplicitSelf(1));
+                var callArgs = new CallArguments(context, target, args, RubyCallSignature.Interop(1));
                 var metaBuilder = new MetaObjectBuilder(target, args);
 
                 if (!RubyCallAction.BuildCall(metaBuilder, binder.Name + &quot;=&quot;, callArgs, false, false)) {
@@ -414,7 +414,7 @@ namespace IronRuby.Runtime.Calls {
                 Func&lt;DynamicMetaObject, DynamicMetaObject[], DynamicMetaObject&gt;/*!*/ fallback) {
                 Debug.Assert(fallback != null);
                 
-                var callArgs = new CallArguments(context, target, indexes, RubyCallSignature.WithImplicitSelf(indexes.Length));
+                var callArgs = new CallArguments(context, target, indexes, RubyCallSignature.Interop(indexes.Length));
                 var metaBuilder = new MetaObjectBuilder(target, indexes);
 
                 if (!RubyCallAction.BuildCall(metaBuilder, &quot;[]&quot;, callArgs, false, false)) {
@@ -472,7 +472,7 @@ namespace IronRuby.Runtime.Calls {
 
                 var args = ArrayUtils.Append(indexes, value);
                 var callArgs = new CallArguments(context, target, args,
-                    new RubyCallSignature(indexes.Length, RubyCallFlags.HasImplicitSelf | RubyCallFlags.HasRhsArgument)
+                    new RubyCallSignature(indexes.Length, RubyCallFlags.IsInteropCall | RubyCallFlags.HasRhsArgument)
                 );
 
                 var metaBuilder = new MetaObjectBuilder(target, args);</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/InteropBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,7 @@ using Microsoft.Scripting.Utils;
 using Ast = System.Linq.Expressions.Expression;
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 using System.Collections;
+using Microsoft.Scripting.Generation;
 
 namespace IronRuby.Runtime.Calls {
     public sealed class MetaObjectBuilder {
@@ -210,10 +211,37 @@ namespace IronRuby.Runtime.Calls {
             if (value == null) {
                 return Ast.Equal(expression, AstUtils.Constant(null));
             } else {
-                return RuleBuilder.MakeTypeTestExpression(value.GetType(), expression);
+                return MakeTypeTestExpression(value.GetType(), expression);
             }
         }
 
+        public static Expression MakeTypeTestExpression(Type t, Expression expr) {
+            // we must always check for non-sealed types explicitly - otherwise we end up
+            // doing fast-path behavior on a subtype which overrides behavior that wasn't
+            // present for the base type.
+            //TODO there's a question about nulls here
+            if (CompilerHelpers.IsSealed(t) &amp;&amp; t == expr.Type) {
+                if (t.IsValueType) {
+                    return AstUtils.Constant(true);
+                }
+                return Ast.NotEqual(expr, AstUtils.Constant(null));
+            }
+
+            return Ast.AndAlso(
+                Ast.NotEqual(
+                    expr,
+                    AstUtils.Constant(null)),
+                Ast.Equal(
+                    Ast.Call(
+                        AstUtils.Convert(expr, typeof(object)),
+                        typeof(object).GetMethod(&quot;GetType&quot;)
+                    ),
+                    AstUtils.Constant(t)
+                )
+            );
+        }
+
+
         public void AddObjectTypeCondition(object value, Expression/*!*/ expression) {
             AddCondition(GetObjectTypeTestExpression(value, expression));
         }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/MetaObjectBuilder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -193,20 +193,20 @@ namespace IronRuby.Runtime.Calls {
                 );
 
                 // we can optimize if Kernel#respond_to? method is not overridden:
-                respondToMethod = targetClass.ResolveMethodForSiteNoLock(Symbols.RespondTo, RubyClass.IgnoreVisibility);
+                respondToMethod = targetClass.ResolveMethodForSiteNoLock(Symbols.RespondTo, VisibilityContext.AllVisible);
                 if (respondToMethod.Found &amp;&amp; respondToMethod.Info.DeclaringModule == targetClass.Context.KernelModule &amp;&amp; respondToMethod.Info is RubyLibraryMethodInfo) { // TODO: better override detection
                     respondToMethod = MethodResolutionResult.NotFound;
 
                     // get the first applicable conversion:
                     foreach (var conversion in conversions) {
                         selectedConversion = conversion;
-                        conversionMethod = targetClass.ResolveMethodForSiteNoLock(conversion.ToMethodName, RubyClass.IgnoreVisibility).Info;
+                        conversionMethod = targetClass.ResolveMethodForSiteNoLock(conversion.ToMethodName, VisibilityContext.AllVisible).Info;
                         if (conversionMethod != null) {
                             break;
                         } else {
                             // find method_missing - we need to add &quot;to_xxx&quot; methods to the missing methods table:
                             if (!methodMissing.Found) {
-                                methodMissing = targetClass.ResolveMethodNoLock(Symbols.MethodMissing, RubyClass.IgnoreVisibility);
+                                methodMissing = targetClass.ResolveMethodNoLock(Symbols.MethodMissing, VisibilityContext.AllVisible);
                             }
                             methodMissing.InvalidateSitesOnMissingMethodAddition(conversion.ToMethodName, targetClass.Context);
                         }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/ProtocolConversionAction.cs</filename>
    </modified>
    <modified>
      <diff>@@ -41,7 +41,7 @@ namespace IronRuby.Runtime.Calls {
 
         #region Conversions
 
-        public override Expression ConvertExpression(Expression expr, Type toType, ConversionResultKind kind, Expression context) {
+        public override Expression ConvertExpression(Expression expr, Type toType, ConversionResultKind kind, OverloadResolverFactory context) {
             throw new InvalidOperationException(&quot;OBSOLETE&quot;);
         }
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -187,23 +187,25 @@ namespace IronRuby.Runtime.Calls {
             }
         }
 
-        private static RubyClass GetVisibilityContext(RubyCallSignature callSignature, RubyScope scope) {
-            // TODO: All sites should have either implicit-self or has-scope flag set?
-            return callSignature.HasImplicitSelf || !callSignature.HasScope ? RubyClass.IgnoreVisibility : scope.SelfImmediateClass;
+        private static VisibilityContext GetVisibilityContext(RubyCallSignature callSignature, RubyScope scope) {
+            return callSignature.HasImplicitSelf || !callSignature.HasScope ? 
+                new VisibilityContext(callSignature.IsInteropCall ? RubyMethodAttributes.Public : RubyMethodAttributes.VisibilityMask) :
+                new VisibilityContext(scope.SelfImmediateClass);
         }
 
         internal static MethodResolutionResult Resolve(MetaObjectBuilder/*!*/ metaBuilder, string/*!*/ methodName, CallArguments/*!*/ args,
             out RubyMemberInfo methodMissing) {
 
             MethodResolutionResult method;
-            RubyClass targetClass = args.TargetClass;
+            var targetClass = args.TargetClass;
+            var visibilityContext = GetVisibilityContext(args.Signature, args.Scope);
             using (targetClass.Context.ClassHierarchyLocker()) {
                 metaBuilder.AddTargetTypeTest(args.Target, targetClass, args.TargetExpression, args.MetaContext, 
                     new[] { methodName, Symbols.MethodMissing }
                 );
 
                 var options = args.Signature.IsVirtualCall ? MethodLookup.Virtual : MethodLookup.Default;
-                method = targetClass.ResolveMethodForSiteNoLock(methodName, GetVisibilityContext(args.Signature, args.Scope), options);
+                method = targetClass.ResolveMethodForSiteNoLock(methodName, visibilityContext, options);
                 if (!method.Found) {
                     methodMissing = targetClass.ResolveMethodMissingForSite(methodName, method.IncompatibleVisibility);
                 } else {
@@ -212,12 +214,12 @@ namespace IronRuby.Runtime.Calls {
             }
 
             // Whenever the current self's class changes we need to invalidate the rule, if a protected method is being called.
-            if (method.Info != null &amp;&amp; method.Info.IsProtected &amp;&amp; !args.Signature.HasImplicitSelf) {
+            if (method.Info != null &amp;&amp; method.Info.IsProtected &amp;&amp; visibilityContext.Class != null) {
                 // We don't need to compare versions, just the class objects (super-class relationship cannot be changed).
                 // Since we don't want to hold on a class object (to make it collectible) we compare references to the version handlers.
                 metaBuilder.AddCondition(Ast.Equal(
                     Methods.GetSelfClassVersionHandle.OpCall(AstUtils.Convert(args.MetaScope.Expression, typeof(RubyScope))),
-                    Ast.Constant(args.Scope.SelfImmediateClass.Version)
+                    Ast.Constant(visibilityContext.Class.Version)
                 ));
             }
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyCallAction.cs</filename>
    </modified>
    <modified>
      <diff>@@ -35,16 +35,19 @@ namespace IronRuby.Runtime.Calls {
         // Used for private visibility check. By default method call sites have explicit self, so private methods are not visible.
         HasImplicitSelf = 16,
 
+        // Interop calls can only see Ruby-public members.
+        IsInteropCall = 32,
+
         // If the resolved method is a Ruby method call it otherwise invoke #base# method on target's type.
         // Used in method overrides defined in types emitted for Ruby classes that derive from CLR type.
-        IsVirtualCall = 32,
+        IsVirtualCall = 64,
     }
         
     /// &lt;summary&gt;
     /// RubyScope/RubyContext, (self), (argument){ArgumentCount}, (splatted-argument)?, (block)?
     /// &lt;/summary&gt;
     public struct RubyCallSignature : IEquatable&lt;RubyCallSignature&gt; {
-        private const int FlagsCount = 6;
+        private const int FlagsCount = 7;
         private const int MaxArgumentCount = (int)(UInt32.MaxValue &gt;&gt; FlagsCount);
         private const RubyCallFlags FlagsMask = (RubyCallFlags)(1 &lt;&lt; FlagsCount) - 1;
 
@@ -55,6 +58,7 @@ namespace IronRuby.Runtime.Calls {
         public bool HasBlock { get { return ((RubyCallFlags)_countAndFlags &amp; RubyCallFlags.HasBlock) != 0; } }
         public bool HasSplattedArgument { get { return ((RubyCallFlags)_countAndFlags &amp; RubyCallFlags.HasSplattedArgument) != 0; } }
         public bool HasRhsArgument { get { return ((RubyCallFlags)_countAndFlags &amp; RubyCallFlags.HasRhsArgument) != 0; } }
+        public bool IsInteropCall { get { return ((RubyCallFlags)_countAndFlags &amp; RubyCallFlags.IsInteropCall) != 0; } }
         public bool IsVirtualCall { get { return ((RubyCallFlags)_countAndFlags &amp; RubyCallFlags.IsVirtualCall) != 0; } }
 
         public int ArgumentCount { get { return (int)_countAndFlags &gt;&gt; FlagsCount; } }
@@ -97,7 +101,7 @@ namespace IronRuby.Runtime.Calls {
         }
 
         internal static bool TryCreate(CallInfo callInfo, out RubyCallSignature callSignature) {
-            callSignature = Simple(callInfo.ArgumentCount);
+            callSignature = RubyCallSignature.Interop(callInfo.ArgumentCount);
             return callInfo.ArgumentNames.Count != 0;
         }
 
@@ -109,6 +113,10 @@ namespace IronRuby.Runtime.Calls {
             return new RubyCallSignature(argumentCount, RubyCallFlags.None);
         }
 
+        public static RubyCallSignature Interop(int argumentCount) {
+            return new RubyCallSignature(argumentCount, RubyCallFlags.IsInteropCall);
+        }
+
         public static RubyCallSignature WithBlock(int argumentCount) {
             return new RubyCallSignature(argumentCount, RubyCallFlags.HasBlock);
         }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyCallSignature.cs</filename>
    </modified>
    <modified>
      <diff>@@ -35,12 +35,16 @@ namespace IronRuby.Runtime {
         public string/*!*/ MangledName {
             get {
                 if (_mangled == null) {
-                    _mangled = RubyUtils.MangleName(_actual);
+                    _mangled = RubyUtils.TryMangleName(_actual) ?? _actual;
                 }
                 return _mangled;
             }
         }
 
+        public bool HasMangledName {
+            get { return !ReferenceEquals(_actual, MangledName); }
+        }
+
         public ClrName(string/*!*/ actualName) {
             ContractUtils.RequiresNotNull(actualName, &quot;actualName&quot;);
             _actual = actualName;</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/ClrName.cs</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,7 @@ namespace IronRuby.Runtime {
         }
     }
 
+    [Serializable]
     public class Key&lt;T0, T1&gt; : IEquatable&lt;Key&lt;T0, T1&gt;&gt; {
         public readonly T0/*!*/ First;
         public readonly T1/*!*/ Second;
@@ -57,6 +58,7 @@ namespace IronRuby.Runtime {
         }
     }
 
+    [Serializable]
     public sealed class Key&lt;T0, T1, T2&gt; : Key&lt;T0, T1&gt;, IEquatable&lt;Key&lt;T0, T1, T2&gt;&gt; {
         public readonly T2/*!*/ Third;
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Key.cs</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,7 @@ namespace IronRuby.Runtime {
         LoadOnce = 1,
         LoadIsolated = 2,
         AppendExtensions = 4,
+        ResolveLoaded = 8
     }
 
     // TODO: thread safety
@@ -58,7 +59,10 @@ namespace IronRuby.Runtime {
         private readonly RubyArray/*!*/ _loadedFiles;
 
         // files that were required but their execution haven't completed yet:
-        private readonly Stack&lt;string&gt;/*!*/ _unfinishedFiles; 
+        private readonly Stack&lt;string&gt;/*!*/ _unfinishedFiles;
+
+        // lazy init
+        private SynchronizedDictionary&lt;string, Scope&gt; _loadedScripts;
 
         // TODO: static
         // maps full normalized path to compiled code:
@@ -97,6 +101,21 @@ namespace IronRuby.Runtime {
             get { return _loadedFiles; }
         }
 
+        /// &lt;summary&gt;
+        /// Contains all loaded foreign language scripts. Maps path to scope created for each loaded script.
+        /// A script is published here as soon as its scopr is created just before it is executed.
+        /// &lt;/summary&gt;
+        public IDictionary&lt;string, Scope&gt;/*!*/ LoadedScripts {
+            get {
+                if (_loadedScripts == null) {
+                    Interlocked.CompareExchange(ref _loadedScripts, 
+                        new SynchronizedDictionary&lt;string, Scope&gt;(new Dictionary&lt;string, Scope&gt;(DomainManager.Platform.PathComparer)), null
+                    );
+                }
+                return _loadedScripts;
+            }
+        }
+
         private PlatformAdaptationLayer/*!*/ Platform {
             get { return DomainManager.Platform; }
         }
@@ -104,7 +123,7 @@ namespace IronRuby.Runtime {
         private ScriptDomainManager/*!*/ DomainManager {
             get { return _context.DomainManager; }
         }
-        
+
         internal Loader(RubyContext/*!*/ context) {
             Assert.NotNull(context);
             _context = context;
@@ -231,10 +250,19 @@ namespace IronRuby.Runtime {
             }
         }
 
+        public bool LoadFile(Scope globalScope, object self, MutableString/*!*/ path, LoadFlags flags) {
+            object loaded;
+            return LoadFile(globalScope, self, path, flags, out loaded);
+        }
+
         /// &lt;summary&gt;
         /// Returns &lt;b&gt;true&lt;/b&gt; if a Ruby file is successfully loaded, &lt;b&gt;false&lt;/b&gt; if it is already loaded.
         /// &lt;/summary&gt;
-        public bool LoadFile(Scope globalScope, object self, MutableString/*!*/ path, LoadFlags flags) {
+        /// &lt;param name=&quot;globalScope&quot;&gt;
+        /// A scope against which the file should be executed or null to create a new scope.
+        /// &lt;/param&gt;
+        /// &lt;returns&gt;True if the file was loaded/executed by this call.&lt;/returns&gt;
+        public bool LoadFile(Scope globalScope, object self, MutableString/*!*/ path, LoadFlags flags, out object loaded) {
             Assert.NotNull(path);
 
             string assemblyName, typeName;
@@ -243,46 +271,69 @@ namespace IronRuby.Runtime {
             if (TryParseAssemblyName(strPath, out typeName, out assemblyName)) {
 
                 if (AlreadyLoaded(path, flags)) {
+                    loaded = ((flags &amp; LoadFlags.ResolveLoaded) != 0) ? GetAssembly(assemblyName, true, false) : null;
                     return false;
                 }
 
-                if (LoadAssembly(assemblyName, typeName, false, false)) {
+                Assembly assembly = LoadAssembly(assemblyName, typeName, false, false);
+                if (assembly != null) {
                     FileLoaded(path, flags);
+                    loaded = assembly;
                     return true;
                 }
             }
 
-            return LoadFromPath(globalScope, self, strPath, flags);
+            return LoadFromPath(globalScope, self, strPath, flags, out loaded);
         }
 
         #region Assemblies
 
+        public Assembly LoadAssembly(string/*!*/ assemblyName, string typeName, bool throwOnError, bool tryPartialName) {
+            Assembly assembly = GetAssembly(assemblyName, throwOnError, tryPartialName);
+            return (assembly != null &amp;&amp; LoadAssembly(assembly, typeName, throwOnError)) ? assembly : null;
+        }
+        
         [System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Reliability&quot;, &quot;CA2001:AvoidCallingProblematicMethods&quot;, MessageId = &quot;System.Reflection.Assembly.LoadWithPartialName&quot;)]
-        public bool LoadAssembly(string/*!*/ assemblyName, string typeName, bool throwOnError, bool tryPartialName) {
-            Utils.Log(String.Format(&quot;Loading assembly '{0}' and type '{1}'&quot;, assemblyName, typeName), &quot;LOADER&quot;);
-            
-            Assembly assembly;
-            try {
-                try {
-                    assembly = Platform.LoadAssembly(assemblyName);
-                } catch (FileNotFoundException) {
+        private Assembly GetAssembly(string/*!*/ assemblyName, bool throwOnError, bool tryPartialName) {
 #if SILVERLIGHT
-                    throw;
-#else
-                    if (tryPartialName) {
-#pragma warning disable 618,612 // csc, gmcs
-                        assembly = Assembly.LoadWithPartialName(assemblyName);
-#pragma warning restore 618,612
+            tryPartialName = false;
+#endif
+            try {
+                return Platform.LoadAssembly(assemblyName);
+            } catch (Exception e) {
+                if (!tryPartialName || !(e is FileNotFoundException)) {
+                    if (throwOnError) {
+                        throw new LoadError(e.Message, e);
                     } else {
-                        throw;
+                        return null;
                     }
-#endif
                 }
-            } catch (Exception e) {
-                if (throwOnError) throw new LoadError(e.Message, e);
-                return false;
             }
 
+#if SILVERLIGHT
+            throw Assert.Unreachable;
+#else
+#pragma warning disable 618,612 // csc, gmcs
+            Assembly assembly;
+            try { 
+                assembly = Assembly.LoadWithPartialName(assemblyName);
+            } catch (Exception e) {
+                if (throwOnError) {
+                    throw new LoadError(e.Message, e);
+                } else {
+                    return null;
+                }
+            }
+            if (assembly == null &amp;&amp; throwOnError) {
+                throw new LoadError(String.Format(&quot;Assembly '{0}' not found&quot;, assemblyName));
+            }
+#pragma warning restore 618,612
+            return assembly;
+#endif
+        }
+        
+        private bool LoadAssembly(Assembly/*!*/ assembly, string typeName, bool throwOnError) {
+            Utils.Log(String.Format(&quot;Loading assembly '{0}' and type '{1}'&quot;, assembly, typeName), &quot;LOADER&quot;);
             Type initializerType;
             if (typeName != null) {
                 // load Ruby library:
@@ -411,7 +462,7 @@ namespace IronRuby.Runtime {
             }
         }
 
-        private bool LoadFromPath(Scope globalScope, object self, string/*!*/ path, LoadFlags flags) {
+        private bool LoadFromPath(Scope globalScope, object self, string/*!*/ path, LoadFlags flags, out object loaded) {
             Assert.NotNull(path);
 
             string[] sourceFileExtensions = DomainManager.Configuration.GetFileExtensions();
@@ -426,6 +477,20 @@ namespace IronRuby.Runtime {
             }
 
             if (AlreadyLoaded(pathWithExtension, flags) || _unfinishedFiles.Contains(pathWithExtension.ToString())) {
+                if ((flags &amp; LoadFlags.ResolveLoaded) != 0) {
+                    var fullPath = Platform.GetFullPath(file.Path);
+                    if (file.SourceUnit != null) {
+                        Scope loadedScope;
+                        if (!LoadedScripts.TryGetValue(fullPath, out loadedScope)) {
+                            throw new LoadError(String.Format(&quot;no such file to load -- {0}&quot;, file.Path));
+                        }
+                        loaded = loadedScope;
+                    } else {
+                        loaded = Platform.LoadAssemblyFromPath(fullPath);
+                    }
+                } else {
+                    loaded = null;
+                }
                 return false;
             }
 
@@ -434,18 +499,19 @@ namespace IronRuby.Runtime {
                 _unfinishedFiles.Push(pathWithExtension.ToString());
 
                 if (file.SourceUnit != null) {
-
-                    RubyContext rubySource = file.SourceUnit.LanguageContext as RubyContext;
-                    if (rubySource != null) {
-                        ExecuteRubySourceUnit(file.SourceUnit, globalScope, flags);
+                    ScriptCode compiledCode;
+                    if (file.SourceUnit.LanguageContext == _context) {
+                        compiledCode = CompileRubySource(file.SourceUnit, flags);
                     } else {
-                        file.SourceUnit.Execute();
+                        compiledCode = file.SourceUnit.Compile();
                     }
+                    loaded = Execute(globalScope, compiledCode);
                 } else {
                     Debug.Assert(file.Path != null);
                     try {
-                        Assembly asm = Platform.LoadAssemblyFromPath(Platform.GetFullPath(file.Path));
-                        DomainManager.LoadAssembly(asm);
+                        Assembly assembly = Platform.LoadAssemblyFromPath(Platform.GetFullPath(file.Path));
+                        DomainManager.LoadAssembly(assembly);
+                        loaded = assembly;
                     } catch (Exception e) {
                         throw new LoadError(e.Message, e);
                     }
@@ -459,7 +525,7 @@ namespace IronRuby.Runtime {
             return true;
         }
 
-        private void ExecuteRubySourceUnit(SourceUnit/*!*/ sourceUnit, Scope globalScope, LoadFlags flags) {
+        private ScriptCode/*!*/ CompileRubySource(SourceUnit/*!*/ sourceUnit, LoadFlags flags) {
             Assert.NotNull(sourceUnit);
             
             // TODO: check file timestamp
@@ -467,11 +533,8 @@ namespace IronRuby.Runtime {
             CompiledFile compiledFile;
             if (TryGetCompiledFile(fullPath, out compiledFile)) {
                 Utils.Log(String.Format(&quot;{0}: {1}&quot;, ++_cacheHitCount, sourceUnit.Path), &quot;LOAD_CACHED&quot;);
-                if (globalScope != null) {
-                    compiledFile.CompiledCode.Run(globalScope);
-                } else {
-                    compiledFile.CompiledCode.Run();
-                }
+
+                return compiledFile.CompiledCode;
             } else {
                 Utils.Log(String.Format(&quot;{0}: {1}&quot;, ++_compiledFileCount, sourceUnit.Path), &quot;LOAD_COMPILED&quot;);
 
@@ -486,12 +549,22 @@ namespace IronRuby.Runtime {
 
                 AddCompiledFile(fullPath, compiledCode);
 
-                CompileAndRun(globalScope, compiledCode);
+                return compiledCode;
             }
         }
 
-        internal object CompileAndRun(Scope globalScope, ScriptCode/*!*/ code) {
-            return globalScope != null ? code.Run(globalScope) : code.Run();
+        internal Scope Execute(Scope globalScope, ScriptCode/*!*/ code) {
+            if (globalScope == null || code.LanguageContext != _context) {
+                globalScope = code.CreateScope();
+                if (code.SourceUnit.Path != null) {
+                    LoadedScripts[Platform.GetFullPath(code.SourceUnit.Path)] = globalScope;
+                }
+                code.Run(globalScope);
+                return globalScope;
+            } else {
+                code.Run(globalScope);
+                return null;
+            }
         }
 
         private ResolvedFile FindFile(string/*!*/ path, bool appendExtensions, string[] sourceFileExtensions) {</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs</filename>
    </modified>
    <modified>
      <diff>@@ -47,8 +47,8 @@ namespace IronRuby.Runtime {
         public static readonly string/*!*/ MriReleaseDate = &quot;2008-05-28&quot;;
 
         // IronRuby:
-        public const string/*!*/ IronRubyVersionString = &quot;0.6.0.0&quot;;
-        public static readonly Version IronRubyVersion = new Version(0, 6, 0, 0);
+        public const string/*!*/ IronRubyVersionString = &quot;0.9.0.0&quot;;
+        public static readonly Version IronRubyVersion = new Version(0, 9, 0, 0);
         internal const string/*!*/ IronRubyDisplayName = &quot;IronRuby&quot;;
         internal const string/*!*/ IronRubyNames = &quot;IronRuby;Ruby;rb&quot;;
         internal const string/*!*/ IronRubyFileExtensions = &quot;.rb&quot;;
@@ -535,11 +535,11 @@ namespace IronRuby.Runtime {
         }
 
         internal void SetGlobalConstant(string/*!*/ name, object value) {
-            _globalScope.SetName(SymbolTable.StringToId(name), value);
+            _globalScope.SetVariable(SymbolTable.StringToId(name), value);
         }
 
         internal bool TryGetGlobalConstant(string/*!*/ name, out object value) {
-            return _globalScope.TryGetName(SymbolTable.StringToId(name), out value);
+            return _globalScope.TryGetVariable(SymbolTable.StringToId(name), out value);
         }
 
         private void InitializeFileDescriptors(SharedIO/*!*/ io) {
@@ -1237,12 +1237,12 @@ namespace IronRuby.Runtime {
         // thread-safe:
         public MethodResolutionResult ResolveMethod(object target, string/*!*/ name, bool includePrivate) {
             var owner = GetImmediateClassOf(target);
-            return owner.ResolveMethod(name, includePrivate ? RubyClass.IgnoreVisibility : owner);
+            return owner.ResolveMethod(name, includePrivate ? VisibilityContext.AllVisible : new VisibilityContext(owner));
         }
 
         // thread-safe:
-        public MethodResolutionResult ResolveMethod(object target, string/*!*/ name, RubyClass visibilityContext) {
-            return GetImmediateClassOf(target).ResolveMethod(name, visibilityContext);
+        public MethodResolutionResult ResolveMethod(object target, string/*!*/ name, VisibilityContext visibility) {
+            return GetImmediateClassOf(target).ResolveMethod(name, visibility);
         }
 
         // thread-safe:</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,8 @@ using Microsoft.Scripting;
 using System.Threading;
 using IronRuby.Builtins;
 using Microsoft.Scripting.Utils;
+using System.Diagnostics;
+using System;
 
 namespace IronRuby.Runtime {
     /// &lt;summary&gt;
@@ -97,7 +99,7 @@ namespace IronRuby.Runtime {
             return _instanceVars;
         }
 
-        #region instance variable support
+        #region Instance Variables
 
         internal bool HasInstanceVariables {
             get {
@@ -184,6 +186,62 @@ namespace IronRuby.Runtime {
             }
         }
 
+        internal VariableDebugView[]/*!*/ GetInstanceVariablesDebugView(RubyContext/*!*/ context) {
+            if (_instanceVars == null) {
+                return new RubyInstanceData.VariableDebugView[0];
+            }
+
+            var result = new List&lt;VariableDebugView&gt;();
+            lock (_instanceVars) {
+                foreach (var var in _instanceVars) {
+                    result.Add(new VariableDebugView(context, this, var.Key));
+                }
+            }
+
+            result.Sort((var1, var2) =&gt; var1._name.CompareTo(var2._name));
+            return result.ToArray();
+        }
+
+        [DebuggerDisplay(&quot;{GetValue()}&quot;, Name = &quot;{_name,nq}&quot;, Type = &quot;{GetClassName(),nq}&quot;)]
+        public sealed class VariableDebugView {
+            [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+            private readonly RubyContext/*!*/ _context;
+            [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+            private readonly RubyInstanceData/*!*/ _data;
+            [DebuggerBrowsable(DebuggerBrowsableState.Never)]
+            internal readonly string/*!*/ _name;
+
+            [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
+            public object A {
+                get { return GetValue(); }
+            }
+            
+            [DebuggerDisplay(&quot;{B}&quot;, Name = &quot;Raw Value&quot;, Type = &quot;{GetClrType()}&quot;)]
+            public object B {
+                get { return GetValue(); }
+                set { _data.SetInstanceVariable(_name, value); }
+            }
+            
+            private object GetValue() {
+                return _data.GetInstanceVariable(_name);
+            }
+
+            private Type GetClrType() {
+                var value = GetValue();
+                return value != null ? value.GetType() : null;
+            }
+
+            private string/*!*/ GetClassName() {
+                return _context.GetClassDisplayName(GetValue());
+            }
+
+            internal VariableDebugView(RubyContext/*!*/ context, RubyInstanceData/*!*/ data, string/*!*/ name) {
+                _context = context;
+                _data = data;
+                _name = name;
+            }
+        }
+
         #endregion
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyInstanceData.cs</filename>
    </modified>
    <modified>
      <diff>@@ -537,7 +537,7 @@ namespace IronRuby.Runtime {
 
             // expose RubyMethod in the scope (the method is bound to the main singleton instance):
             if (owner.GlobalScope != null) {
-                owner.GlobalScope.Scope.SetName(
+                owner.GlobalScope.Scope.SetVariable(
                     SymbolTable.StringToId(method.DefinitionName),
                     new RubyMethod(owner.GlobalScope.MainObject, method, method.DefinitionName)
                 );
@@ -553,7 +553,7 @@ namespace IronRuby.Runtime {
         public static void UndefineMethod(RubyScope/*!*/ scope, string/*!*/ name) {
             RubyModule owner = scope.GetInnerMostModuleForMethodLookup();
 
-            if (!owner.ResolveMethod(name, RubyClass.IgnoreVisibility).Found) {
+            if (!owner.ResolveMethod(name, VisibilityContext.AllVisible).Found) {
                 throw RubyExceptions.CreateUndefinedMethodError(owner, name);
             }
             owner.UndefineMethod(name);
@@ -563,7 +563,7 @@ namespace IronRuby.Runtime {
         public static bool IsDefinedMethod(object self, RubyScope/*!*/ scope, string/*!*/ name) {
             // MRI: this is different from UndefineMethod, it behaves like Kernel#method (i.e. doesn't use lexical scope):
             // TODO: visibility
-            return scope.RubyContext.ResolveMethod(self, name, RubyClass.IgnoreVisibility).Found;
+            return scope.RubyContext.ResolveMethod(self, name, VisibilityContext.AllVisible).Found;
         }
 
         #endregion</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -65,9 +65,7 @@ namespace IronRuby.Runtime {
         }
     }
         
-#if !SILVERLIGHT
     [DebuggerTypeProxy(typeof(RubyScope.DebugView))]
-#endif
     public abstract class RubyScope : RuntimeFlowControl {
         internal bool InLoop;
         internal bool InRescue;
@@ -526,7 +524,6 @@ namespace IronRuby.Runtime {
 #endif
         }
 
-#if !SILVERLIGHT
         internal sealed class DebugView {
             private readonly RubyScope/*!*/ _scope;
             [System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Performance&quot;, &quot;CA1823:AvoidUnusedPrivateFields&quot;)]
@@ -546,7 +543,7 @@ namespace IronRuby.Runtime {
                     while (true) {
                         foreach (var variable in scope.GetDeclaredLocalVariables()) {
                             string name = SymbolTable.IdToString(variable.Key);
-                            string className = _scope.RubyContext.GetImmediateClassOf(variable.Value).GetDisplayName(_scope.RubyContext, true).ConvertToString();
+                            string className = _scope.RubyContext.GetClassDisplayName(variable.Value);
                             if (scope != _scope) {
                                 name += &quot; (outer)&quot;;
                             }
@@ -568,19 +565,19 @@ namespace IronRuby.Runtime {
             }
 
             [DebuggerDisplay(&quot;{B}&quot;, Name = &quot;MethodAttributes&quot;, Type = &quot;&quot;)]
-            public RubyMethodAttributes B {
+            public object B {
                 get { return _scope._methodAttributes; }
             }
 
             [DebuggerDisplay(&quot;{C}&quot;, Name = &quot;ParentScope&quot;, Type = &quot;&quot;)]
-            public RubyScope C {
+            public object C {
                 get { return (RubyScope)_scope.Parent; }
             }
 
-            [DebuggerDisplay(&quot;&quot;, Name = &quot;RawVariables&quot;, Type = &quot;&quot;)]
-            public System.Collections.Hashtable/*!*/ D {
+            [DebuggerDisplay(&quot;&quot;, Name = &quot;Raw Variables&quot;, Type = &quot;&quot;)]
+            public object D {
                 get {
-                    System.Collections.Hashtable result = new System.Collections.Hashtable();
+                    var result = new Dictionary&lt;SymbolId, object&gt;();
                     foreach (var variable in _scope.GetDeclaredLocalVariables()) {
                         result.Add(variable.Key, variable.Value);
                     }
@@ -604,7 +601,6 @@ namespace IronRuby.Runtime {
                 }
             }
         }
-#endif
         #endregion
     }
 
@@ -916,39 +912,58 @@ var closureScope = scope as RubyClosureScope;
         // &quot;method_missing&quot; on main singleton in DLR Scope bound code.
         // Might be called via a site -&gt; needs to be public in partial trust.
         public static object TopMethodMissing(RubyScope/*!*/ localScope, BlockParam block, object/*!*/ self, SymbolId name, [NotNull]params object[]/*!*/ args) {
-            Assert.NotNull(localScope, self);
-            Debug.Assert(!localScope.IsEmpty);
-            Scope globalScope = localScope.GlobalScope.Scope;
-            Debug.Assert(globalScope != null);
+            return ScopeMethodMissing(localScope.RubyContext, localScope.GlobalScope.Scope, block, self, name, args);
+        }
+
+        public static object ScopeMethodMissing(RubyContext/*!*/ context, Scope/*!*/ globalScope, BlockParam block, object self, SymbolId name, object[]/*!*/ args) {
+            Assert.NotNull(context, globalScope);
+
+            string str = SymbolTable.IdToString(name);
+            if (str.LastCharacter() == '=') {
+                if (args.Length != 1) {
+                    throw RubyOps.MakeWrongNumberOfArgumentsError(args.Length, 1);
+                }
+
+                // Consider this case:
+                // There is {&quot;Foo&quot; -&gt; 1} in the scope.
+                // x.foo += 1
+                // Without name mangling this would result to {&quot;Foo&quot; -&gt; 1, &quot;foo&quot; -&gt; 2} while the expected result is {&quot;Foo&quot; -&gt; 2}.
 
-            // TODO: error when arguments non-empty, block != null, ...
+                str = str.Substring(0, str.Length - 1);
+                name = SymbolTable.StringToId(str);
+
+                if (!globalScope.ContainsVariable(name)) {
+                    var unmangled = SymbolTable.StringToId(RubyUtils.TryUnmangleName(str));
+                    if (!unmangled.IsEmpty &amp;&amp; globalScope.ContainsVariable(unmangled)) {
+                        name = unmangled;
+                    }
+                }
+
+                var value = args[0];
+                globalScope.SetVariable(name, value);
+                return value;
+            } else {
+                if (args.Length != 0) {
+                    throw RubyOps.MakeWrongNumberOfArgumentsError(args.Length, 0);
+                }
 
-            if (args.Length == 0) {
                 object value;
-                if (globalScope.TryGetName(name, out value)) {
+                if (globalScope.TryGetVariable(name, out value)) {
                     return value;
                 }
 
-                string str = SymbolTable.IdToString(name);
                 string unmangled = RubyUtils.TryUnmangleName(str);
-                if (unmangled != null &amp;&amp; globalScope.TryGetName(SymbolTable.StringToId(unmangled), out value)) {
+                if (unmangled != null &amp;&amp; globalScope.TryGetVariable(SymbolTable.StringToId(unmangled), out value)) {
                     return value;
                 }
 
-                if (str == &quot;scope&quot;) {
+                if (self != null &amp;&amp; str == &quot;scope&quot;) {
                     return self;
                 }
-            } else if (args.Length == 1) {
-                string str = SymbolTable.IdToString(name);
-                if (str.LastCharacter() == '=') {
-                    SymbolId plainName = SymbolTable.StringToId(str.Substring(0, str.Length - 1));
-                    globalScope.SetName(plainName, args[0]);
-                    return args[0];
-                }
             }
 
             // TODO: call super
-            throw RubyExceptions.CreateMethodMissing(localScope.RubyContext, self, SymbolTable.IdToString(name));
+            throw RubyExceptions.CreateMethodMissing(context, self, SymbolTable.IdToString(name));
         }
 
         #endregion</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyScope.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,7 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.IO;
 using System.Linq.Expressions;
 using System.Reflection;
 using System.Runtime.CompilerServices;
@@ -188,67 +189,165 @@ namespace IronRuby.Runtime {
 
         #region Names
 
-        // Unmangles a method name. Not all names can be unmangled.
-        // For a name to be unmangle-able, it must be lower_case_with_underscores.
-        // If a name can't be unmangled, this function returns null
+        /// &lt;summary&gt;
+        /// Converts a Ruby name to PascalCase name (foo_bar -&gt; FooBar).
+        /// Returns null if the name is not a well-formed Ruby name (it contains upper-case latter or subsequent underscores).
+        /// Characters that are not upper case letters are treated as lower-case letters.
+        /// &lt;/summary&gt;
         public static string TryUnmangleName(string/*!*/ name) {
-            if (name.ToUpper().Equals(&quot;INITIALIZE&quot;)) {
-                // Special case for compatibility with CLR
-                return name;
+            ContractUtils.RequiresNotNull(name, &quot;name&quot;);
+            if (name.Length == 0) {
+                return null;
             }
 
-            StringBuilder sb = new StringBuilder(name.Length);
-            bool upcase = true;
-            foreach (char c in name) {
-                if (char.IsUpper(c)) {
-                    // can't unmangle a name with uppercase letters
+            StringBuilder mangled = new StringBuilder();
+
+            bool lastWasSpecial = false;
+            int i = 0, j = 0;
+            while (i &lt; name.Length) {
+                char c;
+                while (j &lt; name.Length &amp;&amp; (c = name[j]) != '_') {
+                    if (Char.IsUpper(c)) {
+                        return null;
+                    }
+                    j++;
+                }
+
+                if (j == i || j == name.Length - 1) {
                     return null;
                 }
 
-                if (c == '_') {
-                    if (upcase) {
-                        // can't unmangle a name with consecutive or leading underscores
+                if (j - i == 1) {
+                    // &quot;ip_f_xxx&quot; -/-&gt; &quot;IPFXxx&quot;
+                    if (lastWasSpecial) {
                         return null;
                     }
-                    upcase = true;
+                    mangled.Append(name[i].ToUpperInvariant());
+                    lastWasSpecial = false;
                 } else {
-                    if (upcase) {
-                        sb.Append(char.ToUpper(c));
-                        upcase = false;
+                    string special = MapSpecialWord(name, i, j - i);
+                    if (special != null) {
+                        // &quot;ip_ip&quot; -/-&gt; &quot;IPIP&quot;
+                        if (lastWasSpecial) {
+                            return null;
+                        }
+                        mangled.Append(special.ToUpperInvariant());
+                        lastWasSpecial = true;
                     } else {
-                        sb.Append(c);
+                        mangled.Append(name[i].ToUpperInvariant());
+                        mangled.Append(name, i + 1, j - i - 1);
+                        lastWasSpecial = false;
                     }
                 }
+
+                i = ++j;
             }
-            if (upcase) {
-                // string was empty or ended with an underscore, can't unmangle
-                return null;
-            }
-            return sb.ToString();
+
+            return mangled.ToString();
         }
 
-        public static string/*!*/ MangleName(string/*!*/ name) {
-            Assert.NotNull(name);
+        /// &lt;summary&gt;
+        /// Converts a camelCase or PascalCase name to a Ruby name (FooBar -&gt; foo_bar).
+        /// Returns null if the name is not in camelCase or PascalCase (FooBAR, foo, etc.).
+        /// Characters that are not upper case letters are treated as lower-case letters.
+        /// &lt;/summary&gt;
+        public static string TryMangleName(string/*!*/ name) {
+            ContractUtils.RequiresNotNull(name, &quot;name&quot;);
+            StringBuilder mangled = null;
+            int i = 0;
+            while (i &lt; name.Length) {
+                char c = name[i];
+                if (Char.IsUpper(c)) {
+                    int j = i + 1;
+                    while (j &lt; name.Length &amp;&amp; Char.IsUpper(name, j)) {
+                        j++;
+                    }
 
-            if (name.ToUpper().Equals(&quot;INITIALIZE&quot;)) {
-                // Special case for compatibility with CLR
-                return name;
-            }
+                    if (j &lt; name.Length) {
+                        j--;
+                    }
 
-            StringBuilder result = new StringBuilder(name.Length);
+                    if (mangled == null) {
+                        mangled = new StringBuilder();
+                        mangled.Append(name, 0, i);
+                    } 
 
-            for (int i = 0; i &lt; name.Length; i++) {
-                if (Char.IsUpper(name[i])) {
-                    if (!(i == 0 || i + 1 &lt; name.Length &amp;&amp; Char.IsUpper(name[i + 1]) || i + 1 == name.Length &amp;&amp; Char.IsUpper(name[i - 1]))) {
-                        result.Append('_');
+                    if (i &gt; 0) {
+                        mangled.Append('_');
+                    }
+
+                    int count = j - i;
+                    if (count == 0) {
+                        // NaN{end}, NaNXxx
+                        if (i + 2 &lt; name.Length &amp;&amp; 
+                            Char.IsUpper(name[i + 2]) &amp;&amp; 
+                            (i + 3 == name.Length || Char.IsUpper(name[i + 3]) &amp;&amp; 
+                            (i + 4 &lt; name.Length &amp;&amp; !Char.IsUpper(name[i + 4])))) {
+                            return null;
+                        } else {
+                            // X{end}, In, NaN, Xml, Html, ...
+                            mangled.Append(c.ToLowerInvariant());
+                            i++;
+                        }
+                    } else if (count == 1) {
+                        // FXx
+                        mangled.Append(c.ToLowerInvariant());
+                        i++;
+                    } else {
+                        // FOXxx, FOOXxx, FOOOXxx, ...
+                        string special = MapSpecialWord(name, i, count);
+                        if (special != null) {
+                            mangled.Append(special.ToLowerInvariant());
+                            i = j;
+                        } else {
+                            return null;
+                        }
                     }
-                    result.Append(Char.ToLower(name[i]));
                 } else {
-                    result.Append(name[i]);
+                    if (mangled != null) {
+                        mangled.Append(c);
+                    }
+                    i++;
                 }
             }
 
-            return result.ToString();
+            return mangled != null ? mangled.ToString() : null;
+        }
+
+        private static string MapSpecialWord(string/*!*/ name, int start, int count) {
+            if (count == 2) {
+                return IsTwoLetterWord(name, start) ? null : name.Substring(start, count);
+            }
+
+            return null;
+        }
+
+        private static bool IsTwoLetterWord(string/*!*/ str, int index) {
+            int c = LetterPair(str, index);
+            switch (c) {
+                case ('a' &lt;&lt; 8) | 't':
+                case ('a' &lt;&lt; 8) | 's':
+                case ('b' &lt;&lt; 8) | 'y':
+                case ('d' &lt;&lt; 8) | 'o':
+                case ('i' &lt;&lt; 8) | 'd':
+                case ('i' &lt;&lt; 8) | 't':
+                case ('i' &lt;&lt; 8) | 'f':
+                case ('i' &lt;&lt; 8) | 'n':
+                case ('i' &lt;&lt; 8) | 's':
+                case ('g' &lt;&lt; 8) | 'o':
+                case ('m' &lt;&lt; 8) | 'y':
+                case ('o' &lt;&lt; 8) | 'f':
+                case ('o' &lt;&lt; 8) | 'k':
+                case ('o' &lt;&lt; 8) | 'n':
+                case ('t' &lt;&lt; 8) | 'o':
+                case ('u' &lt;&lt; 8) | 'p':
+                    return true;
+            }
+            return false;
+        }
+
+        private static int LetterPair(string/*!*/ str, int index) {
+            return (str[index + 1] &amp; 0xff00) == 0 ? (str[index].ToLowerInvariant() &lt;&lt; 8) | str[index + 1].ToLowerInvariant() : -1;
         }
 
         #endregion
@@ -899,7 +998,7 @@ namespace IronRuby.Runtime {
                 basePath + &quot;/&quot; + path;
         }
 
-        public static bool FileSystemUsesDriveLetters { get { return System.IO.Path.DirectorySeparatorChar == '\\'; } }
+        public static bool FileSystemUsesDriveLetters { get { return Path.DirectorySeparatorChar == '\\'; } }
 
         // Is path something like &quot;/foo/bar&quot; (or &quot;c:/foo/bar&quot; on Windows)
         // We need this instead of Path.IsPathRooted since we need to be able to deal with Unix-style path names even on Windows
@@ -929,7 +1028,7 @@ namespace IronRuby.Runtime {
         }
 
         // returns &quot;/&quot; or something like &quot;c:/&quot;
-        public static string GetPathRoot(RubyContext/*!*/ context, string path, out string pathAfterRoot) {
+        public static string GetPathRoot(PlatformAdaptationLayer/*!*/ platform, string path, out string pathAfterRoot) {
             Debug.Assert(IsAbsolutePath(path));
             if (IsAbsoluteDriveLetterPath(path)) {
                 pathAfterRoot = path.Substring(3);
@@ -946,10 +1045,10 @@ namespace IronRuby.Runtime {
                 if (!FileSystemUsesDriveLetters || initialSlashesCount &gt; 1) {
                     return initialSlashes;
                 } else {
-                    string currentDirectory = RubyUtils.CanonicalizePath(context.DomainManager.Platform.CurrentDirectory);
+                    string currentDirectory = RubyUtils.CanonicalizePath(platform.CurrentDirectory);
                     Debug.Assert(IsAbsoluteDriveLetterPath(currentDirectory));
                     string temp;
-                    return GetPathRoot(context, currentDirectory, out temp);
+                    return GetPathRoot(platform, currentDirectory, out temp);
                 }
             }
         }
@@ -976,6 +1075,205 @@ namespace IronRuby.Runtime {
             }
         }
 
+        #region expand_path
+
+#if !SILVERLIGHT
+        // Algorithm to find HOME equivalents under Windows. This is equivalent to Ruby 1.9 behavior:
+        // 
+        // 1. Try get HOME
+        // 2. Try to generate HOME equivalent using HOMEDRIVE + HOMEPATH
+        // 3. Try to generate HOME equivalent from USERPROFILE
+        // 4. Try to generate HOME equivalent from Personal special folder 
+
+        public static string/*!*/ GetHomeDirectory(PlatformAdaptationLayer/*!*/ platform) {
+            PlatformAdaptationLayer pal = platform;
+            string result = pal.GetEnvironmentVariable(&quot;HOME&quot;);
+
+            if (result != null) {
+                return result;
+            }
+
+            string homeDrive = pal.GetEnvironmentVariable(&quot;HOMEDRIVE&quot;);
+            string homePath = pal.GetEnvironmentVariable(&quot;HOMEPATH&quot;);
+            if (homeDrive == null &amp;&amp; homePath == null) {
+                string userEnvironment = pal.GetEnvironmentVariable(&quot;USERPROFILE&quot;);
+                if (userEnvironment == null) {
+                    // This will always succeed with a non-null string, but it can fail
+                    // if the Personal folder was renamed or deleted. In this case it returns
+                    // an empty string.
+                    result = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+                } else {
+                    result = userEnvironment;
+                }
+            } else if (homeDrive == null) {
+                result = homePath;
+            } else if (homePath == null) {
+                result = homeDrive + Path.DirectorySeparatorChar;
+            } else {
+                result = homeDrive + homePath;
+            }
+
+            if (result != null) {
+                result = ExpandPath(platform, result);
+            }
+
+            return result;
+        }
+
+        class PathExpander {
+            List&lt;string&gt; _pathComponents = new List&lt;string&gt;(); // does not include the root
+            string _root; // Typically &quot;c:/&quot; on Windows, and &quot;/&quot; on Unix
+
+            internal PathExpander(PlatformAdaptationLayer/*!*/ platform, string absoluteBasePath) {
+                Debug.Assert(RubyUtils.IsAbsolutePath(absoluteBasePath));
+
+                string basePathAfterRoot = null;
+                _root = RubyUtils.GetPathRoot(platform, absoluteBasePath, out basePathAfterRoot);
+
+                // Normally, basePathAfterRoot[0] will not be '/', but here we deal with cases like &quot;c:////foo&quot;
+                basePathAfterRoot = basePathAfterRoot.TrimStart('/');
+
+                AddRelativePath(basePathAfterRoot);
+            }
+
+            internal void AddRelativePath(string relPath) {
+                Debug.Assert(!RubyUtils.IsAbsolutePath(relPath));
+
+                string[] relPathComponents = relPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
+
+                foreach (string pathComponent in relPathComponents) {
+                    if (pathComponent == &quot;..&quot;) {
+                        if (_pathComponents.Count == 0) {
+                            // MRI allows more pops than the base path components
+                            continue;
+                        }
+                        _pathComponents.RemoveAt(_pathComponents.Count - 1);
+                    } else if (pathComponent == &quot;.&quot;) {
+                        continue;
+                    } else {
+                        _pathComponents.Add(pathComponent);
+                    }
+                }
+            }
+
+            internal string/*!*/ GetResult() {
+                StringBuilder result = new StringBuilder(_root);
+
+                if (_pathComponents.Count &gt;= 1) {
+                    // Here we make this work:
+                    //   File.expand_path(&quot;c:/..a..&quot;) -&gt; &quot;c:/..a&quot;
+                    string lastComponent = _pathComponents[_pathComponents.Count - 1];
+                    if (RubyUtils.FileSystemUsesDriveLetters &amp;&amp; !String.IsNullOrEmpty(lastComponent.TrimEnd('.'))) {
+                        _pathComponents[_pathComponents.Count - 1] = lastComponent.TrimEnd('.');
+                    }
+                }
+
+                for (int i = 0; i &lt; _pathComponents.Count; i++) {
+                    result.Append(_pathComponents[i]);
+                    if (i &lt; (_pathComponents.Count - 1)) {
+                        result.Append('/');
+                    }
+                }
+#if DEBUG
+                _pathComponents = null;
+                _root = null;
+#endif
+                return result.ToString();
+            }
+        }
+
+        // Expand directory path - these cases exist:
+        //
+        // 1. Empty string or nil means return current directory
+        // 2. ~ with non-existent HOME directory throws exception
+        // 3. ~, ~/ or ~\ which expands to HOME
+        // 4. ~foo is left unexpanded
+        // 5. Expand to full path if path is a relative path
+        // 
+        // No attempt is made to determine whether the path is valid or not
+        // Returned path is always canonicalized to forward slashes
+
+        public static string/*!*/ ExpandPath(PlatformAdaptationLayer/*!*/ platform, string/*!*/ path) {
+            if (String.IsNullOrEmpty(path)) {
+                return RubyUtils.CanonicalizePath(platform.CurrentDirectory);
+            }
+
+            int length = path.Length;
+
+            if (path[0] == '~') {
+                if (length == 1 || (path[1] == '/')) {
+
+                    string homeDirectory = platform.GetEnvironmentVariable(&quot;HOME&quot;);
+                    if (homeDirectory == null) {
+                        throw RubyExceptions.CreateArgumentError(&quot;couldn't find HOME environment -- expanding `~'&quot;);
+                    }
+
+                    if (length &lt;= 2) {
+                        path = homeDirectory;
+                    } else {
+                        path = Path.Combine(homeDirectory, path.Substring(2));
+                    }
+                    return RubyUtils.CanonicalizePath(path);
+                } else {
+                    return path;
+                }
+            } else {
+                string currentDirectory = ExpandPath(platform, null);
+                return ExpandPath(platform, path, currentDirectory);
+            }
+        }
+
+        public static string/*!*/ ExpandPath(
+            PlatformAdaptationLayer/*!*/ platform,
+            string/*!*/ path,
+            string basePath) {
+
+            // We ignore basePath parameter if first string starts with a ~
+            if (basePath == null || (path.Length &gt; 0 &amp;&amp; path[0] == '~')) {
+                return ExpandPath(platform, path);
+            }
+
+            path = RubyUtils.CanonicalizePath(path);
+            basePath = RubyUtils.CanonicalizePath(basePath);
+            char partialDriveLetter;
+            string relativePath;
+
+            if (RubyUtils.IsAbsolutePath(path)) {
+                // &quot;basePath&quot; can be ignored is &quot;path&quot; is an absolute path
+                PathExpander pathExpander = new PathExpander(platform, path);
+                return pathExpander.GetResult();
+            } else if (RubyUtils.HasPartialDriveLetter(path, out partialDriveLetter, out relativePath)) {
+                string currentDirectory = partialDriveLetter.ToString() + &quot;:/&quot;;
+                if (platform.DirectoryExists(currentDirectory)) {
+                    // File.expand_path(&quot;c:foo&quot;) returns &quot;c:/current_folder_for_c_drive/foo&quot;
+                    currentDirectory = Path.GetFullPath(partialDriveLetter.ToString() + &quot;:&quot;);
+                }
+
+                return ExpandPath(
+                    platform,
+                    relativePath,
+                    currentDirectory);
+            } else if (RubyUtils.IsAbsolutePath(basePath)) {
+                PathExpander pathExpander = new PathExpander(platform, basePath);
+                pathExpander.AddRelativePath(path);
+                return pathExpander.GetResult();
+            } else if (RubyUtils.HasPartialDriveLetter(basePath, out partialDriveLetter, out relativePath)) {
+                // First expand basePath
+                string expandedBasePath = ExpandPath(platform, basePath);
+
+                return ExpandPath(platform, path, expandedBasePath);
+            } else {
+                // First expand basePath
+                string expandedBasePath = ExpandPath(platform, basePath);
+                Debug.Assert(RubyUtils.IsAbsolutePath(expandedBasePath));
+
+                return ExpandPath(platform, path, expandedBasePath);
+            }
+        }
+#endif
+
+        #endregion
+
         #endregion
     }
 }</diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,7 @@ using System.Reflection;
 using System.Collections;
 using System.Collections.Generic;
 using IronRuby.Builtins;
+using System.Globalization;
 
 namespace IronRuby.Runtime {
     public static class Utils {
@@ -327,6 +328,19 @@ namespace IronRuby.Runtime {
             return defaultResult;
         }
 
+        internal static bool SubstringEquals(string/*!*/ name, int start, int count, string/*!*/ other) {
+            if (count != other.Length) {
+                return false;
+            }
+
+            for (int i = 0; i &lt; count; i++) {
+                if (name[start + i] != other[i]) {
+                    return false;
+                }
+            }
+            return true;
+        }
+
         public static TOutput[]/*!*/ ConvertAll&lt;TInput, TOutput&gt;(this TInput[]/*!*/ array, Converter&lt;TInput, TOutput&gt;/*!*/ converter) {
             var result = new TOutput[array.Length];
             for (int i = 0; i &lt; array.Length; i++) {
@@ -375,6 +389,24 @@ namespace IronRuby.Runtime {
         public static char ToUpperHexDigit(this int digit) {
             return (char)((digit &lt; 10) ? '0' + digit : 'A' + digit - 10);
         }
+
+        public static char ToUpperInvariant(this char c) {
+            return Char.ToUpper(c, CultureInfo.InvariantCulture);
+        }
+
+        public static char ToLowerInvariant(this char c) {
+            return Char.ToLower(c, CultureInfo.InvariantCulture);
+        }
+
+#if SILVERLIGHT
+        public static string/*!*/ ToUpperInvariant(this string/*!*/ str) {
+            return str.ToUpper(CultureInfo.InvariantCulture);
+        }
+
+        public static string/*!*/ ToLowerInvariant(this string/*!*/ str) {
+            return str.ToLower(CultureInfo.InvariantCulture);
+        }
+#endif
     }
 }
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Ruby/Runtime/Utils.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,15 @@
-html, body {
-  height: 99%;
-  overflow: auto;
-}
-body {
-  padding: 0;
-  margin: 0;
-}
-#silverlightControlHost {
-  height: 100%;
-}
-#errorLocation {
-  font-size: small;
-  color: Gray;
-}
+html, body {
+  height: 99%;
+  overflow: auto;
+}
+body {
+  padding: 0;
+  margin: 0;
+}
+#silverlightControlHost {
+  height: 100%;
+}
+#errorLocation {
+  font-size: small;
+  color: Gray;
+}</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/css/screen.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,17 @@
-&#65279;
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;TutorialSL&quot;, &quot;TutorialSL\TutorialSL.csproj&quot;, &quot;{102A0325-55BF-475B-8536-018F7D913B83}&quot;
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{102A0325-55BF-475B-8536-018F7D913B83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{102A0325-55BF-475B-8536-018F7D913B83}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{102A0325-55BF-475B-8536-018F7D913B83}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{102A0325-55BF-475B-8536-018F7D913B83}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-EndGlobal
+&#65279;
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;TutorialSL&quot;, &quot;TutorialSL\TutorialSL.csproj&quot;, &quot;{102A0325-55BF-475B-8536-018F7D913B83}&quot;
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{102A0325-55BF-475B-8536-018F7D913B83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{102A0325-55BF-475B-8536-018F7D913B83}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{102A0325-55BF-475B-8536-018F7D913B83}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{102A0325-55BF-475B-8536-018F7D913B83}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+EndGlobal</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL.sln</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
-&#65279;&lt;Application
-	xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
-	xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
-	x:Class=&quot;TutorialSL.App&quot;&gt;
-	&lt;Application.Resources&gt;
-		&lt;!-- Resources scoped at the Application level should be defined here. --&gt;
-	&lt;/Application.Resources&gt;
-&lt;/Application&gt;
+&#65279;&lt;Application
+	xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
+	xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
+	x:Class=&quot;TutorialSL.App&quot;&gt;
+	&lt;Application.Resources&gt;
+		&lt;!-- Resources scoped at the Application level should be defined here. --&gt;
+	&lt;/Application.Resources&gt;
+&lt;/Application&gt;</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/App.xaml</filename>
    </modified>
    <modified>
      <diff>@@ -1,65 +1,65 @@
-&#65279;using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-
-namespace TutorialSL
-{
-	public partial class App : Application
-	{
-		public App()
-		{
-			this.Startup += this.Application_Startup;
-			this.Exit += this.Application_Exit;
-			this.UnhandledException += this.Application_UnhandledException;
-
-			InitializeComponent();
-		}
-
-		private void Application_Startup(object sender, StartupEventArgs e)
-		{
-			this.RootVisual = new MainPage();
-		}
-
-		private void Application_Exit(object sender, EventArgs e)
-		{
-		}
-
-		private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
-		{
-			// If the app is running outside of the debugger then report the exception using
-			// the browser's exception mechanism. On IE this will display it a yellow alert 
-			// icon in the status bar and Firefox will display a script error.
-			if (!System.Diagnostics.Debugger.IsAttached)
-			{
-
-				// NOTE: This will allow the application to continue running after an exception has been thrown
-				// but not handled. 
-				// For production applications this error handling should be replaced with something that will 
-				// report the error to the website and stop the application.
-				e.Handled = true;
-				Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
-			}
-		}
-
-		private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
-		{
-			try
-			{
-				string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
-				errorMsg = errorMsg.Replace('&quot;', '\'').Replace(&quot;\r\n&quot;, @&quot;\n&quot;);
-
-				System.Windows.Browser.HtmlPage.Window.Eval(&quot;throw new Error(\&quot;Unhandled Error in Silverlight Application &quot; + errorMsg + &quot;\&quot;);&quot;);
-			}
-			catch (Exception)
-			{
-			}
-		}
-	}
-}
+&#65279;using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace TutorialSL
+{
+	public partial class App : Application
+	{
+		public App()
+		{
+			this.Startup += this.Application_Startup;
+			this.Exit += this.Application_Exit;
+			this.UnhandledException += this.Application_UnhandledException;
+
+			InitializeComponent();
+		}
+
+		private void Application_Startup(object sender, StartupEventArgs e)
+		{
+			this.RootVisual = new MainPage();
+		}
+
+		private void Application_Exit(object sender, EventArgs e)
+		{
+		}
+
+		private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+		{
+			// If the app is running outside of the debugger then report the exception using
+			// the browser's exception mechanism. On IE this will display it a yellow alert 
+			// icon in the status bar and Firefox will display a script error.
+			if (!System.Diagnostics.Debugger.IsAttached)
+			{
+
+				// NOTE: This will allow the application to continue running after an exception has been thrown
+				// but not handled. 
+				// For production applications this error handling should be replaced with something that will 
+				// report the error to the website and stop the application.
+				e.Handled = true;
+				Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+			}
+		}
+
+		private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+		{
+			try
+			{
+				string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+				errorMsg = errorMsg.Replace('&quot;', '\'').Replace(&quot;\r\n&quot;, @&quot;\n&quot;);
+
+				System.Windows.Browser.HtmlPage.Window.Eval(&quot;throw new Error(\&quot;Unhandled Error in Silverlight Application &quot; + errorMsg + &quot;\&quot;);&quot;);
+			}
+			catch (Exception)
+			{
+			}
+		}
+	}
+}</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/App.xaml.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,42 +1,42 @@
-&#65279;/* ****************************************************************************
- *
- * Copyright (c) Microsoft Corporation. 
- *
- * This source code is subject to terms and conditions of the Microsoft Public License. A 
- * copy of the license can be found in the License.html file at the root of this distribution. If 
- * you cannot locate the  Microsoft Public License, please send an email to 
- * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
- * by the terms of the Microsoft Public License.
- *
- * You must not remove this notice, or any other, from this software.
- *
- *
- * ***************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-
-namespace TutorialSL
-{
-	/// &lt;summary&gt;
-	/// Interaction logic for MainWindow.xaml
-	/// &lt;/summary&gt;
-	public partial class MainPage : UserControl
-	{
-		public MainPage()
-		{
-			this.InitializeComponent();
-
-			// Insert code required on object creation below this point.
-		}
-	}
-}
+&#65279;/* ****************************************************************************
+ *
+ * Copyright (c) Microsoft Corporation. 
+ *
+ * This source code is subject to terms and conditions of the Microsoft Public License. A 
+ * copy of the license can be found in the License.html file at the root of this distribution. If 
+ * you cannot locate the  Microsoft Public License, please send an email to 
+ * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
+ * by the terms of the Microsoft Public License.
+ *
+ * You must not remove this notice, or any other, from this software.
+ *
+ *
+ * ***************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace TutorialSL
+{
+	/// &lt;summary&gt;
+	/// Interaction logic for MainWindow.xaml
+	/// &lt;/summary&gt;
+	public partial class MainPage : UserControl
+	{
+		public MainPage()
+		{
+			this.InitializeComponent();
+
+			// Insert code required on object creation below this point.
+		}
+	}
+}</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/MainPage.xaml.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
-&#65279;&lt;Deployment xmlns=&quot;http://schemas.microsoft.com/client/2007/deployment&quot;
-	xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&gt;
-	&lt;Deployment.Parts&gt;
-	&lt;/Deployment.Parts&gt;
+&#65279;&lt;Deployment xmlns=&quot;http://schemas.microsoft.com/client/2007/deployment&quot;
+	xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&gt;
+	&lt;Deployment.Parts&gt;
+	&lt;/Deployment.Parts&gt;
 &lt;/Deployment&gt;
\ No newline at end of file</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/Properties/AppManifest.xml</filename>
    </modified>
    <modified>
      <diff>@@ -1,37 +1,37 @@
-&#65279;using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle(&quot;TutorialSL&quot;)]
-[assembly: AssemblyDescription(&quot;&quot;)]
-[assembly: AssemblyConfiguration(&quot;&quot;)]
-[assembly: AssemblyCompany(&quot;&quot;)]
-[assembly: AssemblyProduct(&quot;TutorialSL&quot;)]
-[assembly: AssemblyCopyright(&quot;Copyright &#169;  2009&quot;)]
-[assembly: AssemblyTrademark(&quot;&quot;)]
-[assembly: AssemblyCulture(&quot;&quot;)]
-
-// Setting ComVisible to false makes the types in this assembly not visible 
-// to COM components.  If you need to access a type in this assembly from 
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid(&quot;102a0325-55bf-475b-8536-018f7d913b83&quot;)]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Revision and Build Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion(&quot;1.0.*&quot;)]
-
-[assembly: AssemblyVersion(&quot;1.0.0.0&quot;)]
+&#65279;using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle(&quot;TutorialSL&quot;)]
+[assembly: AssemblyDescription(&quot;&quot;)]
+[assembly: AssemblyConfiguration(&quot;&quot;)]
+[assembly: AssemblyCompany(&quot;&quot;)]
+[assembly: AssemblyProduct(&quot;TutorialSL&quot;)]
+[assembly: AssemblyCopyright(&quot;Copyright &#169;  2009&quot;)]
+[assembly: AssemblyTrademark(&quot;&quot;)]
+[assembly: AssemblyCulture(&quot;&quot;)]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid(&quot;102a0325-55bf-475b-8536-018f7d913b83&quot;)]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion(&quot;1.0.*&quot;)]
+
+[assembly: AssemblyVersion(&quot;1.0.0.0&quot;)]
 [assembly: AssemblyFileVersion(&quot;1.0.0.0&quot;)]
\ No newline at end of file</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/Properties/AssemblyInfo.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,39 +1,39 @@
-&#65279;/* ****************************************************************************
- *
- * Copyright (c) Microsoft Corporation. 
- *
- * This source code is subject to terms and conditions of the Microsoft Public License. A 
- * copy of the license can be found in the License.html file at the root of this distribution. If 
- * you cannot locate the  Microsoft Public License, please send an email to 
- * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
- * by the terms of the Microsoft Public License.
- *
- * You must not remove this notice, or any other, from this software.
- *
- *
- * ***************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-
-namespace TutorialSL
-{
-	/// &lt;summary&gt;
-	/// Interaction logic for StepControl.xaml
-	/// &lt;/summary&gt;
-	public partial class StepControl : UserControl
-	{
-		public StepControl()
-		{
-			this.InitializeComponent();
-		}
-	}
-}
+&#65279;/* ****************************************************************************
+ *
+ * Copyright (c) Microsoft Corporation. 
+ *
+ * This source code is subject to terms and conditions of the Microsoft Public License. A 
+ * copy of the license can be found in the License.html file at the root of this distribution. If 
+ * you cannot locate the  Microsoft Public License, please send an email to 
+ * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
+ * by the terms of the Microsoft Public License.
+ *
+ * You must not remove this notice, or any other, from this software.
+ *
+ *
+ * ***************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace TutorialSL
+{
+	/// &lt;summary&gt;
+	/// Interaction logic for StepControl.xaml
+	/// &lt;/summary&gt;
+	public partial class StepControl : UserControl
+	{
+		public StepControl()
+		{
+			this.InitializeComponent();
+		}
+	}
+}</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/StepControl.xaml.cs</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@
 				&lt;SplineColorKeyFrame KeyTime=&quot;00:00:00.0610000&quot; Value=&quot;#FFC8C8C8&quot;/&gt;
 			&lt;/ColorAnimationUsingKeyFrames&gt;
 		&lt;/Storyboard&gt;
-	&lt;/UserControl.Resources&gt;
+	&lt;/UserControl.Resources&gt;
 	
 	&lt;StackPanel Margin=&quot;0,0,0,15&quot;&gt;
 		&lt;Border x:Name=&quot;tutorial_id&quot; BorderBrush=&quot;#FFC8C8C8&quot; BorderThickness=&quot;5&quot; CornerRadius=&quot;10&quot; Padding=&quot;0&quot; Margin=&quot;0&quot; Background=&quot;White&quot; OpacityMask=&quot;{x:Null}&quot; d:LayoutOverrides=&quot;Width&quot; Cursor=&quot;Hand&quot;&gt;</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/TutorialControl.xaml</filename>
    </modified>
    <modified>
      <diff>@@ -1,39 +1,39 @@
-&#65279;/* ****************************************************************************
- *
- * Copyright (c) Microsoft Corporation. 
- *
- * This source code is subject to terms and conditions of the Microsoft Public License. A 
- * copy of the license can be found in the License.html file at the root of this distribution. If 
- * you cannot locate the  Microsoft Public License, please send an email to 
- * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
- * by the terms of the Microsoft Public License.
- *
- * You must not remove this notice, or any other, from this software.
- *
- *
- * ***************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-
-namespace TutorialSL
-{
-	/// &lt;summary&gt;
-	/// Interaction logic for TutorialControl.xaml
-	/// &lt;/summary&gt;
-	public partial class TutorialControl : UserControl
-	{
-		public TutorialControl()
-		{
-			this.InitializeComponent();
-		}
-	}
-}
+&#65279;/* ****************************************************************************
+ *
+ * Copyright (c) Microsoft Corporation. 
+ *
+ * This source code is subject to terms and conditions of the Microsoft Public License. A 
+ * copy of the license can be found in the License.html file at the root of this distribution. If 
+ * you cannot locate the  Microsoft Public License, please send an email to 
+ * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
+ * by the terms of the Microsoft Public License.
+ *
+ * You must not remove this notice, or any other, from this software.
+ *
+ *
+ * ***************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace TutorialSL
+{
+	/// &lt;summary&gt;
+	/// Interaction logic for TutorialControl.xaml
+	/// &lt;/summary&gt;
+	public partial class TutorialControl : UserControl
+	{
+		public TutorialControl()
+		{
+			this.InitializeComponent();
+		}
+	}
+}</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/TutorialControl.xaml.cs</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
 			&lt;TextBlock x:Name=&quot;complete_title&quot; Text=&quot;Section complete!&quot; TextWrapping=&quot;Wrap&quot; Margin=&quot;13,0,13,8&quot; FontSize=&quot;16&quot; FontWeight=&quot;Bold&quot; FontFamily=&quot;Segoe UI&quot;/&gt;
 			&lt;Border x:Name=&quot;complete_wrapper&quot; BorderBrush=&quot;#FFC8C8C8&quot; BorderThickness=&quot;5&quot; CornerRadius=&quot;10&quot; Margin=&quot;8,0,8,8&quot; Canvas.ZIndex=&quot;10&quot;&gt;
 				&lt;StackPanel Margin=&quot;0&quot;&gt;
-					&lt;TextBlock x:Name=&quot;complete_body&quot; VerticalAlignment=&quot;Top&quot; FontSize=&quot;16&quot; Padding=&quot;7,6,7,0&quot; HorizontalAlignment=&quot;Left&quot; FontFamily=&quot;Segoe UI&quot;&gt;
+					&lt;TextBlock x:Name=&quot;complete_body&quot; VerticalAlignment=&quot;Top&quot; FontSize=&quot;16&quot; Padding=&quot;7,6,7,0&quot; HorizontalAlignment=&quot;Left&quot; FontFamily=&quot;Segoe UI&quot;&gt;
 						&lt;Run&gt;Section complete!&quot;&lt;/Run&gt; 
 					&lt;/TextBlock&gt;
 					&lt;StackPanel Margin=&quot;8&quot; Orientation=&quot;Horizontal&quot; d:LayoutOverrides=&quot;HorizontalAlignment&quot;&gt;</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/TutorialPage.xaml</filename>
    </modified>
    <modified>
      <diff>@@ -1,24 +1,24 @@
-&#65279;using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
-
-namespace TutorialSL
-{
-	/// &lt;summary&gt;
-	/// Interaction logic for TutorialPage.xaml
-	/// &lt;/summary&gt;
-	public partial class TutorialPage : UserControl
-	{
-		public TutorialPage()
-		{
-			this.InitializeComponent();
-		}
-	}
-}
+&#65279;using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace TutorialSL
+{
+	/// &lt;summary&gt;
+	/// Interaction logic for TutorialPage.xaml
+	/// &lt;/summary&gt;
+	public partial class TutorialPage : UserControl
+	{
+		public TutorialPage()
+		{
+			this.InitializeComponent();
+		}
+	}
+}</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/TutorialPage.xaml.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,107 +1,107 @@
-&#65279;&lt;Project ToolsVersion=&quot;3.5&quot; DefaultTargets=&quot;Build&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
-  &lt;PropertyGroup&gt;
-    &lt;Configuration Condition=&quot; '$(Configuration)' == '' &quot;&gt;Debug&lt;/Configuration&gt;
-    &lt;Platform Condition=&quot; '$(Platform)' == '' &quot;&gt;AnyCPU&lt;/Platform&gt;
-    &lt;ExpressionBlendVersion&gt;3.0.1921.0&lt;/ExpressionBlendVersion&gt;
-    &lt;ProjectGuid&gt;{102a0325-55bf-475b-8536-018f7d913b83}&lt;/ProjectGuid&gt;
-    &lt;ProjectTypeGuids&gt;{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;/ProjectTypeGuids&gt;
-    &lt;OutputType&gt;Library&lt;/OutputType&gt;
-    &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
-    &lt;DefaultClrNameSpace&gt;TutorialSL&lt;/DefaultClrNameSpace&gt;
-    &lt;RootNamespace&gt;TutorialSL&lt;/RootNamespace&gt;
-    &lt;AssemblyName&gt;TutorialSL&lt;/AssemblyName&gt;
-    &lt;ApplicationVersion&gt;1.0.0.*&lt;/ApplicationVersion&gt;
-    &lt;ApplicationRevision&gt;0&lt;/ApplicationRevision&gt;
-    &lt;AlwaysCompileMarkupFilesInSeparateDomain&gt;false&lt;/AlwaysCompileMarkupFilesInSeparateDomain&gt;
-    &lt;TargetFrameworkVersion&gt;v3.5&lt;/TargetFrameworkVersion&gt;
-    &lt;SilverlightApplication&gt;true&lt;/SilverlightApplication&gt;
-    &lt;XapOutputs&gt;true&lt;/XapOutputs&gt;
-    &lt;XapFilename&gt;TutorialSL.xap&lt;/XapFilename&gt;
-    &lt;GenerateSilverlightManifest&gt;true&lt;/GenerateSilverlightManifest&gt;
-    &lt;SilverlightManifestTemplate&gt;Properties\AppManifest.xml&lt;/SilverlightManifestTemplate&gt;
-    &lt;SilverlightAppEntry&gt;TutorialSL.App&lt;/SilverlightAppEntry&gt;
-    &lt;CreateTestPage&gt;true&lt;/CreateTestPage&gt;
-    &lt;ValidateXaml&gt;true&lt;/ValidateXaml&gt;
-    &lt;UsePlatformExtensions&gt;false&lt;/UsePlatformExtensions&gt;
-    &lt;ThrowErrorsInValidation&gt;true&lt;/ThrowErrorsInValidation&gt;
-    &lt;TestPageFileName&gt;TestPage.html&lt;/TestPageFileName&gt;
-  &lt;/PropertyGroup&gt;
-  &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' &quot;&gt;
-    &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
-    &lt;DebugType&gt;full&lt;/DebugType&gt;
-    &lt;Optimize&gt;false&lt;/Optimize&gt;
-    &lt;OutputPath&gt;Bin\Debug&lt;/OutputPath&gt;
-    &lt;DefineConstants&gt;DEBUG;TRACE;SILVERLIGHT&lt;/DefineConstants&gt;
-    &lt;NoStdLib&gt;true&lt;/NoStdLib&gt;
-    &lt;NoConfig&gt;true&lt;/NoConfig&gt;
-    &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
-    &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
-  &lt;/PropertyGroup&gt;
-  &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Release|AnyCPU' &quot;&gt;
-    &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
-    &lt;Optimize&gt;true&lt;/Optimize&gt;
-    &lt;OutputPath&gt;Bin\Release&lt;/OutputPath&gt;
-    &lt;DefineConstants&gt;TRACE;SILVERLIGHT&lt;/DefineConstants&gt;
-    &lt;NoStdLib&gt;true&lt;/NoStdLib&gt;
-    &lt;NoConfig&gt;true&lt;/NoConfig&gt;
-    &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
-    &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
-  &lt;/PropertyGroup&gt;
-  &lt;ItemGroup&gt;
-    &lt;Reference Include=&quot;Microsoft.Expression.Interactions, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; /&gt;
-    &lt;Reference Include=&quot;System.Windows&quot; /&gt;
-    &lt;Reference Include=&quot;mscorlib&quot; /&gt;
-    &lt;Reference Include=&quot;system&quot; /&gt;
-    &lt;Reference Include=&quot;System.Core&quot; /&gt;
-    &lt;Reference Include=&quot;System.Net&quot; /&gt;
-    &lt;Reference Include=&quot;System.Windows.Interactivity, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; /&gt;
-    &lt;Reference Include=&quot;System.Xml&quot; /&gt;
-    &lt;Reference Include=&quot;System.Windows.Browser&quot; /&gt;
-  &lt;/ItemGroup&gt;
-  &lt;ItemGroup&gt;
-    &lt;ApplicationDefinition Include=&quot;App.xaml&quot;&gt;
-      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
-      &lt;SubType&gt;Designer&lt;/SubType&gt;
-    &lt;/ApplicationDefinition&gt;
-    &lt;Compile Include=&quot;App.xaml.cs&quot;&gt;
-      &lt;DependentUpon&gt;App.xaml&lt;/DependentUpon&gt;
-    &lt;/Compile&gt;
-    &lt;Compile Include=&quot;MainPage.xaml.cs&quot;&gt;
-      &lt;DependentUpon&gt;MainPage.xaml&lt;/DependentUpon&gt;
-    &lt;/Compile&gt;
-    &lt;Page Include=&quot;MainPage.xaml&quot;&gt;
-      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
-      &lt;SubType&gt;Designer&lt;/SubType&gt;
-    &lt;/Page&gt;
-    &lt;Page Include=&quot;StepControl.xaml&quot;&gt;
-      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
-      &lt;SubType&gt;Designer&lt;/SubType&gt;
-    &lt;/Page&gt;
-    &lt;Page Include=&quot;TutorialControl.xaml&quot;&gt;
-      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
-      &lt;SubType&gt;Designer&lt;/SubType&gt;
-    &lt;/Page&gt;
-    &lt;Page Include=&quot;TutorialPage.xaml&quot;&gt;
-      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
-      &lt;SubType&gt;Designer&lt;/SubType&gt;
-    &lt;/Page&gt;
-    &lt;None Include=&quot;favicon.ico&quot;&gt;
-      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
-      &lt;Visible&gt;false&lt;/Visible&gt;
-    &lt;/None&gt;
-    &lt;Compile Include=&quot;Properties\AssemblyInfo.cs&quot; /&gt;
-    &lt;Compile Include=&quot;StepControl.xaml.cs&quot;&gt;
-      &lt;DependentUpon&gt;StepControl.xaml&lt;/DependentUpon&gt;
-    &lt;/Compile&gt;
-    &lt;Compile Include=&quot;TutorialControl.xaml.cs&quot;&gt;
-      &lt;DependentUpon&gt;TutorialControl.xaml&lt;/DependentUpon&gt;
-    &lt;/Compile&gt;
-    &lt;Compile Include=&quot;TutorialPage.xaml.cs&quot;&gt;
-      &lt;DependentUpon&gt;TutorialPage.xaml&lt;/DependentUpon&gt;
-    &lt;/Compile&gt;
-  &lt;/ItemGroup&gt;
-  &lt;ItemGroup&gt;
-    &lt;Resource Include=&quot;Properties\AppManifest.xml&quot; /&gt;
-  &lt;/ItemGroup&gt;
-  &lt;Import Project=&quot;$(MSBuildExtensionsPath)\Microsoft\Silverlight\V3.0\Microsoft.Silverlight.CSharp.targets&quot; /&gt;
+&#65279;&lt;Project ToolsVersion=&quot;3.5&quot; DefaultTargets=&quot;Build&quot; xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&gt;
+  &lt;PropertyGroup&gt;
+    &lt;Configuration Condition=&quot; '$(Configuration)' == '' &quot;&gt;Debug&lt;/Configuration&gt;
+    &lt;Platform Condition=&quot; '$(Platform)' == '' &quot;&gt;AnyCPU&lt;/Platform&gt;
+    &lt;ExpressionBlendVersion&gt;3.0.1921.0&lt;/ExpressionBlendVersion&gt;
+    &lt;ProjectGuid&gt;{102a0325-55bf-475b-8536-018f7d913b83}&lt;/ProjectGuid&gt;
+    &lt;ProjectTypeGuids&gt;{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&lt;/ProjectTypeGuids&gt;
+    &lt;OutputType&gt;Library&lt;/OutputType&gt;
+    &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
+    &lt;DefaultClrNameSpace&gt;TutorialSL&lt;/DefaultClrNameSpace&gt;
+    &lt;RootNamespace&gt;TutorialSL&lt;/RootNamespace&gt;
+    &lt;AssemblyName&gt;TutorialSL&lt;/AssemblyName&gt;
+    &lt;ApplicationVersion&gt;1.0.0.*&lt;/ApplicationVersion&gt;
+    &lt;ApplicationRevision&gt;0&lt;/ApplicationRevision&gt;
+    &lt;AlwaysCompileMarkupFilesInSeparateDomain&gt;false&lt;/AlwaysCompileMarkupFilesInSeparateDomain&gt;
+    &lt;TargetFrameworkVersion&gt;v3.5&lt;/TargetFrameworkVersion&gt;
+    &lt;SilverlightApplication&gt;true&lt;/SilverlightApplication&gt;
+    &lt;XapOutputs&gt;true&lt;/XapOutputs&gt;
+    &lt;XapFilename&gt;TutorialSL.xap&lt;/XapFilename&gt;
+    &lt;GenerateSilverlightManifest&gt;true&lt;/GenerateSilverlightManifest&gt;
+    &lt;SilverlightManifestTemplate&gt;Properties\AppManifest.xml&lt;/SilverlightManifestTemplate&gt;
+    &lt;SilverlightAppEntry&gt;TutorialSL.App&lt;/SilverlightAppEntry&gt;
+    &lt;CreateTestPage&gt;true&lt;/CreateTestPage&gt;
+    &lt;ValidateXaml&gt;true&lt;/ValidateXaml&gt;
+    &lt;UsePlatformExtensions&gt;false&lt;/UsePlatformExtensions&gt;
+    &lt;ThrowErrorsInValidation&gt;true&lt;/ThrowErrorsInValidation&gt;
+    &lt;TestPageFileName&gt;TestPage.html&lt;/TestPageFileName&gt;
+  &lt;/PropertyGroup&gt;
+  &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' &quot;&gt;
+    &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt;
+    &lt;DebugType&gt;full&lt;/DebugType&gt;
+    &lt;Optimize&gt;false&lt;/Optimize&gt;
+    &lt;OutputPath&gt;Bin\Debug&lt;/OutputPath&gt;
+    &lt;DefineConstants&gt;DEBUG;TRACE;SILVERLIGHT&lt;/DefineConstants&gt;
+    &lt;NoStdLib&gt;true&lt;/NoStdLib&gt;
+    &lt;NoConfig&gt;true&lt;/NoConfig&gt;
+    &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
+    &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
+  &lt;/PropertyGroup&gt;
+  &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'Release|AnyCPU' &quot;&gt;
+    &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
+    &lt;Optimize&gt;true&lt;/Optimize&gt;
+    &lt;OutputPath&gt;Bin\Release&lt;/OutputPath&gt;
+    &lt;DefineConstants&gt;TRACE;SILVERLIGHT&lt;/DefineConstants&gt;
+    &lt;NoStdLib&gt;true&lt;/NoStdLib&gt;
+    &lt;NoConfig&gt;true&lt;/NoConfig&gt;
+    &lt;ErrorReport&gt;prompt&lt;/ErrorReport&gt;
+    &lt;WarningLevel&gt;4&lt;/WarningLevel&gt;
+  &lt;/PropertyGroup&gt;
+  &lt;ItemGroup&gt;
+    &lt;Reference Include=&quot;Microsoft.Expression.Interactions, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; /&gt;
+    &lt;Reference Include=&quot;System.Windows&quot; /&gt;
+    &lt;Reference Include=&quot;mscorlib&quot; /&gt;
+    &lt;Reference Include=&quot;system&quot; /&gt;
+    &lt;Reference Include=&quot;System.Core&quot; /&gt;
+    &lt;Reference Include=&quot;System.Net&quot; /&gt;
+    &lt;Reference Include=&quot;System.Windows.Interactivity, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&quot; /&gt;
+    &lt;Reference Include=&quot;System.Xml&quot; /&gt;
+    &lt;Reference Include=&quot;System.Windows.Browser&quot; /&gt;
+  &lt;/ItemGroup&gt;
+  &lt;ItemGroup&gt;
+    &lt;ApplicationDefinition Include=&quot;App.xaml&quot;&gt;
+      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
+      &lt;SubType&gt;Designer&lt;/SubType&gt;
+    &lt;/ApplicationDefinition&gt;
+    &lt;Compile Include=&quot;App.xaml.cs&quot;&gt;
+      &lt;DependentUpon&gt;App.xaml&lt;/DependentUpon&gt;
+    &lt;/Compile&gt;
+    &lt;Compile Include=&quot;MainPage.xaml.cs&quot;&gt;
+      &lt;DependentUpon&gt;MainPage.xaml&lt;/DependentUpon&gt;
+    &lt;/Compile&gt;
+    &lt;Page Include=&quot;MainPage.xaml&quot;&gt;
+      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
+      &lt;SubType&gt;Designer&lt;/SubType&gt;
+    &lt;/Page&gt;
+    &lt;Page Include=&quot;StepControl.xaml&quot;&gt;
+      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
+      &lt;SubType&gt;Designer&lt;/SubType&gt;
+    &lt;/Page&gt;
+    &lt;Page Include=&quot;TutorialControl.xaml&quot;&gt;
+      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
+      &lt;SubType&gt;Designer&lt;/SubType&gt;
+    &lt;/Page&gt;
+    &lt;Page Include=&quot;TutorialPage.xaml&quot;&gt;
+      &lt;Generator&gt;MSBuild:MarkupCompilePass1&lt;/Generator&gt;
+      &lt;SubType&gt;Designer&lt;/SubType&gt;
+    &lt;/Page&gt;
+    &lt;None Include=&quot;favicon.ico&quot;&gt;
+      &lt;CopyToOutputDirectory&gt;PreserveNewest&lt;/CopyToOutputDirectory&gt;
+      &lt;Visible&gt;false&lt;/Visible&gt;
+    &lt;/None&gt;
+    &lt;Compile Include=&quot;Properties\AssemblyInfo.cs&quot; /&gt;
+    &lt;Compile Include=&quot;StepControl.xaml.cs&quot;&gt;
+      &lt;DependentUpon&gt;StepControl.xaml&lt;/DependentUpon&gt;
+    &lt;/Compile&gt;
+    &lt;Compile Include=&quot;TutorialControl.xaml.cs&quot;&gt;
+      &lt;DependentUpon&gt;TutorialControl.xaml&lt;/DependentUpon&gt;
+    &lt;/Compile&gt;
+    &lt;Compile Include=&quot;TutorialPage.xaml.cs&quot;&gt;
+      &lt;DependentUpon&gt;TutorialPage.xaml&lt;/DependentUpon&gt;
+    &lt;/Compile&gt;
+  &lt;/ItemGroup&gt;
+  &lt;ItemGroup&gt;
+    &lt;Resource Include=&quot;Properties\AppManifest.xml&quot; /&gt;
+  &lt;/ItemGroup&gt;
+  &lt;Import Project=&quot;$(MSBuildExtensionsPath)\Microsoft\Silverlight\V3.0\Microsoft.Silverlight.CSharp.targets&quot; /&gt;
 &lt;/Project&gt;
\ No newline at end of file</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/design/TutorialSL/TutorialSL.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -1,455 +1,453 @@
-$:.unshift File.dirname(__FILE__) + &quot;/Libs&quot;
-
-require File.dirname(__FILE__) + '/wpf'
-include Wpf
-
-require 'tutorial'
-
-module GuiTutorial
-
-  class Tutorial
-    attr_reader :tasks, :task, :chapter, :current_tutorial 
-
-    # TODO: Figure out how to remove this condition:
-    # 
-    # When the &quot;next_chapter&quot; button is focused and the enter-button is pressed,
-    # somewhere along that process the &quot;repl_input&quot; TextBox gets focus, but 
-    # then the &quot;repl_input.key_up&quot; fires from the previous enter-button press,
-    # causing two extra lines in the repl history.
-    #
-    # This flag shunts the first key_up event, and then is set back to false. 
-    # This ignores all first-keypresses that are &quot;enter&quot;, hackily removing the
-    # issue, since &quot;enter&quot; should never really be the first key pressed. 
-    # Definitely not a perfect solution.
-    attr_accessor :handling_next_chapter
-
-    def initialize(t, window)
-      @current_tutorial ||= ::Tutorial.get_tutorial(t)
-      @window = GuiTutorial::Window.current
-    end
-
-    def self.all
-      @tutorials ||= ::Tutorial.all
-    end
-
-    def reset
-      @chapter = nil
-      @tasks = nil
-      @window.tutorial_body.children.clear
-    end
-
-    def start
-      reset
-      Window.show_tutorial
-
-      unless SILVERLIGHT
-        @window.chapters.items_source = @current_tutorial.sections
-        @window.chapters.mouse_left_button_up do |t, e|
-          select_section_or_chapter t.selected_item
-        end
-      end
-
-      @window.next_chapter.click do |t, e|
-        @handling_next_chapter = true
-        select_section_or_chapter @chapter.next_item if @chapter
-      end
-
-      select_chapter(@current_tutorial.first_chapter, @current_tutorial.first_section)
-    end
-
-    def select_section_or_chapter(item)
-      return unless item
-      case item
-      when ::Tutorial::Section: select_section item
-      when ::Tutorial::Chapter: select_chapter item
-      else 
-        raise &quot;Unknown selection type: #{item}&quot;
-      end
-    end
-
-    def select_chapter(chapter, section = nil)
-      if section
-        @window.set_or_collapse(:pre_exercise, section.introduction) do |obj, value|
-          obj.document = value
-        end
-      else
-        @window.pre_exercise.collapse!
-      end
-      @chapter = chapter
-      @window.set_or_collapse(:exercise, @chapter.introduction) do |obj, value|
-        obj.document = value
-      end
-
-      @window.tutorial_body.children.clear
-      @tasks = @chapter.tasks.clone
-      select_next_task
-    end
-
-    def select_section(section)
-      reset
-      @window.set_or_collapse(:exercise, section.introduction) do |obj, value|
-        obj.document = value
-      end
-      @window.pre_exercise.collapse!
-    end
-
-    def select_next_task
-      unless @tasks.empty?
-        @task = @tasks.shift
-        @window.next_step
-        if @task.description
-          fd = FlowDocument.from_simple_markup @task.description
-          fd &lt;&lt; &quot;Full path: #{@task.source_files.tr('/', '\\')}&quot; if @task.source_files
-          return select_next_task if not @task.should_run? Window.repl.context.bind
-          @task.setup.call(Window.repl.context.bind) if @task.setup
-          if @task.code
-            unless SILVERLIGHT
-              p = Paragraph.new Run.new(@task.code_string)
-              p.font_family = FontFamily.new &quot;Consolas&quot;
-              p.font_weight = FontWeights.Bold
-              fd.Blocks.Add p
-            else
-              fd += &quot;\n\n#{@task.code_string}&quot;
-            end
-          end
-        end
-        @window.set_or_collapse(:step_title, @task.title) do |obj, value|
-          obj.text = value
-        end
-
-        @window.step_description.document = fd
-        @window.tutorial_scroll.scroll_to_bottom
-      else
-        if @chapter.next_item
-          @window.complete.show!
-          @window.tutorial_scroll.scroll_to_bottom
-          if @window.current_step?
-            @window.repl_input.collapse!
-            @window.repl_input_arrow.collapse!
-          end
-          @window.set_or_collapse(:complete_title, @chapter.summary.title) do |obj, value|
-            obj.text = value
-          end if @chapter.summary
-          @window.set_or_collapse(:complete_body, @chapter.summary.body) do |obj, value|
-            obj.document = FlowDocument.from_simple_markup value
-          end if @chapter.summary
-          @window.next_chapter.focus
-        else
-          if @current_tutorial.summary &amp;&amp; @current_tutorial.summary.body
-            @window.exercise.document = FlowDocument.from_simple_markup(@current_tutorial.summary.body)
-          else
-            @window.exercise.document = FlowDocument.from_simple_markup(&quot;Tutorial complete!&quot;)
-          end
-          @window.exercise.show!
-          @window.tutorial_body.children.clear
-          @window.tutorial_scroll.scroll_to_top
-        end
-      end
-    end
-
-    def process_result(result)
-      if @task and @task.success?(result)
-        select_next_task
-      end
-    end
-  end
-
-  class Window
-    module Accessors
-      def current_step
-        @current_step ||= Step.new(Window.tutorial.task, current_step_id, Window.current)
-      end
-
-      def current_step_id
-        @current_step_id || 0
-      end
-
-      def current_step?
-        respond_to?(:&quot;step_#{current_step_id}&quot;)
-      end
-
-      def current_step_object
-        current_step.object
-      end
-
-      def next_step
-        complete.collapse!
-        if current_step?
-          repl_input.collapse! 
-          repl_input_arrow.collapse! 
-        end
-
-        @current_step = nil
-        @current_step_id ||= -1
-        @current_step_id  +=  1
-        
-        current_step.show
-      end
-
-      def reset_step
-        @current_step_id = 0
-        @current_step = nil
-      end
-
-      def cache_step(name, object)
-        instance_variable_set(:&quot;@#{name}&quot;, object)
-        self.class.class_eval { attr_reader :&quot;#{name}&quot; }
-      end
-
-      delegate_methods [:step_title, :step_description], :to =&gt; :current_step_object, :append =&gt; :current_step_id
-   
-      delegate_methods [:repl_input, :repl_input_arrow, :repl_history], 
-        :to =&gt; :current_step_object, :prepend =&gt; 'step', :append =&gt; :current_step_id
-    end
-
-    class &lt;&lt; self
-      attr_reader :step_xaml, :tut_xaml
-      attr_reader :repl, :tutorial
-
-      def current
-        @window ||= create
-      end
-
-      def create
-        win = XamlReader.load xaml do |win|
-          win.main.children.clear
-
-          GuiTutorial::Tutorial.all.each_with_index do |(path,tutorial), index|
-            tutorial_id, tutorial_title_id, tutorial_desc_id = &quot;tutorial_#{index}&quot;, &quot;tutorial_title_#{index}&quot;, &quot;tutorial_desc_#{index}&quot;
-            tutorial_id_OnMouseLeave_BeginStoryboard = &quot;tutorial_#{index}_OnMouseLeave_BeginStoryboard&quot;
-            
-            XamlReader.erb_load(@tut_xaml, binding) do |obj|
-              obj.send(tutorial_title_id).text = tutorial.name
-
-              obj.send(tutorial_desc_id).document = tutorial.introduction
-              win.main.children.add obj
-              
-              obj.mouse_left_button_up do |t, e|
-                @tutorial = GuiTutorial::Tutorial.new(path, Window.current)
-                @tutorial.start
-              end
-              
-              obj.show!
-            end
-          end
-          show_main(win)
-          @repl = Repl.new
-        end
-        class &lt;&lt; win
-          include Accessors
-        end
-        win
-      end
-
-      def show_main(win = current)
-        win.header_name.text = 'Pick a tutorial'
-        win.main_scroll.show!
-        win.tutorial_scroll.collapse!
-        win.tutorial_nav.collapse!
-        win.complete.collapse!
-        if @tutorial
-          win.header_navigation.show!
-          win.header_navigation.action.text = &quot;Resume tutorial&quot; 
-          win.header_navigation.action.mouse_left_button_up {|t,e| show_tutorial}
-        else
-          win.header_navigation.collapse!
-        end
-      end
-
-      def show_tutorial
-        current.main_scroll.collapse!
-        current.tutorial_scroll.show!
-        current.tutorial_nav.show! unless SILVERLIGHT
-        current.complete.collapse!
-        current.header_name.text = @tutorial.current_tutorial.name
-        current.header_navigation.show!
-        current.header_navigation.action.text = &quot;Back&quot;
-        current.header_navigation.action.mouse_left_button_up {|t,e| show_main}
-      end
-
-      def xaml
-        design = File.dirname(__FILE__) + '/design/' + (SILVERLIGHT ? 'TutorialSL' : 'Tutorial')
-        @step_xaml, @tut_xaml = ['Step', 'Tutorial'].map do |i|
-          sx = sanitize_xaml(File.open(design + &quot;/#{i}Control.xaml&quot;){|f| f.read})
-          sx.sub!(/&lt;UserControl.*?&gt;(.*?)&lt;\/UserControl&gt;/, '\1') if i == 'Step'
-          sx.gsub!(/(&quot;|\{StaticResource )(\S*?)_id(\S*?)(&quot;|\})/, '\1&lt;%= \2_id %&gt;\3\4')
-          sx.strip
-        end
-        
-        sanitize_xaml(
-          File.open(design + &quot;/Main#{SILVERLIGHT ? 'Page' : 'Window'}.xaml&quot;){|f| f.read}.
-               gsub(
-                 /&lt;local:TutorialPage.*?\/&gt;/, 
-                 File.open(design + &quot;/TutorialPage.xaml&quot;){|f| f.read}.
-                      gsub(/&lt;local:StepControl.*?\/&gt;/, '')).
-               gsub(/&lt;local:TutorialControl.*?\/&gt;/, '')
-        )
-      end
-
-      private
-        def sanitize_xaml(xaml) 
-          {
-            /x:Class=&quot;.*?&quot;/          =&gt; '',
-            /xmlns:local=&quot;.*?&quot;/      =&gt; '',
-            /mc:Ignorable=&quot;.*?&quot;/     =&gt; '',
-            /xmlns:mc=&quot;.*?&quot;/         =&gt; '',
-            /xmlns:d=&quot;.*?&quot;/          =&gt; '',
-            'Loaded=&quot;Window_Loaded&quot;' =&gt; '',
-            '&lt;TreeView '             =&gt; '&lt;TreeView ItemTemplate=&quot;{StaticResource SectionTemplate}&quot; ',
-            /\357\273\277/           =&gt;  '',
-            /d:.*?=&quot;.*?&quot;/            =&gt;  ''
-          }.inject(xaml) do |_xaml,(k,v)| 
-            _xaml.gsub(k, v)
-          end.gsub(/(\n|\t)/, ' ').squeeze(' ')
-        end
-    end
-  end
-
-  class Step
-    @@vars = :step_id,
-      :step_title_id, :step_description_id,
-      :step_wrapper_id, :step_repl_id,
-      :step_repl_history_id, :step_repl_input_id, :step_repl_input_arrow_id
-
-    attr_reader *@@vars
-
-    attr_reader :object
-
-    def initialize(task, element_id, window)
-      @task = task
-      @element_id = &quot;step_#{element_id}&quot;
-      @window = window
-      raise &quot;Element #{@element_id} already exists&quot; if @window.respond_to? @element_id
-      init_vars
-    end
-
-    def show
-      @object = XamlReader.erb_load(Window.step_xaml, binding) do |obj|
-        @window.tutorial_body.children.add obj
-        @window.cache_step(@element_id, obj)
-        obj.show!
-      end
-
-      Window.repl.prev_newline = nil
-      @window.repl_history.text = ''
-
-      @window.repl_input.show!
-      Window.repl.set_prompt
-      Window.repl.context.reset_input
-
-      # TODO - Should use TextChanged here
-      @window.repl_input.key_up do |target, event_args|
-        if event_args.key == Key.enter &amp;&amp; !Window.tutorial.handling_next_chapter
-          Window.tutorial.process_result Window.repl.on_repl_input
-        elsif event_args.Key == (!SILVERLIGHT ? Key.System : Key.alt)
-          # This allows hitting Alt-Enter to automatically enter the code
-          # It is useful during manual testing of a tutorial's content
-          if @task.code.respond_to? :to_ary
-            @task.code.to_ary.each do |code| 
-              Window.current.repl_input.text = code
-              Window.tutorial.process_result Window.repl.on_repl_input
-            end
-          else
-            Window.current.repl_input.text = @task.code
-            Window.tutorial.process_result Window.repl.on_repl_input
-          end
-        end
-        Window.tutorial.handling_next_chapter = false
-      end
-
-      @window.repl_input_arrow.show!
-      @window.repl_input.focus
-    end
-
-    private
-      def init_vars
-        @@vars.each do |v|
-          instance_variable_set(
-            :&quot;@#{v}&quot;, 
-            &quot;#{v.to_s.split('_id').first}_#{@window.current_step_id}&quot;
-          )
-        end
-      end
-  end
-
-  class Repl
-    attr_accessor :prev_newline
-    attr_accessor :context
-
-    def self.repl_puts *a
-      repl_visible = Window.complete.visibility == System::Windows::Visibility.visible rescue false
-      if Thread.current[:evaluating_tutorial_input] or not repl_visible
-        # This is a synchronous &quot;puts&quot; being executed when the user has pressed &quot;Enter&quot; to execute
-        # a command. In this case, we do the default processing. This ensures that the output
-        # will get captured in Tutorial::InteractionResult.output, along with any &quot;puts&quot; executed
-        # by any Ruby files that run
-        ::Kernel.puts *a
-      else
-        # This is an async &quot;puts&quot;. It does not make sense to capture this into Tutorial::InteractionResult.output.
-        # We just ensure that it gets printed in the REPL
-        a.each { |i| WpfTutorial.tutorial.print_to_repl i.to_s, true }
-        nil
-      end
-    end
-    
-    def initialize
-      @context = ::Tutorial::ReplContext.new
-      @prev_newline = nil
-      
-      # Hook-up &quot;puts&quot; so that we can redirect asynchronous &quot;puts&quot; (typically called from event-handlers) - atleast
-      # the ones that are entered into the REPL
-      class &lt;&lt; @context.scope
-        def puts *a
-          Repl.repl_puts *a
-        end
-      end
-    end
-
-    def history
-      Window.current.repl_history
-    end
-
-    def input
-      Window.current.repl_input
-    end
-
-    def print(s, new_line = true)
-      history.text += s
-      history.text += &quot;\n&quot; if new_line
-    end
-
-    def set_prompt p = &quot;&gt;&gt;&gt;&quot;
-      @prompt = p
-      Window.current.repl_input_arrow.content = p
-    end
-    
-    def on_repl_input
-      puts &quot;in on_repl_input&quot;
-      print '' if @prev_newline
-      history.show!
-
-      input = self.input.text
-      print &quot;#{@prompt} #{input}&quot;
-      set_prompt
-      self.input.text = ''
-
-      result = @context.interact input
-      print result.output, false unless result.output.empty?
-      if result.partial_input?
-        set_prompt &quot;...&quot;
-      elsif result.error
-        print result.error.to_s
-      else
-        print &quot;=&gt; #{result.result.inspect}&quot;
-      end
-      
-      if history.text.size &gt; 1
-        # TODO should be able to do str[-1] on a clrstring
-        @prev_newline = history.text.to_s[-1] == 10 # '\n'
-        history.text = history.text.to_s[0..-2].to_clr_string
-      end
-      result
-    end
-  end
-
-end
+$:.unshift File.dirname(__FILE__) + &quot;/Libs&quot;
+
+require File.dirname(__FILE__) + '/wpf'
+include Wpf
+
+require 'tutorial'
+
+module GuiTutorial
+
+  class Tutorial
+    attr_reader :tasks, :task, :chapter, :current_tutorial 
+
+    # TODO: Figure out how to remove this condition:
+    # 
+    # When the &quot;next_chapter&quot; button is focused and the enter-button is pressed,
+    # somewhere along that process the &quot;repl_input&quot; TextBox gets focus, but 
+    # then the &quot;repl_input.key_up&quot; fires from the previous enter-button press,
+    # causing two extra lines in the repl history.
+    #
+    # This flag shunts the first key_up event, and then is set back to false. 
+    # This ignores all first-keypresses that are &quot;enter&quot;, hackily removing the
+    # issue, since &quot;enter&quot; should never really be the first key pressed. 
+    # Definitely not a perfect solution.
+    attr_accessor :handling_next_chapter
+
+    def initialize(t, window)
+      @current_tutorial ||= ::Tutorial.get_tutorial(t)
+      @window = GuiTutorial::Window.current
+    end
+
+    def self.all
+      @tutorials ||= ::Tutorial.all
+    end
+
+    def reset
+      @chapter = nil
+      @tasks = nil
+      @window.tutorial_body.children.clear
+    end
+
+    def start
+      reset
+      Window.show_tutorial
+
+      unless SILVERLIGHT
+        @window.chapters.items_source = @current_tutorial.sections
+        @window.chapters.mouse_left_button_up do |t, e|
+          select_section_or_chapter t.selected_item
+        end
+      end
+
+      @window.next_chapter.click do |t, e|
+        @handling_next_chapter = true
+        select_section_or_chapter @chapter.next_item if @chapter
+      end
+
+      select_chapter(@current_tutorial.first_chapter, @current_tutorial.first_section)
+    end
+
+    def select_section_or_chapter(item)
+      return unless item
+      case item
+      when ::Tutorial::Section: select_section item
+      when ::Tutorial::Chapter: select_chapter item
+      else 
+        raise &quot;Unknown selection type: #{item}&quot;
+      end
+    end
+
+    def select_chapter(chapter, section = nil)
+      if section
+        @window.set_or_collapse(:pre_exercise, section.introduction) do |obj, value|
+          obj.document = value
+        end
+      else
+        @window.pre_exercise.collapse!
+      end
+      @chapter = chapter
+      @window.set_or_collapse(:exercise, @chapter.introduction) do |obj, value|
+        obj.document = value
+      end
+
+      @window.tutorial_body.children.clear
+      @tasks = @chapter.tasks.clone
+      select_next_task
+    end
+
+    def select_section(section)
+      reset
+      @window.set_or_collapse(:exercise, section.introduction) do |obj, value|
+        obj.document = value
+      end
+      @window.pre_exercise.collapse!
+    end
+
+    def select_next_task
+      unless @tasks.empty?
+        begin @task = @tasks.shift end until @task.should_run? Window.repl.context.bind
+        @window.next_step
+        if @task.description
+          fd = FlowDocument.from_simple_markup @task.description
+          fd &lt;&lt; &quot;Full path: #{@task.source_files.tr('/', '\\')}&quot; if @task.source_files
+          @task.setup.call(Window.repl.context.bind) if @task.setup
+          if @task.code
+            unless SILVERLIGHT
+              p = Paragraph.new Run.new(@task.code_string)
+              p.font_family = FontFamily.new &quot;Consolas&quot;
+              p.font_weight = FontWeights.Bold
+              fd.Blocks.Add p
+            else
+              fd += &quot;\n\n#{@task.code_string}&quot;
+            end
+          end
+        end
+        @window.set_or_collapse(:step_title, @task.title) do |obj, value|
+          obj.text = value
+        end
+
+        @window.step_description.document = fd
+        @window.tutorial_scroll.scroll_to_bottom
+      else
+        if @chapter.next_item
+          @window.complete.show!
+          @window.tutorial_scroll.scroll_to_bottom
+          if @window.current_step?
+            @window.repl_input.collapse!
+            @window.repl_input_arrow.collapse!
+          end
+          @window.set_or_collapse(:complete_title, @chapter.summary.title) do |obj, value|
+            obj.text = value
+          end if @chapter.summary
+          @window.set_or_collapse(:complete_body, @chapter.summary.body) do |obj, value|
+            obj.document = FlowDocument.from_simple_markup value
+          end if @chapter.summary
+          @window.next_chapter.focus
+        else
+          if @current_tutorial.summary &amp;&amp; @current_tutorial.summary.body
+            @window.exercise.document = FlowDocument.from_simple_markup(@current_tutorial.summary.body)
+          else
+            @window.exercise.document = FlowDocument.from_simple_markup(&quot;Tutorial complete!&quot;)
+          end
+          @window.exercise.show!
+          @window.tutorial_body.children.clear
+          @window.tutorial_scroll.scroll_to_top
+        end
+      end
+    end
+
+    def process_result(result)
+      if @task and @task.success?(result)
+        select_next_task
+      end
+    end
+  end
+
+  class Window
+    module Accessors
+      def current_step
+        @current_step ||= Step.new(Window.tutorial.task, current_step_id, Window.current)
+      end
+
+      def current_step_id
+        @current_step_id || 0
+      end
+
+      def current_step?
+        respond_to?(:&quot;step_#{current_step_id}&quot;)
+      end
+
+      def current_step_object
+        current_step.object
+      end
+
+      def next_step
+        complete.collapse!
+        if current_step?
+          repl_input.collapse! 
+          repl_input_arrow.collapse! 
+        end
+
+        @current_step = nil
+        @current_step_id ||= -1
+        @current_step_id  +=  1
+        
+        current_step.show
+      end
+
+      def reset_step
+        @current_step_id = 0
+        @current_step = nil
+      end
+
+      def cache_step(name, object)
+        instance_variable_set(:&quot;@#{name}&quot;, object)
+        self.class.class_eval { attr_reader :&quot;#{name}&quot; }
+      end
+
+      delegate_methods [:step_title, :step_description], :to =&gt; :current_step_object, :append =&gt; :current_step_id
+   
+      delegate_methods [:repl_input, :repl_input_arrow, :repl_history], 
+        :to =&gt; :current_step_object, :prepend =&gt; 'step', :append =&gt; :current_step_id
+    end
+
+    class &lt;&lt; self
+      attr_reader :step_xaml, :tut_xaml
+      attr_reader :repl, :tutorial
+
+      def current
+        @window ||= create
+      end
+
+      def create
+        win = XamlReader.load xaml do |win|
+          win.main.children.clear
+
+          GuiTutorial::Tutorial.all.each_with_index do |(path,tutorial), index|
+            tutorial_id, tutorial_title_id, tutorial_desc_id = &quot;tutorial_#{index}&quot;, &quot;tutorial_title_#{index}&quot;, &quot;tutorial_desc_#{index}&quot;
+            tutorial_id_OnMouseLeave_BeginStoryboard = &quot;tutorial_#{index}_OnMouseLeave_BeginStoryboard&quot;
+            
+            XamlReader.erb_load(@tut_xaml, binding) do |obj|
+              obj.send(tutorial_title_id).text = tutorial.name
+
+              obj.send(tutorial_desc_id).document = tutorial.introduction
+              win.main.children.add obj
+              
+              obj.mouse_left_button_up do |t, e|
+                @tutorial = GuiTutorial::Tutorial.new(path, Window.current)
+                @tutorial.start
+              end
+              
+              obj.show!
+            end
+          end
+          show_main(win)
+          @repl = Repl.new
+        end
+        class &lt;&lt; win
+          include Accessors
+        end
+        win
+      end
+
+      def show_main(win = current)
+        win.header_name.text = 'Pick a tutorial'
+        win.main_scroll.show!
+        win.tutorial_scroll.collapse!
+        win.tutorial_nav.collapse!
+        win.complete.collapse!
+        if @tutorial
+          win.header_navigation.show!
+          win.header_navigation.action.text = &quot;Resume tutorial&quot; 
+          win.header_navigation.action.mouse_left_button_up {|t,e| show_tutorial}
+        else
+          win.header_navigation.collapse!
+        end
+      end
+
+      def show_tutorial
+        current.main_scroll.collapse!
+        current.tutorial_scroll.show!
+        current.tutorial_nav.show! unless SILVERLIGHT
+        current.complete.collapse!
+        current.header_name.text = @tutorial.current_tutorial.name
+        current.header_navigation.show!
+        current.header_navigation.action.text = &quot;Back&quot;
+        current.header_navigation.action.mouse_left_button_up {|t,e| show_main}
+      end
+
+      def xaml
+        design = File.dirname(__FILE__) + '/design/' + (SILVERLIGHT ? 'TutorialSL' : 'Tutorial')
+        @step_xaml, @tut_xaml = ['Step', 'Tutorial'].map do |i|
+          sx = sanitize_xaml(File.open(design + &quot;/#{i}Control.xaml&quot;){|f| f.read})
+          sx.sub!(/&lt;UserControl.*?&gt;(.*?)&lt;\/UserControl&gt;/, '\1') if i == 'Step'
+          sx.gsub!(/(&quot;|\{StaticResource )(\S*?)_id(\S*?)(&quot;|\})/, '\1&lt;%= \2_id %&gt;\3\4')
+          sx.strip
+        end
+        
+        sanitize_xaml(
+          File.open(design + &quot;/Main#{SILVERLIGHT ? 'Page' : 'Window'}.xaml&quot;){|f| f.read}.
+               gsub(
+                 /&lt;local:TutorialPage.*?\/&gt;/, 
+                 File.open(design + &quot;/TutorialPage.xaml&quot;){|f| f.read}.
+                      gsub(/&lt;local:StepControl.*?\/&gt;/, '')).
+               gsub(/&lt;local:TutorialControl.*?\/&gt;/, '')
+        )
+      end
+
+      private
+        def sanitize_xaml(xaml) 
+          {
+            /x:Class=&quot;.*?&quot;/          =&gt; '',
+            /xmlns:local=&quot;.*?&quot;/      =&gt; '',
+            /mc:Ignorable=&quot;.*?&quot;/     =&gt; '',
+            /xmlns:mc=&quot;.*?&quot;/         =&gt; '',
+            /xmlns:d=&quot;.*?&quot;/          =&gt; '',
+            'Loaded=&quot;Window_Loaded&quot;' =&gt; '',
+            '&lt;TreeView '             =&gt; '&lt;TreeView ItemTemplate=&quot;{StaticResource SectionTemplate}&quot; ',
+            /\357\273\277/           =&gt;  '',
+            /d:.*?=&quot;.*?&quot;/            =&gt;  ''
+          }.inject(xaml) do |_xaml,(k,v)| 
+            _xaml.gsub(k, v)
+          end.gsub(/(\n|\t)/, ' ').squeeze(' ')
+        end
+    end
+  end
+
+  class Step
+    @@vars = :step_id,
+      :step_title_id, :step_description_id,
+      :step_wrapper_id, :step_repl_id,
+      :step_repl_history_id, :step_repl_input_id, :step_repl_input_arrow_id
+
+    attr_reader *@@vars
+
+    attr_reader :object
+
+    def initialize(task, element_id, window)
+      @task = task
+      @element_id = &quot;step_#{element_id}&quot;
+      @window = window
+      raise &quot;Element #{@element_id} already exists&quot; if @window.respond_to? @element_id
+      init_vars
+    end
+
+    def show
+      @object = XamlReader.erb_load(Window.step_xaml, binding) do |obj|
+        @window.tutorial_body.children.add obj
+        @window.cache_step(@element_id, obj)
+        obj.show!
+      end
+
+      Window.repl.prev_newline = nil
+      @window.repl_history.text = ''
+
+      @window.repl_input.show!
+      Window.repl.set_prompt
+      Window.repl.context.reset_input
+
+      # TODO - Should use TextChanged here
+      @window.repl_input.key_up do |target, event_args|
+        if event_args.key == Key.enter &amp;&amp; !Window.tutorial.handling_next_chapter
+          Window.tutorial.process_result Window.repl.on_repl_input
+        elsif event_args.Key == (!SILVERLIGHT ? Key.System : Key.alt)
+          # This allows hitting Alt-Enter to automatically enter the code
+          # It is useful during manual testing of a tutorial's content
+          if @task.code.respond_to? :to_ary
+            @task.code.to_ary.each do |code| 
+              Window.current.repl_input.text = code
+              Window.tutorial.process_result Window.repl.on_repl_input
+            end
+          else
+            Window.current.repl_input.text = @task.code
+            Window.tutorial.process_result Window.repl.on_repl_input
+          end
+        end
+        Window.tutorial.handling_next_chapter = false
+      end
+
+      @window.repl_input_arrow.show!
+      @window.repl_input.focus
+    end
+
+    private
+      def init_vars
+        @@vars.each do |v|
+          instance_variable_set(
+            :&quot;@#{v}&quot;, 
+            &quot;#{v.to_s.split('_id').first}_#{@window.current_step_id}&quot;
+          )
+        end
+      end
+  end
+
+  class Repl
+    attr_accessor :prev_newline
+    attr_accessor :context
+
+    def self.repl_puts *a
+      repl_visible = Window.complete.visibility == System::Windows::Visibility.visible rescue false
+      if Thread.current[:evaluating_tutorial_input] or not repl_visible
+        # This is a synchronous &quot;puts&quot; being executed when the user has pressed &quot;Enter&quot; to execute
+        # a command. In this case, we do the default processing. This ensures that the output
+        # will get captured in Tutorial::InteractionResult.output, along with any &quot;puts&quot; executed
+        # by any Ruby files that run
+        ::Kernel.puts *a
+      else
+        # This is an async &quot;puts&quot;. It does not make sense to capture this into Tutorial::InteractionResult.output.
+        # We just ensure that it gets printed in the REPL
+        a.each { |i| WpfTutorial.tutorial.print_to_repl i.to_s, true }
+        nil
+      end
+    end
+    
+    def initialize
+      @context = ::Tutorial::ReplContext.new
+      @prev_newline = nil
+      
+      # Hook-up &quot;puts&quot; so that we can redirect asynchronous &quot;puts&quot; (typically called from event-handlers) - atleast
+      # the ones that are entered into the REPL
+      class &lt;&lt; @context.scope
+        def puts *a
+          Repl.repl_puts *a
+        end
+      end
+    end
+
+    def history
+      Window.current.repl_history
+    end
+
+    def input
+      Window.current.repl_input
+    end
+
+    def print(s, new_line = true)
+      history.text += s
+      history.text += &quot;\n&quot; if new_line
+    end
+
+    def set_prompt p = &quot;&gt;&gt;&gt;&quot;
+      @prompt = p
+      Window.current.repl_input_arrow.content = p
+    end
+    
+    def on_repl_input
+      print '' if @prev_newline
+      history.show!
+
+      input = self.input.text
+      print &quot;#{@prompt} #{input}&quot;
+      set_prompt
+      self.input.text = ''
+
+      result = @context.interact input
+      print result.output, false unless result.output.empty?
+      if result.partial_input?
+        set_prompt &quot;...&quot;
+      elsif result.error
+        print result.error.to_s
+      else
+        print &quot;=&gt; #{result.result.inspect}&quot;
+      end
+      
+      if history.text.size &gt; 1
+        # TODO should be able to do str[-1] on a clrstring
+        @prev_newline = history.text.to_s[-1] == 10 # '\n'
+        history.text = history.text.to_s[0..-2].to_clr_string
+      end
+      result
+    end
+  end
+
+end</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/gui_tutorial.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,114 +1,114 @@
-&#65279;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
-&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
-&lt;head&gt;
-    &lt;title&gt;Silverlight Template&lt;/title&gt;
-
-    &lt;!-- Basic stylesheet for application --&gt;
-    &lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;css/screen.css&quot; /&gt;
-
-    &lt;!-- Defines &quot;onSilverlightError&quot; function for Silverlight plugin --&gt;
-    &lt;script type=&quot;text/javascript&quot; src=&quot;js/error.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-  &lt;!-- 
-    Runtime errors from Silverlight will be displayed here.
-    This will contain debugging information and should be 
-    removed or hidden when debugging is completed 
-  --&gt;
-  &lt;div id='errorLocation'&gt;&lt;/div&gt;
-
-  &lt;div id=&quot;silverlightControlHost&quot;&gt;
-
-    &lt;!-- 
-      Silverlight plug-in control 
-      http://msdn.microsoft.com/en-us/library/cc189089(VS.95).aspx#silverlight_plug_in_configuring
-    --&gt;
-    &lt;object data=&quot;data:application/x-silverlight,&quot; type=&quot;application/x-silverlight-2&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
-
-      &lt;!-- 
-        &quot;source&quot; points to the actual Silverlight application
-        If using &quot;Chiron /w&quot;, value should be the &quot;&lt;your app folder&gt;.xap&quot;
-      --&gt;
-      &lt;param name=&quot;source&quot; value=&quot;../Tutorial.xap&quot;/&gt;
-
-      &lt;!-- 
-        &quot;initParams&quot; is a comma-seperated way to pass key=value pair arguments 
-        into your Silverlight application. Dynamic Languages use special 
-        arguments to configure the application:
-    
-        * start = app.(rb|py|js)
-          - this is the entry-point file to the application. 
-          - By default, it will look for any file named &quot;app&quot;, regardless of 
-            the extension. The extension will be used to figure out the language. 
-          - This option can be set to anything you want, but it must include 
-            the extension.
-
-        * debug = [true]|false
-          - Runs your code as debug-able; stack traces will be shown if an error
-            occurs. 
-          - This lets you attach the browser to the Visual Studio
-            debugger and step through the running program (only when the
-            Silverlight tools are installed).
-          - When omitted/set to false, all errors will be silent 
-            (for deployment purposes)
-
-        * reportErrors = [HTML-element-ID]
-          - In the event of an error, the error window will be written into the 
-            innerHTML property of the HTML element with an ID attribute matching 
-            the value of this field.
-          - If there is no matching ID, a HTML element is created with that ID, 
-            and the error window inserted.
-          - If this field is omitted, no errors will be shown.
-            + You can define the &quot;onerror&quot; param, which will let you handle any 
-              error with JavaScript (the index.html templates do this, if you
-              want sample code).
-
-        * exceptionDetail = true|[false]
-          - If set to true, this will also show the entire managed stack trace 
-            in the error window rather than just the dynamic stack trace. 
-            This is useful when debugging C#/Visual Basic when called from a 
-            dynamic language.
-
-        * console = true|[false]
-          - If set to true, will show a read-eval-print loop (REPL) window at
-            the bottom of the page, for whatever language the start script is in.
-      --&gt;
-      &lt;param name=&quot;initParams&quot; value=&quot;start=sl_tutorial.rb, debug=true, reportErrors=errorLocation, console=true&quot; /&gt;
-        
-      &lt;!-- Handle all Silverlight errors with function defined in javascripts/error.js --&gt;
-      &lt;param name=&quot;onerror&quot; value=&quot;onSilverlightError&quot; /&gt;
-      
-      &lt;!-- 
-        Other properties of the Silverlight plug-in. For documentation on this, see:
-        http://msdn.microsoft.com/en-us/library/cc189089(VS.95).aspx#silverlight_plug_in_configuring
-      --&gt;
-      &lt;param name=&quot;background&quot; value=&quot;white&quot; /&gt;
-      &lt;param name=&quot;windowless&quot; value=&quot;true&quot; /&gt;
-
-      &lt;!--
-	  &lt;param name=&quot;minRuntimeVersion&quot; value=&quot;2.0.31005.0&quot; /&gt;
-      &lt;param name=&quot;autoUpgrade&quot; value=&quot;true&quot; /&gt;
-      --&gt;
-
-      &lt;!-- 
-        Shows a &quot;Install Microsoft Silverlight&quot; link if Silverlight is 
-        not installed
-      --&gt;
-      &lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=124807&quot; style=&quot;text-decoration: none;&quot;&gt;
-        &lt;img src=&quot;http://go.microsoft.com/fwlink/?LinkId=108181&quot; alt=&quot;Get Microsoft Silverlight&quot; style=&quot;border-style: none&quot;/&gt;
-      &lt;/a&gt;
-
-    &lt;/object&gt;
-
-    &lt;!-- 
-      &lt;iframe&gt; needed to prevent Safari from caching the page and reloading
-      the plugin when the user navigates back to a previously-visted 
-      Silverlight page.
-    --&gt;
-    &lt;iframe style='visibility:hidden;height:0;width:0;border:0px'&gt;&lt;/iframe&gt;
-  
-  &lt;/div&gt;
-
-&lt;/body&gt;
-&lt;/html&gt;
+&#65279;&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
+&lt;head&gt;
+    &lt;title&gt;Silverlight Template&lt;/title&gt;
+
+    &lt;!-- Basic stylesheet for application --&gt;
+    &lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;css/screen.css&quot; /&gt;
+
+    &lt;!-- Defines &quot;onSilverlightError&quot; function for Silverlight plugin --&gt;
+    &lt;script type=&quot;text/javascript&quot; src=&quot;js/error.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+  &lt;!-- 
+    Runtime errors from Silverlight will be displayed here.
+    This will contain debugging information and should be 
+    removed or hidden when debugging is completed 
+  --&gt;
+  &lt;div id='errorLocation'&gt;&lt;/div&gt;
+
+  &lt;div id=&quot;silverlightControlHost&quot;&gt;
+
+    &lt;!-- 
+      Silverlight plug-in control 
+      http://msdn.microsoft.com/en-us/library/cc189089(VS.95).aspx#silverlight_plug_in_configuring
+    --&gt;
+    &lt;object data=&quot;data:application/x-silverlight,&quot; type=&quot;application/x-silverlight-2&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
+
+      &lt;!-- 
+        &quot;source&quot; points to the actual Silverlight application
+        If using &quot;Chiron /w&quot;, value should be the &quot;&lt;your app folder&gt;.xap&quot;
+      --&gt;
+      &lt;param name=&quot;source&quot; value=&quot;../Tutorial.xap&quot;/&gt;
+
+      &lt;!-- 
+        &quot;initParams&quot; is a comma-seperated way to pass key=value pair arguments 
+        into your Silverlight application. Dynamic Languages use special 
+        arguments to configure the application:
+    
+        * start = app.(rb|py|js)
+          - this is the entry-point file to the application. 
+          - By default, it will look for any file named &quot;app&quot;, regardless of 
+            the extension. The extension will be used to figure out the language. 
+          - This option can be set to anything you want, but it must include 
+            the extension.
+
+        * debug = [true]|false
+          - Runs your code as debug-able; stack traces will be shown if an error
+            occurs. 
+          - This lets you attach the browser to the Visual Studio
+            debugger and step through the running program (only when the
+            Silverlight tools are installed).
+          - When omitted/set to false, all errors will be silent 
+            (for deployment purposes)
+
+        * reportErrors = [HTML-element-ID]
+          - In the event of an error, the error window will be written into the 
+            innerHTML property of the HTML element with an ID attribute matching 
+            the value of this field.
+          - If there is no matching ID, a HTML element is created with that ID, 
+            and the error window inserted.
+          - If this field is omitted, no errors will be shown.
+            + You can define the &quot;onerror&quot; param, which will let you handle any 
+              error with JavaScript (the index.html templates do this, if you
+              want sample code).
+
+        * exceptionDetail = true|[false]
+          - If set to true, this will also show the entire managed stack trace 
+            in the error window rather than just the dynamic stack trace. 
+            This is useful when debugging C#/Visual Basic when called from a 
+            dynamic language.
+
+        * console = true|[false]
+          - If set to true, will show a read-eval-print loop (REPL) window at
+            the bottom of the page, for whatever language the start script is in.
+      --&gt;
+      &lt;param name=&quot;initParams&quot; value=&quot;start=sl_tutorial.rb, debug=true, reportErrors=errorLocation, console=true&quot; /&gt;
+        
+      &lt;!-- Handle all Silverlight errors with function defined in javascripts/error.js --&gt;
+      &lt;param name=&quot;onerror&quot; value=&quot;onSilverlightError&quot; /&gt;
+      
+      &lt;!-- 
+        Other properties of the Silverlight plug-in. For documentation on this, see:
+        http://msdn.microsoft.com/en-us/library/cc189089(VS.95).aspx#silverlight_plug_in_configuring
+      --&gt;
+      &lt;param name=&quot;background&quot; value=&quot;white&quot; /&gt;
+      &lt;param name=&quot;windowless&quot; value=&quot;true&quot; /&gt;
+
+      &lt;!--
+	  &lt;param name=&quot;minRuntimeVersion&quot; value=&quot;2.0.31005.0&quot; /&gt;
+      &lt;param name=&quot;autoUpgrade&quot; value=&quot;true&quot; /&gt;
+      --&gt;
+
+      &lt;!-- 
+        Shows a &quot;Install Microsoft Silverlight&quot; link if Silverlight is 
+        not installed
+      --&gt;
+      &lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=124807&quot; style=&quot;text-decoration: none;&quot;&gt;
+        &lt;img src=&quot;http://go.microsoft.com/fwlink/?LinkId=108181&quot; alt=&quot;Get Microsoft Silverlight&quot; style=&quot;border-style: none&quot;/&gt;
+      &lt;/a&gt;
+
+    &lt;/object&gt;
+
+    &lt;!-- 
+      &lt;iframe&gt; needed to prevent Safari from caching the page and reloading
+      the plugin when the user navigates back to a previously-visted 
+      Silverlight page.
+    --&gt;
+    &lt;iframe style='visibility:hidden;height:0;width:0;border:0px'&gt;&lt;/iframe&gt;
+  
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,32 +1,32 @@
-function onSilverlightError(sender, args) {
-    var appSource = &quot;&quot;;
-    if (sender != null &amp;&amp; sender != 0) {
-        appSource = sender.getHost().Source;
-    } 
-    var errorType = args.ErrorType;
-    var iErrorCode = args.ErrorCode;
-    
-    var errMsg = &quot;Unhandled Error in Silverlight 2 Application &quot; +  appSource + &quot;\n&quot; ;
-
-    errMsg += &quot;Code: &quot;+ iErrorCode + &quot;    \n&quot;;
-    errMsg += &quot;Category: &quot; + errorType + &quot;       \n&quot;;
-    errMsg += &quot;Message: &quot; + args.ErrorMessage + &quot;     \n&quot;;
-
-    if (errorType == &quot;ParserError&quot;)
-    {
-        errMsg += &quot;File: &quot; + args.xamlFile + &quot;     \n&quot;;
-        errMsg += &quot;Line: &quot; + args.lineNumber + &quot;     \n&quot;;
-        errMsg += &quot;Position: &quot; + args.charPosition + &quot;     \n&quot;;
-    }
-    else if (errorType == &quot;RuntimeError&quot;)
-    {           
-        if (args.lineNumber != 0)
-        {
-            errMsg += &quot;Line: &quot; + args.lineNumber + &quot;     \n&quot;;
-            errMsg += &quot;Position: &quot; +  args.charPosition + &quot;     \n&quot;;
-        }
-        errMsg += &quot;MethodName: &quot; + args.methodName + &quot;     \n&quot;;
-    }
-
-    throw new Error(errMsg);
-}
+function onSilverlightError(sender, args) {
+    var appSource = &quot;&quot;;
+    if (sender != null &amp;&amp; sender != 0) {
+        appSource = sender.getHost().Source;
+    } 
+    var errorType = args.ErrorType;
+    var iErrorCode = args.ErrorCode;
+    
+    var errMsg = &quot;Unhandled Error in Silverlight 2 Application &quot; +  appSource + &quot;\n&quot; ;
+
+    errMsg += &quot;Code: &quot;+ iErrorCode + &quot;    \n&quot;;
+    errMsg += &quot;Category: &quot; + errorType + &quot;       \n&quot;;
+    errMsg += &quot;Message: &quot; + args.ErrorMessage + &quot;     \n&quot;;
+
+    if (errorType == &quot;ParserError&quot;)
+    {
+        errMsg += &quot;File: &quot; + args.xamlFile + &quot;     \n&quot;;
+        errMsg += &quot;Line: &quot; + args.lineNumber + &quot;     \n&quot;;
+        errMsg += &quot;Position: &quot; + args.charPosition + &quot;     \n&quot;;
+    }
+    else if (errorType == &quot;RuntimeError&quot;)
+    {           
+        if (args.lineNumber != 0)
+        {
+            errMsg += &quot;Line: &quot; + args.lineNumber + &quot;     \n&quot;;
+            errMsg += &quot;Position: &quot; +  args.charPosition + &quot;     \n&quot;;
+        }
+        errMsg += &quot;MethodName: &quot; + args.methodName + &quot;     \n&quot;;
+    }
+
+    throw new Error(errMsg);
+}</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/js/error.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,22 +1,22 @@
-# ****************************************************************************
-#
-# Copyright (c) Microsoft Corporation. 
-#
-# This source code is subject to terms and conditions of the Microsoft Public License. A 
-# copy of the license can be found in the License.html file at the root of this distribution. If 
-# you cannot locate the  Microsoft Public License, please send an email to 
-# ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
-# by the terms of the Microsoft Public License.
-#
-# You must not remove this notice, or any other, from this software.
-#
-#
-# ****************************************************************************
-
-include Microsoft::Scripting::Silverlight
-$stdout = Repl.current.output_buffer
-$stderr = Repl.current.output_buffer
-
-require 'gui_tutorial'
-
-Application.Current.RootVisual = GuiTutorial::Window.current
+# ****************************************************************************
+#
+# Copyright (c) Microsoft Corporation. 
+#
+# This source code is subject to terms and conditions of the Microsoft Public License. A 
+# copy of the license can be found in the License.html file at the root of this distribution. If 
+# you cannot locate the  Microsoft Public License, please send an email to 
+# ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
+# by the terms of the Microsoft Public License.
+#
+# You must not remove this notice, or any other, from this software.
+#
+#
+# ****************************************************************************
+
+include Microsoft::Scripting::Silverlight
+$stdout = Repl.current.output_buffer
+$stderr = Repl.current.output_buffer
+
+require 'gui_tutorial'
+
+Application.Current.RootVisual = GuiTutorial::Window.current</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/sl_tutorial.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-&quot;%~dp0..\..\..\..\Bin\Silverlight Release\Chiron.exe&quot; /b:Tutorial/index.html /d:&quot;%~dp0..&quot;
+&quot;%~dp0..\..\..\..\Bin\Silverlight Release\Chiron.exe&quot; /b:Tutorial/index.html /d:&quot;%~dp0..&quot;</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/tutorial-sl.bat</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,17 @@
-&quot;%~dp0..\..\..\..\Bin\Release\ir.exe&quot; %~dp0wpf_tutorial.rb %*
+@echo off
+setlocal ENABLEDELAYEDEXPANSION
+
+set IR_CMD=&quot;%~dp0ir.exe&quot;
+if defined MERLIN_ROOT (
+  REM - This is a dev environment. See http://wiki.github.com/ironruby/ironruby
+  if not EXIST !IR_CMD! set IR_CMD=&quot;%~dp0..\..\..\..\Bin\Release\ir.exe&quot;
+  if not EXIST !IR_CMD! set IR_CMD=&quot;%MERLIN_ROOT%\bin\Debug\ir.exe&quot;
+  if not EXIST !IR_CMD! (
+    echo Could not find ir.exe
+    goto END
+  )
+)
+
+%IR_CMD% %~dp0wpf_tutorial.rb %*
+
+:END</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/tutorial.bat</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,8 @@
 
 require &quot;stringio&quot;
 
+SILVERLIGHT = false unless defined? SILVERLIGHT
+
 module Tutorial
 
   class Summary</diff>
      <filename>Merlin/Main/Languages/Ruby/Samples/Tutorial/tutorial.rb</filename>
    </modified>
    <modified>
      <diff>@@ -42,20 +42,6 @@ if exist &quot;%PROGRAM_FILES_32%\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat&quot; (
 
 set PATH=%PATH%;%MERLIN_ROOT%\Languages\Ruby\Scripts;%MERLIN_ROOT%\Languages\Ruby\Scripts\bin;%RUBY18_BIN%;%MERLIN_ROOT%\..\External.LCA_RESTRICTED\Languages\IronRuby\mspec\mspec\bin
 
-if not DEFINED HOME (
-  if DEFINED HOMEDRIVE (
-    if DEFINED HOMEPATH (
-      set HOME=%HOMEDRIVE%\%HOMEPATH%
-      goto SetRubyEnv
-    )
-  )
-  if not DEFINED USERPROFILE (
-    echo Error: One of HOME, HOMEDRIVE,HOMEPATH, or USERPROFILE needs to be set
-    goto END
-  )
-  set HOME=%USERPROFILE%
-)
-
 :SetRubyEnv
 
 if NOT exist &quot;%HOME%\.mspecrc&quot; (</diff>
      <filename>Merlin/Main/Languages/Ruby/Scripts/Dev.bat</filename>
    </modified>
    <modified>
      <diff>@@ -15,14 +15,14 @@ describe &quot;System::String.new&quot; do
 
   before(:each) do
     @a = Klass.new.a
-    @aa = Klass.new.aa
+    @aa = Klass.new.Aa
   end
 
   it &quot;returns a new System::String from the argument&quot; do
     System::String.new(&quot;a&quot;).should == Klass.new.a
     System::String.new(System::Char.new(&quot;a&quot;)).should == Klass.new.a
-    System::String.new(System::Char.new(&quot;a&quot;), 2).should == Klass.new.aa
-    System::String.new(System::Array.of(System::Char).new(2, System::Char.new(&quot;a&quot;))).should == Klass.new.aa
+    System::String.new(System::Char.new(&quot;a&quot;), 2).should == Klass.new.Aa
+    System::String.new(System::Array.of(System::Char).new(2, System::Char.new(&quot;a&quot;))).should == Klass.new.Aa
   end
 end
 </diff>
      <filename>Merlin/Main/Languages/Ruby/Tests/Interop/net/bcl/string/construction_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,7 +68,7 @@ describe &quot;Reading .NET Fields&quot; do
     it_behaves_like :accessing_fields, nil
   end
   
-  if IronRuby.dlr_config.private_binding
+  if IronRuby.configuration.private_binding
     describe &quot;works with private&quot; do
       before(:each) do
         @result = {
@@ -137,7 +137,7 @@ describe &quot;Setting .NET Fields&quot; do
     end
   end
 
-  if IronRuby.dlr_config.private_binding
+  if IronRuby.configuration.private_binding
     describe &quot;with private&quot; do
       it &quot;fields works&quot; do
         @klass.privateField = &quot;bar&quot;</diff>
      <filename>Merlin/Main/Languages/Ruby/Tests/Interop/net/fields/access_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -155,7 +155,7 @@ describe :generic_methods, :shared =&gt; true do
     @klass.method(:type_constraint_method).of(SubKlass, Klass).call(SubKlass.new).foo.should == 10
   end
 
-  if IronRuby.dlr_config.private_binding
+  if IronRuby.configuration.private_binding
     it &quot;are callable via call and [] when private&quot; do
       @private_method_list.each do |m|
         generic_count, arity = m.match(/_(\d)_generic_(\d)_/)[1..2].map {|e| e.to_i}</diff>
      <filename>Merlin/Main/Languages/Ruby/Tests/Interop/net/method/invocation/generic_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,7 +68,11 @@ class TestGemRemoteFetcher
   def test_zip() end
   def test_request_unmodifed() end
 end
-
+#Fails with RangeError: bignum too big to convert into `long'
+class TestGemSpecification
+  def test_files_non_array_pathological() end
+  def test_hash() end
+end
 class TestGemValidator
   def test_verify_gem_file_empty() end
 end
@@ -80,3 +84,9 @@ class TestTarWriter
   def test_close() end
   def test_mkdir() end
 end
+
+class TestGemSourceInfoCache
+  # Fails non-deterministically with this message
+  #   Expected /Bulk updating/ to match &quot;&quot;.
+  def test_self_cache_refreshes() end
+end</diff>
      <filename>Merlin/Main/Languages/Ruby/Tests/Scripts/RubyGemsTests.rb</filename>
    </modified>
    <modified>
      <diff>@@ -88,7 +88,7 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;summary&gt;
         /// Converts the provided expression to the given type.  The expression is safe to evaluate multiple times.
         /// &lt;/summary&gt;
-        public virtual Expression ConvertExpression(Expression expr, Type toType, ConversionResultKind kind, Expression context) {
+        public virtual Expression ConvertExpression(Expression expr, Type toType, ConversionResultKind kind, OverloadResolverFactory resolverFactory) {
             ContractUtils.RequiresNotNull(expr, &quot;expr&quot;);
             ContractUtils.RequiresNotNull(toType, &quot;toType&quot;);
 
@@ -107,12 +107,6 @@ namespace Microsoft.Scripting.Actions {
             }
 
             Type visType = CompilerHelpers.GetVisibleType(toType);
-            Expression[] args;
-            if (context != null) {
-                args = new Expression[] { context, expr };
-            } else {
-                args = new Expression[] { expr };
-            }
 
             return Expression.Convert(expr, toType);
         }
@@ -193,8 +187,8 @@ namespace Microsoft.Scripting.Actions {
             );
         }
 
-        public ErrorInfo MakeStaticPropertyInstanceAccessError(PropertyTracker tracker, bool isAssignment, params Expression[] parameters) {
-            return MakeStaticPropertyInstanceAccessError(tracker, isAssignment, (IList&lt;Expression&gt;)parameters);
+        public ErrorInfo MakeStaticPropertyInstanceAccessError(PropertyTracker tracker, bool isAssignment, params DynamicMetaObject[] parameters) {
+            return MakeStaticPropertyInstanceAccessError(tracker, isAssignment, (IList&lt;DynamicMetaObject&gt;)parameters);
         }
 
         /// &lt;summary&gt;
@@ -202,7 +196,7 @@ namespace Microsoft.Scripting.Actions {
         /// 
         /// The default behavior is to allow the assignment.
         /// &lt;/summary&gt;
-        public virtual ErrorInfo MakeStaticAssignFromDerivedTypeError(Type accessingType, DynamicMetaObject self, MemberTracker assigning, Expression assignedValue, Expression context) {
+        public virtual ErrorInfo MakeStaticAssignFromDerivedTypeError(Type accessingType, DynamicMetaObject self, MemberTracker assigning, DynamicMetaObject assignedValue, OverloadResolverFactory context) {
             switch (assigning.MemberType) {
                 case TrackerTypes.Property:
                     PropertyTracker pt = (PropertyTracker)assigning;
@@ -211,7 +205,7 @@ namespace Microsoft.Scripting.Actions {
                         AstUtils.SimpleCallHelper(
                             setter,
                             ConvertExpression(
-                                assignedValue,
+                                assignedValue.Expression,
                                 setter.GetParameters()[0].ParameterType,
                                 ConversionResultKind.ExplicitCast,
                                 context
@@ -223,7 +217,7 @@ namespace Microsoft.Scripting.Actions {
                     return ErrorInfo.FromValueNoError(
                         Expression.Assign(
                             Expression.Field(null, ft.Field),
-                            ConvertExpression(assignedValue, ft.FieldType, ConversionResultKind.ExplicitCast, context)
+                            ConvertExpression(assignedValue.Expression, ft.FieldType, ConversionResultKind.ExplicitCast, context)
                         )
                     );
                 default:
@@ -241,7 +235,7 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;param name=&quot;parameters&quot;&gt;The parameters being used to access the property.  This includes the instance as the first entry, any index parameters, and the
         /// value being assigned as the last entry if isAssignment is true.&lt;/param&gt;
         /// &lt;returns&gt;&lt;/returns&gt;
-        public virtual ErrorInfo MakeStaticPropertyInstanceAccessError(PropertyTracker tracker, bool isAssignment, IList&lt;Expression&gt; parameters) {
+        public virtual ErrorInfo MakeStaticPropertyInstanceAccessError(PropertyTracker tracker, bool isAssignment, IList&lt;DynamicMetaObject&gt; parameters) {
             ContractUtils.RequiresNotNull(tracker, &quot;tracker&quot;);
             ContractUtils.Requires(tracker.IsStatic, &quot;tracker&quot;, Strings.ExpectedStaticProperty);
             ContractUtils.RequiresNotNull(parameters, &quot;parameters&quot;);
@@ -296,46 +290,7 @@ namespace Microsoft.Scripting.Actions {
         }
 
         #endregion
-
-        #region Deprecated Error production
-
-
-        /// &lt;summary&gt;
-        /// Provides a way for the binder to provide a custom error message when lookup fails.  Just
-        /// doing this for the time being until we get a more robust error return mechanism.
-        /// &lt;/summary&gt;
-        public virtual Expression MakeReadOnlyMemberError(RuleBuilder rule, Type type, string name) {
-            return rule.MakeError(
-                Expression.New(
-                    typeof(MissingMemberException).GetConstructor(new Type[] { typeof(string) }),
-                    AstUtils.Constant(name)
-                )
-            );
-        }
-
-        /// &lt;summary&gt;
-        /// Provides a way for the binder to provide a custom error message when lookup fails.  Just
-        /// doing this for the time being until we get a more robust error return mechanism.
-        /// &lt;/summary&gt;
-        public virtual Expression MakeUndeletableMemberError(RuleBuilder rule, Type type, string name) {
-            return MakeReadOnlyMemberError(rule, type, name);
-        }
-
-        #endregion
-
-        public virtual ErrorInfo MakeEventValidation(RuleBuilder rule, MemberGroup members) {
-            EventTracker ev = (EventTracker)members[0];
-
-            // handles in place addition of events - this validates the user did the right thing.
-            return ErrorInfo.FromValueNoError(
-                Expression.Call(
-                    typeof(ScriptingRuntimeHelpers).GetMethod(&quot;SetEvent&quot;),
-                    AstUtils.Constant(ev),
-                    rule.Parameters[1]
-                )
-            );
-        }
-
+       
         public virtual string GetTypeName(Type t) {
             return t.Name;
         }
@@ -429,65 +384,44 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;param name=&quot;memberTracker&quot;&gt;The member which is being returned to the user.&lt;/param&gt;
         /// &lt;param name=&quot;type&quot;&gt;Tthe type which the memberTrack was accessed from&lt;/param&gt;
         /// &lt;returns&gt;&lt;/returns&gt;
-        public virtual Expression ReturnMemberTracker(Type type, MemberTracker memberTracker) {
+        public virtual DynamicMetaObject ReturnMemberTracker(Type type, MemberTracker memberTracker) {
             if (memberTracker.MemberType == TrackerTypes.Bound) {
                 BoundMemberTracker bmt = (BoundMemberTracker)memberTracker;
-                return Expression.New(
-                    typeof(BoundMemberTracker).GetConstructor(new Type[] { typeof(MemberTracker), typeof(object) }),
-                    AstUtils.Constant(bmt.BoundTo),
-                    bmt.Instance);
+                return new DynamicMetaObject(
+                    Expression.New(
+                        typeof(BoundMemberTracker).GetConstructor(new Type[] { typeof(MemberTracker), typeof(object) }),
+                        AstUtils.Constant(bmt.BoundTo),
+                        bmt.Instance.Expression
+                    ),
+                    BindingRestrictions.Empty
+                );
             }
 
-            return AstUtils.Constant(memberTracker);
+            return new DynamicMetaObject(AstUtils.Constant(memberTracker), BindingRestrictions.Empty, memberTracker);
         }
 
-        /// &lt;summary&gt;
-        /// Builds an expression for a call to the provided method using the given expressions.  If the
-        /// method is not static the first parameter is used for the instance.
-        /// 
-        /// Parameters are converted using the binder's conversion rules.
-        /// 
-        /// If an incorrect number of parameters is provided MakeCallExpression returns null.
-        /// &lt;/summary&gt;
-        public Expression MakeCallExpression(Expression context, MethodInfo method, IList&lt;Expression&gt; parameters) {
-            ParameterInfo[] infos = method.GetParameters();
-            Expression callInst = null;
-            int parameter = 0, startArg = 0;
-            Expression[] callArgs = new Expression[infos.Length];
-
-            if (!method.IsStatic) {
-                callInst = AstUtils.Convert(parameters[0], method.DeclaringType);
-                parameter = 1;
-            }
-            if (infos.Length &gt; 0 &amp;&amp; typeof(CodeContext).IsAssignableFrom(infos[0].ParameterType)) {
-                startArg = 1;
-                callArgs[0] = context;
+        public DynamicMetaObject MakeCallExpression(OverloadResolverFactory resolverFactory, MethodInfo method, params DynamicMetaObject[] parameters) {
+            OverloadResolver resolver;
+            if (method.IsStatic) {
+                resolver = resolverFactory.CreateOverloadResolver(parameters, new CallSignature(parameters.Length), CallTypes.None);
+            } else {
+                resolver = resolverFactory.CreateOverloadResolver(parameters, new CallSignature(parameters.Length - 1), CallTypes.ImplicitInstance);
             }
+            BindingTarget target = resolver.ResolveOverload(method.Name, new MethodBase[] { method }, NarrowingLevel.None, NarrowingLevel.Three);
 
-            for (int arg = startArg; arg &lt; infos.Length; arg++) {
-                if (parameter &lt; parameters.Count) {
-                    callArgs[arg] = ConvertExpression(
-                        parameters[parameter++],
-                        infos[arg].ParameterType,
-                        ConversionResultKind.ExplicitCast,
-                        context
-                    );
-                } else {
-                    return null;
+            if (!target.Success) {
+                BindingRestrictions restrictions = BindingRestrictions.Combine(parameters);
+                foreach (DynamicMetaObject mo in parameters) {
+                    restrictions = restrictions.Merge(BindingRestrictions.GetTypeRestriction(mo.Expression, mo.GetLimitType()));
                 }
+                return DefaultBinder.MakeError(
+                    resolver.MakeInvalidParametersError(target),
+                    restrictions,
+                    typeof(object)
+                );
             }
 
-            // check that we used all parameters
-            if (parameter != parameters.Count) {
-                return null;
-            }
-
-            return AstUtils.SimpleCallHelper(callInst, method, callArgs);
-        }
-
-
-        public Expression MakeCallExpression(Expression context, MethodInfo method, params Expression[] parameters) {
-            return MakeCallExpression(context, method, (IList&lt;Expression&gt;)parameters);
+            return new DynamicMetaObject(target.MakeExpression(), target.RestrictedArguments.GetAllRestrictions());
         }
     }
 }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/ActionBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,15 +14,16 @@
  * ***************************************************************************/
 
 using System;
-using System.Linq.Expressions;
+using System.Dynamic;
+using Microsoft.Scripting.Actions.Calls;
 
 namespace Microsoft.Scripting.Actions {
     public class BoundMemberTracker : MemberTracker {
-        private Expression _instance;
+        private DynamicMetaObject _instance;
         private MemberTracker _tracker;
         private object _objInst;
 
-        public BoundMemberTracker(MemberTracker tracker, Expression instance) {
+        public BoundMemberTracker(MemberTracker tracker, DynamicMetaObject instance) {
             _tracker = tracker;
             _instance = instance;
         }
@@ -44,7 +45,7 @@ namespace Microsoft.Scripting.Actions {
             get { return _tracker.Name; }
         }
 
-        public Expression Instance {
+        public DynamicMetaObject Instance {
             get {
                 return _instance;
             }
@@ -62,16 +63,16 @@ namespace Microsoft.Scripting.Actions {
             }
         }
 
-        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
-            return _tracker.GetBoundValue(context, binder, type, _instance);
+        public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
+            return _tracker.GetBoundValue(resolverFactory, binder, type, _instance);
         }
 
         public override ErrorInfo GetError(ActionBinder binder) {
             return _tracker.GetBoundError(binder, _instance);
         }
 
-        public override Expression SetValue(Expression context, ActionBinder binder, Type type, Expression value) {
-            return _tracker.SetBoundValue(context, binder, type, value, _instance);
+        public override DynamicMetaObject SetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value) {
+            return _tracker.SetBoundValue(resolverFactory, binder, type, value, _instance);
         }
     }
 }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/BoundMemberTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,11 @@ namespace Microsoft.Scripting.Actions {
             _bodies.Add(body);
         }
 
+        public void FinishCondition(DynamicMetaObject body) {
+            _restrictions = _restrictions.Merge(body.Restrictions);
+            FinishCondition(body.Expression);
+        }
+
         /// &lt;summary&gt;
         /// Adds the non-conditional terminating node.
         /// &lt;/summary&gt;</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/ConditionalBuilder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,9 +14,11 @@
  * ***************************************************************************/
 
 using System;
+using System.Dynamic;
 using System.Linq.Expressions;
 using System.Reflection;
-using System.Dynamic;
+
+using Microsoft.Scripting.Actions.Calls;
 using Microsoft.Scripting.Generation;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
@@ -24,9 +26,9 @@ using Microsoft.Scripting.Utils;
 namespace Microsoft.Scripting.Actions {
     using Ast = System.Linq.Expressions.Expression;
     using AstUtils = Microsoft.Scripting.Ast.Utils;
-
+    
     public partial class DefaultBinder : ActionBinder {
-        public DynamicMetaObject ConvertTo(Type toType, ConversionResultKind kind, DynamicMetaObject arg) {
+        public DynamicMetaObject ConvertTo(Type toType, ConversionResultKind kind, DynamicMetaObject arg, OverloadResolverFactory resolverFactory) {
             ContractUtils.RequiresNotNull(toType, &quot;toType&quot;);
             ContractUtils.RequiresNotNull(arg, &quot;arg&quot;);
 
@@ -39,8 +41,8 @@ namespace Microsoft.Scripting.Actions {
 
             DynamicMetaObject res = 
                 TryConvertToObject(toType, arg.Expression.Type, arg, typeRestrictions) ??
-                TryAllConversions(toType, kind, arg.Expression.Type, typeRestrictions, arg) ??
-                TryAllConversions(toType, kind, arg.GetLimitType(), typeRestrictions, arg) ??
+                TryAllConversions(resolverFactory, toType, kind, arg.Expression.Type, typeRestrictions, arg) ??
+                TryAllConversions(resolverFactory, toType, kind, arg.GetLimitType(), typeRestrictions, arg) ??
                 MakeErrorTarget(toType, kind, typeRestrictions, arg);
 
             if ((kind == ConversionResultKind.ExplicitTry || kind == ConversionResultKind.ImplicitTry) &amp;&amp; toType.IsValueType) {
@@ -74,14 +76,14 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;summary&gt;
         /// Checks if any conversions are available and if so builds the target for that conversion.
         /// &lt;/summary&gt;
-        private DynamicMetaObject TryAllConversions(Type toType, ConversionResultKind kind, Type knownType, BindingRestrictions restrictions, DynamicMetaObject arg) {
+        private DynamicMetaObject TryAllConversions(OverloadResolverFactory factory, Type toType, ConversionResultKind kind, Type knownType, BindingRestrictions restrictions, DynamicMetaObject arg) {
             return
-                TryAssignableConversion(toType, knownType, restrictions, arg) ??           // known type -&gt; known type
-                TryExtensibleConversion(toType, knownType, restrictions, arg) ??           // Extensible&lt;T&gt; -&gt; Extensible&lt;T&gt;.Value
-                TryUserDefinedConversion(kind, toType, knownType, restrictions, arg) ??    // op_Implicit
-                TryImplicitNumericConversion(toType, knownType, restrictions, arg) ??      // op_Implicit
-                TryNullableConversion(toType, kind, knownType, restrictions, arg) ??       // null -&gt; Nullable&lt;T&gt; or T -&gt; Nullable&lt;T&gt;
-                TryNullConversion(toType, knownType, restrictions);                        // null -&gt; reference type
+                TryAssignableConversion(toType, knownType, restrictions, arg) ??                // known type -&gt; known type
+                TryExtensibleConversion(toType, knownType, restrictions, arg) ??                // Extensible&lt;T&gt; -&gt; Extensible&lt;T&gt;.Value
+                TryUserDefinedConversion(kind, toType, knownType, restrictions, arg) ??         // op_Implicit
+                TryImplicitNumericConversion(toType, knownType, restrictions, arg) ??           // op_Implicit
+                TryNullableConversion(factory, toType, kind, knownType, restrictions, arg) ??   // null -&gt; Nullable&lt;T&gt; or T -&gt; Nullable&lt;T&gt;
+                TryNullConversion(toType, knownType, restrictions);                             // null -&gt; reference type
         }
 
         /// &lt;summary&gt;
@@ -207,7 +209,7 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;summary&gt;
         /// Checks if there's a conversion to/from Nullable of T.
         /// &lt;/summary&gt;
-        private DynamicMetaObject TryNullableConversion(Type toType, ConversionResultKind kind, Type knownType, BindingRestrictions restrictions, DynamicMetaObject arg) {
+        private DynamicMetaObject TryNullableConversion(OverloadResolverFactory factory, Type toType, ConversionResultKind kind, Type knownType, BindingRestrictions restrictions, DynamicMetaObject arg) {
             if (toType.IsGenericType &amp;&amp; toType.GetGenericTypeDefinition() == typeof(Nullable&lt;&gt;)) {
                 if (knownType == typeof(DynamicNull)) {
                     // null -&gt; Nullable&lt;T&gt;
@@ -217,7 +219,7 @@ namespace Microsoft.Scripting.Actions {
                 } else if (kind == ConversionResultKind.ExplicitCast || kind == ConversionResultKind.ExplicitTry) {
                     if (knownType != typeof(object)) {
                         // when doing an explicit cast we'll do things like int -&gt; Nullable&lt;float&gt;
-                        return MakeConvertingToTToNullableOfTTarget(toType, kind, restrictions, arg);
+                        return MakeConvertingToTToNullableOfTTarget(factory, toType, kind, restrictions, arg);
                     }
                 }
             }
@@ -410,13 +412,13 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;summary&gt;
         /// Helper to produce the rule for converting T to Nullable of T
         /// &lt;/summary&gt;
-        private DynamicMetaObject MakeConvertingToTToNullableOfTTarget(Type toType, ConversionResultKind kind, BindingRestrictions restrictions, DynamicMetaObject arg) {
+        private DynamicMetaObject MakeConvertingToTToNullableOfTTarget(OverloadResolverFactory resolverFactory, Type toType, ConversionResultKind kind, BindingRestrictions restrictions, DynamicMetaObject arg) {
             Type valueType = toType.GetGenericArguments()[0];
 
             // ConvertSelfToT -&gt; Nullable&lt;T&gt;
             if (kind == ConversionResultKind.ExplicitCast) {
                 // if the conversion to T fails we just throw
-                Expression conversion = ConvertExpression(arg.Expression, valueType, kind, AstUtils.Constant(null, typeof(CodeContext)));
+                Expression conversion = ConvertExpression(arg.Expression, valueType, kind, resolverFactory);
 
                 return new DynamicMetaObject(
                     Ast.New(
@@ -426,7 +428,7 @@ namespace Microsoft.Scripting.Actions {
                     restrictions
                 );
             } else {
-                Expression conversion = ConvertExpression(arg.Expression, valueType, kind, AstUtils.Constant(null, typeof(CodeContext)));
+                Expression conversion = ConvertExpression(arg.Expression, valueType, kind, resolverFactory);
 
                 // if the conversion to T succeeds then produce the nullable&lt;T&gt;, otherwise return default(retType)
                 ParameterExpression tmp = Ast.Variable(typeof(object), &quot;tmp&quot;);</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/DefaultBinder.Conversions.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,40 +14,26 @@
  * ***************************************************************************/
 
 using System;
-using System.Linq.Expressions;
-using System.Reflection;
 using System.Dynamic;
+using System.Reflection;
+
+using Microsoft.Scripting.Actions.Calls;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
+
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace Microsoft.Scripting.Actions {
-    using Ast = System.Linq.Expressions.Expression;
 
     public partial class DefaultBinder : ActionBinder {
-        /// &lt;summary&gt;
-        /// Builds a MetaObject for performing a member delete.  Supports all built-in .NET members, the OperatorMethod 
-        /// DeleteMember, and StrongBox instances.
-        /// &lt;/summary&gt;
-        public DynamicMetaObject DeleteMember(string name, DynamicMetaObject target) {
-            ContractUtils.RequiresNotNull(name, &quot;name&quot;);
-            ContractUtils.RequiresNotNull(target, &quot;target&quot;);
-
-            return DeleteMember(
-                name,
-                target,
-                AstUtils.Constant(null, typeof(CodeContext))
-            );
-        }
-
-        public DynamicMetaObject DeleteMember(string name, DynamicMetaObject target, Expression codeContext) {
+        public DynamicMetaObject DeleteMember(string name, DynamicMetaObject target, OverloadResolverFactory resolutionFactory) {
             ContractUtils.RequiresNotNull(name, &quot;name&quot;);
             ContractUtils.RequiresNotNull(target, &quot;target&quot;);
 
             return MakeDeleteMemberTarget(
                 new SetOrDeleteMemberInfo(
                     name,
-                    codeContext
+                    resolutionFactory
                 ),
                 target.Restrict(target.GetLimitType())
             );
@@ -69,7 +55,7 @@ namespace Microsoft.Scripting.Actions {
 
             delInfo.Body.Restrictions = restrictions;
 
-            if (self == null || !MakeOperatorDeleteMemberBody(delInfo, self.Expression, type, &quot;DeleteMember&quot;)) {
+            if (self == null || !MakeOperatorDeleteMemberBody(delInfo, self, type, &quot;DeleteMember&quot;)) {
                 MemberGroup group = GetMember(MemberRequestKind.Delete, type, delInfo.Name);
                 if (group.Count != 0) {
                     if (group[0].MemberType == TrackerTypes.Property) {
@@ -102,21 +88,21 @@ namespace Microsoft.Scripting.Actions {
         private void MakePropertyDeleteStatement(SetOrDeleteMemberInfo delInfo, DynamicMetaObject instance, MethodInfo delete) {
             delInfo.Body.FinishCondition(
                 instance == null ? 
-                    MakeCallExpression(delInfo.CodeContext, delete) :
-                    MakeCallExpression(delInfo.CodeContext, delete, instance.Expression)
+                    MakeCallExpression(delInfo.ResolutionFactory, delete) :
+                    MakeCallExpression(delInfo.ResolutionFactory, delete, instance)
             );
         }
 
         /// &lt;summary&gt; if a member-injector is defined-on or registered-for this type call it &lt;/summary&gt;
-        private bool MakeOperatorDeleteMemberBody(SetOrDeleteMemberInfo delInfo, Expression instance, Type type, string name) {
+        private bool MakeOperatorDeleteMemberBody(SetOrDeleteMemberInfo delInfo, DynamicMetaObject instance, Type type, string name) {
             MethodInfo delMem = GetMethod(type, name);
 
             if (delMem != null &amp;&amp; delMem.IsSpecialName) {
-                Expression call = MakeCallExpression(delInfo.CodeContext, delMem, instance, AstUtils.Constant(delInfo.Name));
+                DynamicMetaObject call = MakeCallExpression(delInfo.ResolutionFactory, delMem, instance, new DynamicMetaObject(AstUtils.Constant(delInfo.Name), BindingRestrictions.Empty, delInfo.Name));
 
                 if (delMem.ReturnType == typeof(bool)) {
                     delInfo.Body.AddCondition(
-                        call,
+                        call.Expression,
                         AstUtils.Constant(null)
                     );
                 } else {
@@ -133,12 +119,12 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;/summary&gt;
         private sealed class SetOrDeleteMemberInfo {
             public readonly string Name;
-            public readonly Expression CodeContext;
+            public readonly OverloadResolverFactory ResolutionFactory;
             public readonly ConditionalBuilder Body = new ConditionalBuilder();
 
-            public SetOrDeleteMemberInfo(string name, Expression codeContext) {
+            public SetOrDeleteMemberInfo(string name, OverloadResolverFactory resolutionFactory) {
                 Name = name;
-                CodeContext = codeContext;
+                ResolutionFactory = resolutionFactory;
             }
         }
     }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/DefaultBinder.DeleteMember.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,34 +14,21 @@
  * ***************************************************************************/
 
 using System;
+using System.Dynamic;
 using System.Linq.Expressions;
 using System.Reflection;
 using System.Runtime.CompilerServices;
-using System.Dynamic;
+
+using Microsoft.Scripting.Actions.Calls;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
+
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace Microsoft.Scripting.Actions {
     using Ast = System.Linq.Expressions.Expression;
-
+    
     public partial class DefaultBinder : ActionBinder {
-
-        /// &lt;summary&gt;
-        /// Builds a MetaObject for performing a member get.  Supports all built-in .NET members, the OperatorMethod 
-        /// GetBoundMember, and StrongBox instances.
-        /// &lt;/summary&gt;
-        /// &lt;param name=&quot;name&quot;&gt;
-        /// The name of the member to retrieve.  This name is not processed by the DefaultBinder and
-        /// is instead handed off to the GetMember API which can do name mangling, case insensitive lookups, etc...
-        /// &lt;/param&gt;
-        /// &lt;param name=&quot;target&quot;&gt;
-        /// The MetaObject from which the member is retrieved.
-        /// &lt;/param&gt;
-        public DynamicMetaObject GetMember(string name, DynamicMetaObject target) {
-            return GetMember(name, target, AstUtils.Constant(null, typeof(CodeContext)));
-        }
-
         /// &lt;summary&gt;
         /// Builds a MetaObject for performing a member get.  Supports all built-in .NET members, the OperatorMethod 
         /// GetBoundMember, and StrongBox instances.
@@ -53,16 +40,14 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;param name=&quot;target&quot;&gt;
         /// The MetaObject from which the member is retrieved.
         /// &lt;/param&gt;
-        /// &lt;param name=&quot;codeContext&quot;&gt;
-        /// An expression which provides access to the CodeContext if its required for 
-        /// accessing the member (e.g. for an extension property which takes CodeContext).  By default this
-        /// a null CodeContext object is passed.
+        /// &lt;param name=&quot;resolverFactory&quot;&gt;
+        /// Provides overload resolution and method binding for any calls which need to be performed for the GetMember.
         /// &lt;/param&gt;
-        public DynamicMetaObject GetMember(string name, DynamicMetaObject target, Expression codeContext) {
+        public DynamicMetaObject GetMember(string name, DynamicMetaObject target, OverloadResolverFactory resolverFactory) {
             return GetMember(
                 name,
                 target,
-                codeContext,
+                resolverFactory,
                 false,
                 null
             );
@@ -79,10 +64,8 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;param name=&quot;target&quot;&gt;
         /// The MetaObject from which the member is retrieved.
         /// &lt;/param&gt;
-        /// &lt;param name=&quot;codeContext&quot;&gt;
-        /// An expression which provides access to the CodeContext if its required for 
-        /// accessing the member (e.g. for an extension property which takes CodeContext).  By default this
-        /// a null CodeContext object is passed.
+        /// &lt;param name=&quot;resolverFactory&quot;&gt;
+        /// An OverloadResolverFactory which can be used for performing overload resolution and method binding.
         /// &lt;/param&gt;
         /// &lt;param name=&quot;isNoThrow&quot;&gt;
         /// True if the operation should return Operation.Failed on failure, false if it
@@ -91,15 +74,15 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;param name=&quot;errorSuggestion&quot;&gt;
         /// The meta object to be used if the get results in an error.
         /// &lt;/param&gt;
-        public DynamicMetaObject GetMember(string name, DynamicMetaObject target, Expression codeContext, bool isNoThrow, DynamicMetaObject errorSuggestion) {
+        public DynamicMetaObject GetMember(string name, DynamicMetaObject target, OverloadResolverFactory resolverFactory, bool isNoThrow, DynamicMetaObject errorSuggestion) {
             ContractUtils.RequiresNotNull(name, &quot;name&quot;);
             ContractUtils.RequiresNotNull(target, &quot;target&quot;);
-            ContractUtils.RequiresNotNull(codeContext, &quot;codeContext&quot;);
+            ContractUtils.RequiresNotNull(resolverFactory, &quot;resolverFactory&quot;);
 
             return MakeGetMemberTarget(
                 new GetMemberInfo(
                     name,
-                    codeContext,
+                    resolverFactory,
                     isNoThrow,
                     errorSuggestion
                 ),
@@ -150,11 +133,15 @@ namespace Microsoft.Scripting.Actions {
                 }
             }
 
-            Expression propSelf = self == null ? null : self.Expression;
+            DynamicMetaObject propSelf = self == null ? null : self;
             // if lookup failed try the strong-box type if available.
             if (members.Count == 0 &amp;&amp; typeof(IStrongBox).IsAssignableFrom(type) &amp;&amp; propSelf != null) {
                 // properties/fields need the direct value, methods hold onto the strong box.
-                propSelf = Ast.Field(AstUtils.Convert(propSelf, type), type.GetField(&quot;Value&quot;));
+                propSelf = new DynamicMetaObject(
+                    Ast.Field(AstUtils.Convert(propSelf.Expression, type), type.GetField(&quot;Value&quot;)),
+                    propSelf.Restrictions,
+                    ((IStrongBox)propSelf.Value).Value
+                );
 
                 type = type.GetGenericArguments()[0];
 
@@ -171,7 +158,7 @@ namespace Microsoft.Scripting.Actions {
             return getMemInfo.Body.GetMetaObject(target);
         }
 
-        private void MakeBodyHelper(GetMemberInfo getMemInfo, DynamicMetaObject self, Expression propSelf, Type type, MemberGroup members) {
+        private void MakeBodyHelper(GetMemberInfo getMemInfo, DynamicMetaObject self, DynamicMetaObject propSelf, Type type, MemberGroup members) {
             if (self != null) {
                 MakeOperatorGetMemberBody(getMemInfo, propSelf, type, &quot;GetCustomMember&quot;);
             }
@@ -186,7 +173,7 @@ namespace Microsoft.Scripting.Actions {
             }
         }
 
-        private void MakeSuccessfulMemberAccess(GetMemberInfo getMemInfo, DynamicMetaObject self, Expression propSelf, Type type, MemberGroup members, TrackerTypes memberType) {
+        private void MakeSuccessfulMemberAccess(GetMemberInfo getMemInfo, DynamicMetaObject self, DynamicMetaObject propSelf, Type type, MemberGroup members, TrackerTypes memberType) {
             switch (memberType) {
                 case TrackerTypes.TypeGroup:
                 case TrackerTypes.Type:
@@ -194,7 +181,7 @@ namespace Microsoft.Scripting.Actions {
                     break;
                 case TrackerTypes.Method:
                     // turn into a MethodGroup                    
-                    MakeGenericBodyWorker(getMemInfo, type, ReflectionCache.GetMethodGroup(getMemInfo.Name, members), self == null ? null : self.Expression);
+                    MakeGenericBodyWorker(getMemInfo, type, ReflectionCache.GetMethodGroup(getMemInfo.Name, members), self);
                     break;
                 case TrackerTypes.Event:
                 case TrackerTypes.Field:
@@ -216,7 +203,7 @@ namespace Microsoft.Scripting.Actions {
             }
         }
 
-        private void MakeGenericBody(GetMemberInfo getMemInfo, Type type, MemberGroup members, Expression instance) {
+        private void MakeGenericBody(GetMemberInfo getMemInfo, Type type, MemberGroup members, DynamicMetaObject instance) {
             MemberTracker bestMember = members[0];
             if (members.Count &gt; 1) {
                 // if we were given multiple members pick the member closest to the type...                
@@ -249,15 +236,15 @@ namespace Microsoft.Scripting.Actions {
                 typeTracker = TypeGroup.UpdateTypeEntity(typeTracker, (TypeTracker)members[i]);
             }
 
-            getMemInfo.Body.FinishCondition(typeTracker.GetValue(getMemInfo.CodeContext, this, type));
+            getMemInfo.Body.FinishCondition(typeTracker.GetValue(getMemInfo.ResolutionFactory, this, type));
         }
 
-        private void MakeGenericBodyWorker(GetMemberInfo getMemInfo, Type type, MemberTracker tracker, Expression instance) {
+        private void MakeGenericBodyWorker(GetMemberInfo getMemInfo, Type type, MemberTracker tracker, DynamicMetaObject instance) {
             if (instance != null) {
                 tracker = tracker.BindToInstance(instance);
             }
 
-            Expression val = tracker.GetValue(getMemInfo.CodeContext, this, type);
+            DynamicMetaObject val = tracker.GetValue(getMemInfo.ResolutionFactory, this, type);
 
             if (val != null) {
                 getMemInfo.Body.FinishCondition(val);
@@ -272,7 +259,7 @@ namespace Microsoft.Scripting.Actions {
         }
 
         /// &lt;summary&gt; if a member-injector is defined-on or registered-for this type call it &lt;/summary&gt;
-        private void MakeOperatorGetMemberBody(GetMemberInfo getMemInfo, Expression instance, Type type, string name) {
+        private void MakeOperatorGetMemberBody(GetMemberInfo getMemInfo, DynamicMetaObject instance, Type type, string name) {
             MethodInfo getMem = GetMethod(type, name);
             if (getMem != null &amp;&amp; getMem.IsSpecialName) {
                 ParameterExpression tmp = Ast.Variable(typeof(object), &quot;getVal&quot;);
@@ -283,11 +270,19 @@ namespace Microsoft.Scripting.Actions {
                         Ast.Assign(
                             tmp,
                             MakeCallExpression(
-                                getMemInfo.CodeContext,
+                                getMemInfo.ResolutionFactory,
                                 getMem,
-                                AstUtils.Convert(instance, type),
-                                AstUtils.Constant(getMemInfo.Name)
-                            )
+                                new DynamicMetaObject(
+                                    Expression.Convert(instance.Expression, type),
+                                    instance.Restrictions,
+                                    instance.Value
+                                ),
+                                new DynamicMetaObject(
+                                    Expression.Constant(getMemInfo.Name),
+                                    BindingRestrictions.Empty,
+                                    getMemInfo.Name
+                                )
+                            ).Expression
                         ),
                         Ast.Field(null, typeof(OperationFailed).GetField(&quot;Value&quot;))
                     ),
@@ -318,14 +313,14 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;/summary&gt;
         private sealed class GetMemberInfo {
             public readonly string Name;
-            public readonly Expression CodeContext;
+            public readonly OverloadResolverFactory ResolutionFactory;
             public readonly bool IsNoThrow;
             public readonly ConditionalBuilder Body = new ConditionalBuilder();
             public readonly DynamicMetaObject ErrorSuggestion;
 
-            public GetMemberInfo(string name, Expression codeContext, bool noThrow, DynamicMetaObject errorSuggestion) {
+            public GetMemberInfo(string name, OverloadResolverFactory resolutionFactory, bool noThrow, DynamicMetaObject errorSuggestion) {
                 Name = name;
-                CodeContext = codeContext;
+                ResolutionFactory = resolutionFactory;
                 IsNoThrow = noThrow;
                 ErrorSuggestion = errorSuggestion;
             }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/DefaultBinder.GetMember.cs</filename>
    </modified>
    <modified>
      <diff>@@ -57,7 +57,7 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;/summary&gt;
         public DynamicMetaObject GetIndex(OverloadResolverFactory resolverFactory, DynamicMetaObject[] args) {
             if (args[0].GetLimitType().IsArray) {
-                return MakeArrayIndexRule(IndexType.Get, args);
+                return MakeArrayIndexRule(resolverFactory, IndexType.Get, args);
             }
 
             return MakeMethodIndexRule(IndexType.Get, resolverFactory, args);
@@ -73,7 +73,7 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;/summary&gt;
         public DynamicMetaObject SetIndex(OverloadResolverFactory resolverFactory, DynamicMetaObject[] args) {
             if (args[0].LimitType.IsArray) {
-                return MakeArrayIndexRule(IndexType.Set, args);
+                return MakeArrayIndexRule(resolverFactory, IndexType.Set, args);
             }
 
             return MakeMethodIndexRule(IndexType.Set, resolverFactory, args);
@@ -408,8 +408,6 @@ namespace Microsoft.Scripting.Actions {
                     StringBuilder res = new StringBuilder();
                     string comma = &quot;&quot;;
                     foreach (ParameterInfo param in mb.GetParameters()) {
-                        if (param.ParameterType == typeof(CodeContext)) continue;
-
                         res.Append(comma);
                         res.Append(param.ParameterType.Name);
                         res.Append(&quot; &quot;);
@@ -484,7 +482,7 @@ namespace Microsoft.Scripting.Actions {
             return null;
         }
 
-        private DynamicMetaObject MakeArrayIndexRule(IndexType oper, DynamicMetaObject[] args) {
+        private DynamicMetaObject MakeArrayIndexRule(OverloadResolverFactory factory, IndexType oper, DynamicMetaObject[] args) {
             if (CanConvertFrom(GetArgType(args, 1), typeof(int), false, NarrowingLevel.All)) {
                 BindingRestrictions restrictions = BindingRestrictionsHelpers.GetRuntimeTypeRestriction(args[0].Expression, args[0].GetLimitType()).Merge(BindingRestrictions.Combine(args));
 
@@ -492,7 +490,7 @@ namespace Microsoft.Scripting.Actions {
                     return new DynamicMetaObject(
                         Ast.ArrayAccess(
                             args[0].Expression,
-                            ConvertIfNeeded(args[1].Expression, typeof(int))
+                            ConvertIfNeeded(factory, args[1].Expression, typeof(int))
                         ),
                         restrictions
                     );
@@ -501,9 +499,9 @@ namespace Microsoft.Scripting.Actions {
                         Ast.Assign(
                             Ast.ArrayAccess(
                                 args[0].Expression,
-                                ConvertIfNeeded(args[1].Expression, typeof(int))
+                                ConvertIfNeeded(factory, args[1].Expression, typeof(int))
                             ),
-                            ConvertIfNeeded(args[2].Expression, args[0].GetLimitType().GetElementType())
+                            ConvertIfNeeded(factory, args[2].Expression, args[0].GetLimitType().GetElementType())
                         ),
                         restrictions.Merge(args[1].Restrictions)
                     );
@@ -590,11 +588,11 @@ namespace Microsoft.Scripting.Actions {
             }
         }
 
-        private Expression ConvertIfNeeded(Expression expression, Type type) {
+        private Expression ConvertIfNeeded(OverloadResolverFactory factory, Expression expression, Type type) {
             Assert.NotNull(expression, type);
 
             if (expression.Type != type) {
-                return ConvertExpression(expression, type, ConversionResultKind.ExplicitCast, AstUtils.Constant(null, typeof(CodeContext)));
+                return ConvertExpression(expression, type, ConversionResultKind.ExplicitCast, factory);
             }
             return expression;
         }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/DefaultBinder.Operations.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,38 +14,23 @@
  * ***************************************************************************/
 
 using System;
+using System.Diagnostics;
+using System.Dynamic;
 using System.Linq.Expressions;
 using System.Reflection;
 using System.Runtime.CompilerServices;
-using System.Dynamic;
+
+using Microsoft.Scripting.Actions.Calls;
 using Microsoft.Scripting.Generation;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
+
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace Microsoft.Scripting.Actions {
     using Ast = System.Linq.Expressions.Expression;
-    using System.Diagnostics;
-
-    public partial class DefaultBinder : ActionBinder {
-        /// &lt;summary&gt;
-        /// Builds a MetaObject for performing a member get.  Supports all built-in .NET members, the OperatorMethod 
-        /// GetBoundMember, and StrongBox instances.
-        /// &lt;/summary&gt;
-        /// &lt;param name=&quot;name&quot;&gt;
-        /// The name of the member to retrieve.  This name is not processed by the DefaultBinder and
-        /// is instead handed off to the GetMember API which can do name mangling, case insensitive lookups, etc...
-        /// &lt;/param&gt;
-        /// &lt;param name=&quot;target&quot;&gt;
-        /// The MetaObject from which the member is retrieved.
-        /// &lt;/param&gt;
-        /// &lt;param name=&quot;value&quot;&gt;
-        /// The value being assigned to the target member.
-        /// &lt;/param&gt;
-        public DynamicMetaObject SetMember(string name, DynamicMetaObject target, DynamicMetaObject value) {
-            return SetMember(name, target, value, AstUtils.Constant(null, typeof(CodeContext)));
-        }
-
+    
+    public partial class DefaultBinder : ActionBinder {        
         /// &lt;summary&gt;
         /// Builds a MetaObject for performing a member get.  Supports all built-in .NET members, the OperatorMethod 
         /// GetBoundMember, and StrongBox instances.
@@ -60,19 +45,17 @@ namespace Microsoft.Scripting.Actions {
         /// &lt;param name=&quot;value&quot;&gt;
         /// The value being assigned to the target member.
         /// &lt;/param&gt;
-        /// &lt;param name=&quot;codeContext&quot;&gt;
-        /// An expression which provides access to the CodeContext if its required for 
-        /// accessing the member (e.g. for an extension property which takes CodeContext).  By default this
-        /// a null CodeContext object is passed.
+        /// &lt;param name=&quot;resolverFactory&quot;&gt;
+        /// rovides overload resolution and method binding for any calls which need to be performed for the SetMember.
         /// &lt;/param&gt;
-        public DynamicMetaObject SetMember(string name, DynamicMetaObject target, DynamicMetaObject value, Expression codeContext) {
+        public DynamicMetaObject SetMember(string name, DynamicMetaObject target, DynamicMetaObject value, OverloadResolverFactory resolverFactory) {
             ContractUtils.RequiresNotNull(name, &quot;name&quot;);
             ContractUtils.RequiresNotNull(target, &quot;target&quot;);
             ContractUtils.RequiresNotNull(value, &quot;value&quot;);
-            ContractUtils.RequiresNotNull(codeContext, &quot;codeContext&quot;);
+            ContractUtils.RequiresNotNull(resolverFactory, &quot;resolverFactory&quot;);
 
             return MakeSetMemberTarget(
-                new SetOrDeleteMemberInfo(name, codeContext),
+                new SetOrDeleteMemberInfo(name, resolverFactory),
                 target,
                 value
             );
@@ -125,12 +108,12 @@ namespace Microsoft.Scripting.Actions {
                     case TrackerTypes.Type:
                     case TrackerTypes.Constructor:
                         memInfo.Body.FinishCondition(
-                            MakeError(MakeReadOnlyMemberError(type, memInfo.Name), typeof(object))
+                            MakeError(MakeReadOnlyMemberError(type, memInfo.Name), BindingRestrictions.Empty, typeof(object))
                         );
                         break;
                     case TrackerTypes.Event:
                         memInfo.Body.FinishCondition(
-                            MakeError(MakeEventValidation(members, self == null ? null : self.Expression, value.Expression, memInfo.CodeContext), typeof(object))
+                            MakeError(MakeEventValidation(members, self, value, memInfo.ResolutionFactory), BindingRestrictions.Empty, typeof(object))
                         );
                         break;
                     case TrackerTypes.Field:
@@ -149,7 +132,7 @@ namespace Microsoft.Scripting.Actions {
                         }
 
                         memInfo.Body.FinishCondition(
-                            MakeError(MakeMissingMemberErrorForAssign(type, self, memInfo.Name), typeof(object))
+                            MakeError(MakeMissingMemberErrorForAssign(type, self, memInfo.Name), BindingRestrictions.Empty, typeof(object))
                         );
                         break;
                     default:
@@ -162,10 +145,10 @@ namespace Microsoft.Scripting.Actions {
 
         private void MakeGenericBody(SetOrDeleteMemberInfo memInfo, DynamicMetaObject instance, DynamicMetaObject target, Type type, MemberTracker tracker) {
             if (instance != null) {
-                tracker = tracker.BindToInstance(instance.Expression);
+                tracker = tracker.BindToInstance(instance);
             }
 
-            Expression val = tracker.SetValue(memInfo.CodeContext, this, type, target.Expression);
+            DynamicMetaObject val = tracker.SetValue(memInfo.ResolutionFactory, this, type, target);
 
             if (val != null) {
                 memInfo.Body.FinishCondition(val);
@@ -197,8 +180,8 @@ namespace Microsoft.Scripting.Actions {
                             MakeStaticPropertyInstanceAccessError(
                                 info,
                                 true,
-                                instance == null ? null : instance.Expression,
-                                target.Expression
+                                instance,
+                                target
                             ), 
                             typeof(object)
                         )
@@ -206,7 +189,7 @@ namespace Microsoft.Scripting.Actions {
                 } else if (info.IsStatic &amp;&amp; info.DeclaringType != targetType) {
                     memInfo.Body.FinishCondition(
                         MakeError(
-                            MakeStaticAssignFromDerivedTypeError(targetType, instance, info, target.Expression, memInfo.CodeContext), 
+                            MakeStaticAssignFromDerivedTypeError(targetType, instance, info, target, memInfo.ResolutionFactory), 
                             typeof(object)
                         )
                     );
@@ -224,7 +207,7 @@ namespace Microsoft.Scripting.Actions {
                                         target.Expression,
                                         setter.GetParameters()[0].ParameterType,
                                         ConversionResultKind.ExplicitCast,
-                                        memInfo.CodeContext
+                                        memInfo.ResolutionFactory
                                     )
                                 ),
                                 Ast.Constant(null)
@@ -233,7 +216,7 @@ namespace Microsoft.Scripting.Actions {
                     } else {
                         memInfo.Body.FinishCondition(
                             MakeReturnValue(
-                                MakeCallExpression(memInfo.CodeContext, setter, instance.Expression, target.Expression),
+                                MakeCallExpression(memInfo.ResolutionFactory, setter, instance, target),
                                 target
                             )
                         );
@@ -251,7 +234,7 @@ namespace Microsoft.Scripting.Actions {
                                         target.Expression,
                                         setter.GetParameters()[0].ParameterType,
                                         ConversionResultKind.ExplicitCast,
-                                        memInfo.CodeContext
+                                        memInfo.ResolutionFactory
                                     ),
                                     typeof(object)
                                 ),
@@ -299,7 +282,7 @@ namespace Microsoft.Scripting.Actions {
             } else if (field.IsStatic &amp;&amp; targetType != field.DeclaringType) {
                 memInfo.Body.FinishCondition(
                     MakeError(
-                        MakeStaticAssignFromDerivedTypeError(targetType, instance, field, target.Expression, memInfo.CodeContext), 
+                        MakeStaticAssignFromDerivedTypeError(targetType, instance, field, target, memInfo.ResolutionFactory), 
                         typeof(object)
                     )
                 );
@@ -325,7 +308,7 @@ namespace Microsoft.Scripting.Actions {
                                     AstUtils.Convert(instance.Expression, field.DeclaringType),
                                 field.Field
                             ),
-                            ConvertExpression(target.Expression, field.FieldType, ConversionResultKind.ExplicitCast, memInfo.CodeContext)
+                            ConvertExpression(target.Expression, field.FieldType, ConversionResultKind.ExplicitCast, memInfo.ResolutionFactory)
                         ),
                         target
                     )
@@ -349,6 +332,16 @@ namespace Microsoft.Scripting.Actions {
             }
         }
 
+        private DynamicMetaObject MakeReturnValue(DynamicMetaObject expression, DynamicMetaObject target) {
+            return new DynamicMetaObject(
+                Ast.Block(
+                    expression.Expression,
+                    Expression.Convert(target.Expression, typeof(object))
+                ),
+                target.Restrictions.Merge(expression.Restrictions)
+            );
+        }
+
         private Expression MakeReturnValue(Expression expression, DynamicMetaObject target) {
             return Ast.Block(
                 expression,
@@ -364,9 +357,15 @@ namespace Microsoft.Scripting.Actions {
                     ParameterExpression tmp = Ast.Variable(target.Expression.Type, &quot;setValue&quot;);
                     memInfo.Body.AddVariable(tmp);
 
-                    Expression call = MakeCallExpression(memInfo.CodeContext, setMem, AstUtils.Convert(self.Expression, type), AstUtils.Constant(memInfo.Name), tmp);
+                    var callMo = MakeCallExpression(
+                        memInfo.ResolutionFactory, 
+                        setMem, 
+                        self.Clone(AstUtils.Convert(self.Expression, type)),
+                        new DynamicMetaObject(AstUtils.Constant(memInfo.Name), BindingRestrictions.Empty, memInfo.Name),
+                        target.Clone(tmp)
+                    );
 
-                    call = Ast.Block(Ast.Assign(tmp, target.Expression), call);
+                    var call = Ast.Block(Ast.Assign(tmp, target.Expression), callMo.Expression);
 
                     if (setMem.ReturnType == typeof(bool)) {
                         memInfo.Body.AddCondition(</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/DefaultBinder.SetMember.cs</filename>
    </modified>
    <modified>
      <diff>@@ -39,17 +39,6 @@ namespace Microsoft.Scripting.Actions {
             : base(manager) {
         }
 
-        protected static CodeContext ExtractCodeContext(object[] args, out object[] extracted) {
-            CodeContext cc;
-            if (args.Length &gt; 0 &amp;&amp; (cc = args[0] as CodeContext) != null) {
-                extracted = ArrayUtils.ShiftLeft(args, 1);
-            } else {
-                cc = null;
-                extracted = args;
-            }
-            return cc;
-        }
-
         /// &lt;summary&gt;
         /// Provides a way for the binder to provide a custom error message when lookup fails.  Just
         /// doing this for the time being until we get a more robust error return mechanism.
@@ -63,7 +52,7 @@ namespace Microsoft.Scripting.Actions {
         /// 
         /// The default implementation allows access to the fields or properties using reflection.
         /// &lt;/summary&gt;
-        public virtual ErrorInfo MakeNonPublicMemberGetError(Expression codeContext, MemberTracker member, Type type, Expression instance) {
+        public virtual ErrorInfo MakeNonPublicMemberGetError(OverloadResolverFactory resolverFactory, MemberTracker member, Type type, DynamicMetaObject instance) {
             switch (member.MemberType) {
                 case TrackerTypes.Field:
                     FieldTracker ft = (FieldTracker)member;
@@ -72,14 +61,14 @@ namespace Microsoft.Scripting.Actions {
                         Ast.Call(
                             AstUtils.Convert(AstUtils.Constant(ft.Field), typeof(FieldInfo)),
                             typeof(FieldInfo).GetMethod(&quot;GetValue&quot;),
-                            AstUtils.Convert(instance, typeof(object))
+                            AstUtils.Convert(instance.Expression, typeof(object))
                         )
                     );
                 case TrackerTypes.Property:
                     PropertyTracker pt = (PropertyTracker)member;
 
                     return ErrorInfo.FromValueNoError(
-                        MemberTracker.FromMemberInfo(pt.GetGetMethod(true)).Call(codeContext, this, instance)
+                        MemberTracker.FromMemberInfo(pt.GetGetMethod(true)).Call(resolverFactory, this, instance).Expression
                     );
                 default:
                     throw new InvalidOperationException();
@@ -99,7 +88,7 @@ namespace Microsoft.Scripting.Actions {
             );
         }
 
-        public virtual ErrorInfo MakeEventValidation(MemberGroup members, Expression eventObject, Expression value, Expression codeContext) {
+        public virtual ErrorInfo MakeEventValidation(MemberGroup members, DynamicMetaObject eventObject, DynamicMetaObject value, OverloadResolverFactory resolverFactory) {
             EventTracker ev = (EventTracker)members[0];
 
             // handles in place addition of events - this validates the user did the right thing.
@@ -107,29 +96,29 @@ namespace Microsoft.Scripting.Actions {
                 Expression.Call(
                     typeof(BinderOps).GetMethod(&quot;SetEvent&quot;),
                     AstUtils.Constant(ev),
-                    value
+                    value.Expression
                 )
             );
         }
 
-        public static Expression MakeError(ErrorInfo error, Type type) {
+        public static DynamicMetaObject MakeError(ErrorInfo error, Type type) {
+            return MakeError(error, BindingRestrictions.Empty, type);
+        }
+
+        public static DynamicMetaObject MakeError(ErrorInfo error, BindingRestrictions restrictions, Type type) {
             switch (error.Kind) {
                 case ErrorInfoKind.Error:
                     // error meta objecT?
-                    return AstUtils.Convert(error.Expression, type);
+                    return new DynamicMetaObject(AstUtils.Convert(error.Expression, type), restrictions);
                 case ErrorInfoKind.Exception:
-                    return AstUtils.Convert(Expression.Throw(error.Expression), type);
+                    return new DynamicMetaObject(AstUtils.Convert(Expression.Throw(error.Expression), type), restrictions);
                 case ErrorInfoKind.Success:
-                    return error.Expression;
+                    return new DynamicMetaObject(error.Expression, restrictions);
                 default:
                     throw new InvalidOperationException();
             }
         }
 
-        public static DynamicMetaObject MakeError(ErrorInfo error, BindingRestrictions restrictions, Type type) {
-            return new DynamicMetaObject(MakeError(error, type), restrictions);
-        }
-
         private static Expression MakeAmbiguousMatchError(MemberGroup members) {
             StringBuilder sb = new StringBuilder();
             foreach (MemberTracker mi in members) {
@@ -194,7 +183,7 @@ namespace Microsoft.Scripting.Actions {
             } while (curType != null);
 
             return null;
-        }
+        }        
     }
 }
 </diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/DefaultBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -80,23 +80,6 @@ namespace Microsoft.Scripting.Actions {
             return new ErrorInfo(resultValue, ErrorInfoKind.Success);
         }
 
-        /// &lt;summary&gt;
-        /// Internal helper to produce the actual expression used for the error when emitting
-        /// the error into a rule.
-        /// &lt;/summary&gt;
-        public Expression MakeErrorForRule(RuleBuilder rule, ActionBinder binder) {
-            switch (_kind) {
-                case ErrorInfoKind.Error:
-                    rule.IsError = true;
-                    return rule.MakeReturn(binder, _value);
-                case ErrorInfoKind.Success:
-                    return rule.MakeReturn(binder, _value);
-                case ErrorInfoKind.Exception:
-                    return rule.MakeError(_value);
-                default: throw new InvalidOperationException();
-            }
-        }
-
         public ErrorInfoKind Kind {
             get {
                 return _kind;</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/ErrorInfo.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,17 +14,19 @@
  * ***************************************************************************/
 
 using System;
+using System.Collections.Generic;
 using System.Diagnostics;
-using System.Linq.Expressions;
+using System.Dynamic;
 using System.Reflection;
-using Microsoft.Contracts;
-using System.Collections.Generic;
-using Microsoft.Scripting.Utils;
-using Microsoft.Scripting.Runtime;
 using System.Runtime.InteropServices;
-using Microsoft.Scripting.Generation;
 using System.Threading;
 
+using Microsoft.Contracts;
+using Microsoft.Scripting.Actions.Calls;
+using Microsoft.Scripting.Generation;
+using Microsoft.Scripting.Runtime;
+using Microsoft.Scripting.Utils;
+
 namespace Microsoft.Scripting.Actions {
     public class EventTracker : MemberTracker {
         // For each instance of the class that declares the event there is a list of pairs in a table 
@@ -102,11 +104,11 @@ namespace Microsoft.Scripting.Actions {
             }
         }
 
-        protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
+        protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) {
             return binder.ReturnMemberTracker(type, new BoundMemberTracker(this, instance));
         }
 
-        public override MemberTracker BindToInstance(Expression instance) {
+        public override MemberTracker BindToInstance(DynamicMetaObject instance) {
             if (IsStatic) {
                 return this;
             }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/EventTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -15,10 +15,13 @@
 
 using System;
 using System.Diagnostics;
-using System.Linq.Expressions;
+using System.Dynamic;
 using System.Reflection;
+
 using Microsoft.Contracts;
+using Microsoft.Scripting.Actions.Calls;
 using Microsoft.Scripting.Utils;
+
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace Microsoft.Scripting.Actions {
@@ -87,9 +90,12 @@ namespace Microsoft.Scripting.Actions {
 
         #region Public expression builders
 
-        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
+        public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
             if (Field.IsLiteral) {
-                return AstUtils.Constant(Field.GetValue(null), typeof(object));
+                return new DynamicMetaObject(
+                    AstUtils.Constant(Field.GetValue(null), typeof(object)),
+                    BindingRestrictions.Empty
+                );
             }
 
             if (!IsStatic) {
@@ -102,13 +108,19 @@ namespace Microsoft.Scripting.Actions {
             }
 
             if (IsPublic &amp;&amp; DeclaringType.IsPublic) {
-                return Ast.Convert(Ast.Field(null, Field), typeof(object));
+                return new DynamicMetaObject(
+                    Ast.Convert(Ast.Field(null, Field), typeof(object)),
+                    BindingRestrictions.Empty
+                );
             }
 
-            return Ast.Call(
-                AstUtils.Convert(AstUtils.Constant(Field), typeof(FieldInfo)),
-                typeof(FieldInfo).GetMethod(&quot;GetValue&quot;),
-                AstUtils.Constant(null)
+            return new DynamicMetaObject(
+                Ast.Call(
+                    AstUtils.Convert(AstUtils.Constant(Field), typeof(FieldInfo)),
+                    typeof(FieldInfo).GetMethod(&quot;GetValue&quot;),
+                    AstUtils.Constant(null)
+                ),
+                BindingRestrictions.Empty
             );
         }
 
@@ -124,21 +136,24 @@ namespace Microsoft.Scripting.Actions {
 
         #region Internal expression builders
 
-        protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
+        protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) {
             if (IsPublic &amp;&amp; DeclaringType.IsVisible) {
-                return AstUtils.Convert(
-                    Ast.Field(
-                        AstUtils.Convert(instance, Field.DeclaringType),
-                        Field
+                return new DynamicMetaObject(
+                    AstUtils.Convert(
+                        Ast.Field(
+                            AstUtils.Convert(instance.Expression, Field.DeclaringType),
+                            Field
+                        ),
+                        typeof(object)                    
                     ),
-                    typeof(object)                    
+                    BindingRestrictions.Empty
                 );
             }
 
-            return DefaultBinder.MakeError(((DefaultBinder)binder).MakeNonPublicMemberGetError(context, this, type, instance), typeof(object));
+            return DefaultBinder.MakeError(((DefaultBinder)binder).MakeNonPublicMemberGetError(resolverFactory, this, type, instance), BindingRestrictions.Empty, typeof(object));
         }
 
-        public override MemberTracker BindToInstance(Expression instance) {
+        public override MemberTracker BindToInstance(DynamicMetaObject instance) {
             if (IsStatic) return this;
 
             return new BoundMemberTracker(this, instance);</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/FieldTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -15,8 +15,10 @@
 
 using System;
 using System.Collections.Generic;
-using System.Linq.Expressions;
+using System.Dynamic;
 using System.Reflection;
+
+using Microsoft.Scripting.Actions.Calls;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
 
@@ -137,7 +139,7 @@ namespace Microsoft.Scripting.Actions {
         /// Returns null if it's an error to get the value.  The caller can then call GetErrorForGet to get 
         /// the correct error Expression (or null if they should provide a default).
         /// &lt;/summary&gt;
-        public virtual Expression GetValue(Expression context, ActionBinder binder, Type type) {
+        public virtual DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
             return binder.ReturnMemberTracker(type, this);
         }
 
@@ -147,7 +149,7 @@ namespace Microsoft.Scripting.Actions {
         /// Returns null if it's an error to assign to.  The caller can then call GetErrorForSet to
         /// get the correct error Expression (or null if a default error should be provided).
         /// &lt;/summary&gt;
-        public virtual Expression SetValue(Expression context, ActionBinder binder, Type type, Expression value) {
+        public virtual DynamicMetaObject SetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value) {
             return null;
         }
 
@@ -158,7 +160,7 @@ namespace Microsoft.Scripting.Actions {
         /// GetErrorsForDoCall to get the correct error Expression (or null if a default error should be provided).
         /// &lt;/summary&gt;
         [System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Naming&quot;, &quot;CA1716:IdentifiersShouldNotMatchKeywords&quot;, MessageId = &quot;Call&quot;)] // TODO: fix
-        internal virtual Expression Call(Expression context, ActionBinder binder, params Expression[] arguments) {
+        internal virtual DynamicMetaObject Call(OverloadResolverFactory resolverFactory, ActionBinder binder, params DynamicMetaObject[] arguments) {
             return null;
         }
 
@@ -180,7 +182,7 @@ namespace Microsoft.Scripting.Actions {
         /// 
         /// A null return value indicates that the default error message should be provided by the caller.
         /// &lt;/summary&gt;
-        public virtual ErrorInfo GetBoundError(ActionBinder binder, Expression instance) {
+        public virtual ErrorInfo GetBoundError(ActionBinder binder, DynamicMetaObject instance) {
             return null;
         }
 
@@ -188,16 +190,16 @@ namespace Microsoft.Scripting.Actions {
         /// Helper for getting values that have been bound.  Called from BoundMemberTracker.  Custom member
         /// trackers can override this to provide their own behaviors when bound to an instance.
         /// &lt;/summary&gt;
-        protected internal virtual Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
-            return GetValue(context, binder, type);
+        protected internal virtual DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) {
+            return GetValue(resolverFactory, binder, type);
         }
 
         /// &lt;summary&gt;
         /// Helper for setting values that have been bound.  Called from BoundMemberTracker.  Custom member
         /// trackers can override this to provide their own behaviors when bound to an instance.
         /// &lt;/summary&gt;
-        protected internal virtual Expression SetBoundValue(Expression context, ActionBinder binder, Type type, Expression value, Expression instance) {
-            return SetValue(context, binder, type, instance);
+        protected internal virtual DynamicMetaObject SetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject value, DynamicMetaObject instance) {
+            return SetValue(resolverFactory, binder, type, instance);
         }
 
         /// &lt;summary&gt;
@@ -207,7 +209,7 @@ namespace Microsoft.Scripting.Actions {
         /// field results in a new BoundMemberTracker which will get GetBoundValue/SetBoundValue to pass the
         /// instance through.
         /// &lt;/summary&gt;
-        public virtual MemberTracker BindToInstance(Expression instance) {
+        public virtual MemberTracker BindToInstance(DynamicMetaObject instance) {
             return this;
         }
 </diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/MemberTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,10 +16,12 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.Linq.Expressions;
+using System.Dynamic;
 using System.Reflection;
 using System.Threading;
+
 using Microsoft.Contracts;
+using Microsoft.Scripting.Actions.Calls;
 
 namespace Microsoft.Scripting.Actions {
     /// &lt;summary&gt;
@@ -84,11 +86,11 @@ namespace Microsoft.Scripting.Actions {
             return methods;
         }
 
-        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
-            return base.GetValue(context, binder, type);
+        public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
+            return base.GetValue(resolverFactory, binder, type);
         }
 
-        public override MemberTracker BindToInstance(Expression instance) {
+        public override MemberTracker BindToInstance(DynamicMetaObject instance) {
             if (ContainsInstance) {
                 return new BoundMemberTracker(this, instance);
             }
@@ -96,7 +98,7 @@ namespace Microsoft.Scripting.Actions {
             return this;
         }
 
-        protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
+        protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) {
             return binder.ReturnMemberTracker(type, BindToInstance(instance));
         }
 </diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/MethodGroup.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,15 +14,18 @@
  * ***************************************************************************/
 
 using System;
-using System.Linq.Expressions;
+using System.Dynamic;
 using System.Reflection;
-using Microsoft.Scripting.Utils;
+
 using Microsoft.Contracts;
+using Microsoft.Scripting.Actions.Calls;
+using Microsoft.Scripting.Utils;
+
 using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace Microsoft.Scripting.Actions {
     using Ast = System.Linq.Expressions.Expression;
-
+    
     public class MethodTracker : MemberTracker {
         private readonly MethodInfo _method;
         private readonly bool _isStatic;
@@ -74,7 +77,7 @@ namespace Microsoft.Scripting.Actions {
             return _method.ToString();
         }
 
-        public override MemberTracker BindToInstance(Expression instance) {
+        public override MemberTracker BindToInstance(DynamicMetaObject instance) {
             if (IsStatic) {
                 return this;
             }
@@ -82,38 +85,46 @@ namespace Microsoft.Scripting.Actions {
             return new BoundMemberTracker(this, instance);
         }
 
-        protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
+        protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) {
             return binder.ReturnMemberTracker(type, BindToInstance(instance));
         }
 
-        internal override System.Linq.Expressions.Expression Call(Expression context, ActionBinder binder, params Expression[] arguments) {
+        internal override DynamicMetaObject Call(OverloadResolverFactory resolverFactory, ActionBinder binder, params DynamicMetaObject[] arguments) {
             if (Method.IsPublic &amp;&amp; Method.DeclaringType.IsVisible) {
-                // TODO: Need to use MethodBinder in here to make this right.
-                return binder.MakeCallExpression(context, Method, arguments);
+                return binder.MakeCallExpression(resolverFactory, Method, arguments);
             }
 
             //methodInfo.Invoke(obj, object[] params)
             if (Method.IsStatic) {
-                return Ast.Convert(
-                    Ast.Call(
-                        AstUtils.Constant(Method),
-                        typeof(MethodInfo).GetMethod(&quot;Invoke&quot;, new Type[] { typeof(object), typeof(object[]) }),
-                        AstUtils.Constant(null),
-                        AstUtils.NewArrayHelper(typeof(object), arguments)
-                    ),
-                    Method.ReturnType);
+                return new DynamicMetaObject(
+                        Ast.Convert(
+                            Ast.Call(
+                                AstUtils.Constant(Method),
+                                typeof(MethodInfo).GetMethod(&quot;Invoke&quot;, new Type[] { typeof(object), typeof(object[]) }),
+                                AstUtils.Constant(null),
+                                AstUtils.NewArrayHelper(typeof(object), ArrayUtils.ConvertAll(arguments, x =&gt; x.Expression))
+                            ),
+                            Method.ReturnType
+                        ),
+                        BindingRestrictions.Empty
+                    )
+                ;
             }
 
             if (arguments.Length == 0) throw Error.NoInstanceForCall();
 
-            return Ast.Convert(
-                Ast.Call(
-                    AstUtils.Constant(Method),
-                    typeof(MethodInfo).GetMethod(&quot;Invoke&quot;, new Type[] { typeof(object), typeof(object[]) }),
-                    arguments[0],
-                    AstUtils.NewArrayHelper(typeof(object), ArrayUtils.RemoveFirst(arguments))
+            return new DynamicMetaObject(
+                Ast.Convert(
+                    Ast.Call(
+                        AstUtils.Constant(Method),
+                        typeof(MethodInfo).GetMethod(&quot;Invoke&quot;, new Type[] { typeof(object), typeof(object[]) }),
+                        arguments[0].Expression,
+                        AstUtils.NewArrayHelper(typeof(object), ArrayUtils.ConvertAll(ArrayUtils.RemoveFirst(arguments), x =&gt; x.Expression))
+                    ),
+                    Method.ReturnType
                 ),
-                Method.ReturnType);
+                BindingRestrictions.Empty
+            );
         }
     }
 }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/MethodTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -392,22 +392,25 @@ namespace Microsoft.Scripting.Actions {
 
                 lock (_topPackage.HierarchyLock) {
                     List&lt;object&gt; res = new List&lt;object&gt;();
-                    foreach (string s in _dict.Keys) {
-                        res.Add(s);
-                    }
+                    return (ICollection&lt;object&gt;)AddKeys(res);
+                }
+            }
+        }
 
-                    foreach (KeyValuePair&lt;Assembly, TypeNames&gt; kvp in _typeNames) {
-                        foreach (string typeName in kvp.Value.GetNormalizedTypeNames()) {
-                            if (!res.Contains(typeName)) {
-                                res.Add(typeName);
-                            }
-                        }
-                    }
+        private IList AddKeys(IList res) {
+            foreach (string s in _dict.Keys) {
+                res.Add(s);
+            }
 
-                    res.Sort();
-                    return res;
+            foreach (KeyValuePair&lt;Assembly, TypeNames&gt; kvp in _typeNames) {
+                foreach (string typeName in kvp.Value.GetNormalizedTypeNames()) {
+                    if (!res.Contains(typeName)) {
+                        res.Add(typeName);
+                    }
                 }
             }
+            
+            return res;
         }
 
         #endregion
@@ -545,8 +548,16 @@ namespace Microsoft.Scripting.Actions {
 
         #region IMembersList Members
 
-        public IList&lt;object&gt; GetMemberNames(CodeContext context) {
-            return (IList&lt;object&gt;)Keys;
+        public IList&lt;string&gt; GetMemberNames() {
+            LoadNamespaces();
+
+            lock (_topPackage.HierarchyLock) {
+
+                List&lt;string&gt; res = new List&lt;string&gt;();
+                AddKeys(res);
+                res.Sort();
+               return res;
+            }
         }
 
         #endregion</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/NamespaceTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,11 +14,11 @@
  * ***************************************************************************/
 
 using System;
-using System.Linq.Expressions;
+using System.Dynamic;
 using System.Reflection;
+
+using Microsoft.Scripting.Actions.Calls;
 using Microsoft.Scripting.Generation;
-using Microsoft.Scripting.Runtime;
-using AstUtils = Microsoft.Scripting.Ast.Utils;
 
 namespace Microsoft.Scripting.Actions {
 
@@ -57,7 +57,7 @@ namespace Microsoft.Scripting.Actions {
 
         #region Public expression builders
 
-        public override Expression GetValue(Expression context, ActionBinder binder, Type type) {
+        public override DynamicMetaObject GetValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type) {
             if (!IsStatic || GetIndexParameters().Length &gt; 0) {
                 // need to bind to a value or parameters to get the value.
                 return binder.ReturnMemberTracker(type, this);
@@ -70,11 +70,11 @@ namespace Microsoft.Scripting.Actions {
             }
 
             if (getter.IsPublic &amp;&amp; getter.DeclaringType.IsPublic) {
-                return AstUtils.Convert(binder.MakeCallExpression(context, getter), typeof(object));
+                return binder.MakeCallExpression(resolverFactory, getter);
             }
 
             // private binding is just a call to the getter method...
-            return MemberTracker.FromMemberInfo(getter).Call(context, binder);
+            return MemberTracker.FromMemberInfo(getter).Call(resolverFactory, binder);
         }
 
         public override ErrorInfo GetError(ActionBinder binder) {
@@ -95,7 +95,7 @@ namespace Microsoft.Scripting.Actions {
 
         #region Internal expression builders
 
-        protected internal override Expression GetBoundValue(Expression context, ActionBinder binder, Type type, Expression instance) {
+        protected internal override DynamicMetaObject GetBoundValue(OverloadResolverFactory resolverFactory, ActionBinder binder, Type type, DynamicMetaObject instance) {
             if (instance != null &amp;&amp; IsStatic) {
                 return null;
             }
@@ -114,14 +114,14 @@ namespace Microsoft.Scripting.Actions {
             getter = CompilerHelpers.TryGetCallableMethod(getter);
 
             if (binder.PrivateBinding || CompilerHelpers.IsVisible(getter)) {
-                return AstUtils.Convert(binder.MakeCallExpression(context, getter, instance), typeof(object));
+                return ((DefaultBinder)binder).MakeCallExpression(resolverFactory, getter, instance);
             }
 
             // private binding is just a call to the getter method...
-            return DefaultBinder.MakeError(((DefaultBinder)binder).MakeNonPublicMemberGetError(context, this, type, instance), typeof(object));
+            return DefaultBinder.MakeError(((DefaultBinder)binder).MakeNonPublicMemberGetError(resolverFactory, this, type, instance), BindingRestrictions.Empty, typeof(object));
         }
 
-        public override ErrorInfo GetBoundError(ActionBinder binder, Expression instance) {
+        public override ErrorInfo GetBoundError(ActionBinder binder, DynamicMetaObject instance) {
             MethodInfo getter = ResolveGetter(binder.PrivateBinding);
 
             if (getter == null) {
@@ -139,7 +139,7 @@ namespace Microsoft.Scripting.Actions {
             throw new InvalidOperationException();
         }
 
-        public override MemberTracker BindToInstance(Expression instance) {
+        public override MemberTracker BindToInstance(DynamicMetaObject instance) {
             return new BoundMemberTracker(this, instance);
         }
 </diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/PropertyTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -83,7 +83,7 @@ namespace Microsoft.Scripting.Actions {
             return repr.ToString();
         }
 
-        public override IList&lt;object&gt; GetMemberNames(CodeContext context) {
+        public override IList&lt;string&gt; GetMemberNames() {
             Dictionary&lt;string, string&gt; members = new Dictionary&lt;string, string&gt;();
             foreach (Type t in this.Types) {
                 CollectMembers(members, t);</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/TypeGroup.cs</filename>
    </modified>
    <modified>
      <diff>@@ -38,15 +38,15 @@ namespace Microsoft.Scripting.Actions {
 
         #region IMembersList Members
 
-        public virtual IList&lt;object&gt; GetMemberNames(CodeContext context) {
+        public virtual IList&lt;string&gt; GetMemberNames() {
             Dictionary&lt;string, string&gt; members = new Dictionary&lt;string, string&gt;();
             CollectMembers(members, Type);
 
             return MembersToList(members);
         }
 
-        internal static IList&lt;object&gt; MembersToList(Dictionary&lt;string, string&gt; members) {
-            List&lt;object&gt; res = new List&lt;object&gt;();
+        internal static IList&lt;string&gt; MembersToList(Dictionary&lt;string, string&gt; members) {
+            List&lt;string&gt; res = new List&lt;string&gt;();
             foreach (string key in members.Keys) {
                 res.Add(key);
             }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/TypeTracker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -47,7 +47,6 @@ namespace Microsoft.Scripting.Ast {
         private Expression _body;
         private bool _dictionary;
         private bool _visible = true;
-        private bool _addCodeContext;
         private bool _completed;
 
         private static int _lambdaId; //for generating unique lambda name
@@ -148,20 +147,7 @@ namespace Microsoft.Scripting.Ast {
                 _visible = value;
             }
         }
-
-        /// &lt;summary&gt;
-        /// Prevents builder from inserting context scope.
-        /// Default is false (will insert if needed).
-        /// &lt;/summary&gt;
-        public bool AddCodeContext {
-            get {
-                return _addCodeContext;
-            }
-            set {
-                _addCodeContext = value;
-            }
-        }
-
+        
         public List&lt;ParameterExpression&gt; GetVisibleVariables() {
             var vars = new List&lt;ParameterExpression&gt;(_visibleVars.Count);
             foreach (var v in _visibleVars) {
@@ -538,25 +524,7 @@ namespace Microsoft.Scripting.Ast {
 
         private Expression MakeBody() {
             Expression body = _body;
-
-            // wrap a CodeContext scope if needed
-            if (AddCodeContext) {
-
-                var vars = GetVisibleVariables();
-
-                if (vars.Count &gt; 0) {
-                    body = Utils.CodeContextScope(
-                        body,
-                        Expression.Call(
-                            typeof(RuntimeHelpers).GetMethod(&quot;CreateNestedCodeContext&quot;),
-                            Utils.VariableDictionary(vars),
-                            Utils.CodeContext(),
-                            AstUtils.Constant(_visible)
-                        )
-                    );
-                }
-            }
-
+            
             // wrap a scope if needed
             if (_locals != null &amp;&amp; _locals.Count &gt; 0) {
                 body = Expression.Block(new ReadOnlyCollection&lt;ParameterExpression&gt;(_locals.ToArray()), body);
@@ -611,11 +579,6 @@ namespace Microsoft.Scripting.Ast {
 
 namespace Microsoft.Scripting.Runtime {
     public static partial class ScriptingRuntimeHelpers {
-        public static CodeContext CreateNestedCodeContext(CustomSymbolDictionary variables, CodeContext context, bool visible) {
-            Debug.Assert(variables.Count &gt; 0);
-            return new CodeContext(new Scope(context.Scope, variables, visible), context.LanguageContext, context);
-        }
-
         /// &lt;summary&gt;
         /// Used by prologue code that is injected in lambdas to ensure that delegate signature matches what 
         /// lambda body expects. Such code typically unwraps subset of the params array manually, </diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Ast/LambdaBuilder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -662,15 +662,6 @@ namespace Microsoft.Scripting.Generation {
             return res;
         }
 
-        /// &lt;summary&gt;
-        /// Returns a value which indicates failure when a ConvertToAction of ImplicitTry or
-        /// ExplicitTry.
-        /// &lt;/summary&gt;
-        public static Expression GetTryConvertReturnValue(CodeContext context, RuleBuilder rule) {
-            rule.IsError = true;
-            return rule.MakeReturn(context.LanguageContext.Binder, GetTryConvertReturnValue(rule.ReturnType));
-        }
-
         public static bool HasTypeConverter(Type fromType, Type toType) {
 #if SILVERLIGHT
             return false;</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Generation/CompilerHelpers.cs</filename>
    </modified>
    <modified>
      <diff>@@ -456,7 +456,7 @@ namespace Microsoft.Scripting.Hosting {
             ContractUtils.RequiresNotNull(scope, &quot;scope&quot;);
             ContractUtils.RequiresNotNull(name, &quot;name&quot;);
 
-            return _language.LookupName(scope.Scope, SymbolTable.StringToId(name));
+            return scope.Scope.GetVariable(SymbolTable.StringToId(name));
         }
 
         /// &lt;summary&gt;
@@ -474,7 +474,7 @@ namespace Microsoft.Scripting.Hosting {
             ContractUtils.RequiresNotNull(scope, &quot;scope&quot;);
             ContractUtils.RequiresNotNull(name, &quot;name&quot;);
 
-            return _language.RemoveName(scope.Scope, SymbolTable.StringToId(name));
+            return scope.Scope.TryRemoveVariable(SymbolTable.StringToId(name));
         }
 
         /// &lt;summary&gt;
@@ -490,7 +490,7 @@ namespace Microsoft.Scripting.Hosting {
             ContractUtils.RequiresNotNull(scope, &quot;scope&quot;);
             ContractUtils.RequiresNotNull(name, &quot;name&quot;);
 
-            _language.SetName(scope.Scope, SymbolTable.StringToId(name), value);
+            scope.Scope.SetVariable(SymbolTable.StringToId(name), value);
         }
 
         /// &lt;summary&gt;
@@ -509,7 +509,7 @@ namespace Microsoft.Scripting.Hosting {
             ContractUtils.RequiresNotNull(scope, &quot;scope&quot;);
             ContractUtils.RequiresNotNull(name, &quot;name&quot;);
 
-            return _language.TryLookupName(scope.Scope, SymbolTable.StringToId(name), out value);
+            return scope.Scope.TryGetVariable(SymbolTable.StringToId(name), out value);
         }
 
         /// &lt;summary&gt;</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Hosting/ScriptEngine.cs</filename>
    </modified>
    <modified>
      <diff>@@ -84,7 +84,7 @@ namespace Microsoft.Scripting.Hosting {
         /// &lt;exception cref=&quot;MissingMemberException&quot;&gt;The specified name is not defined in the scope.&lt;/exception&gt;
         /// &lt;exception cref=&quot;ArgumentNullException&quot;&gt;&lt;paramref name=&quot;name&quot;/&gt; is a &lt;c&gt;null&lt;/c&gt; reference.&lt;/exception&gt;
         public dynamic GetVariable(string name) {
-            return _scope.LookupName(_engine.LanguageContext, SymbolTable.StringToId(name));
+            return _scope.GetVariable(SymbolTable.StringToId(name));
         }
 
         /// &lt;summary&gt;
@@ -103,7 +103,7 @@ namespace Microsoft.Scripting.Hosting {
         /// &lt;/summary&gt;
         /// &lt;exception cref=&quot;ArgumentNullException&quot;&gt;&lt;paramref name=&quot;name&quot;/&gt; is a &lt;c&gt;null&lt;/c&gt; reference.&lt;/exception&gt;
         public bool TryGetVariable(string name, out dynamic value) {
-            return _scope.TryGetName(SymbolTable.StringToId(name), out value);
+            return _scope.TryGetVariable(SymbolTable.StringToId(name), out value);
         }
 
         /// &lt;summary&gt;
@@ -114,7 +114,7 @@ namespace Microsoft.Scripting.Hosting {
         /// &lt;exception cref=&quot;ArgumentNullException&quot;&gt;&lt;paramref name=&quot;name&quot;/&gt; is a &lt;c&gt;null&lt;/c&gt; reference.&lt;/exception&gt;
         public bool TryGetVariable&lt;T&gt;(string name, out T value) {
             object result;
-            if (_scope.TryGetName(SymbolTable.StringToId(name), out result)) {
+            if (_scope.TryGetVariable(SymbolTable.StringToId(name), out result)) {
                 value = _engine.Operations.ConvertTo&lt;T&gt;(result);
                 return true;
             }
@@ -127,7 +127,7 @@ namespace Microsoft.Scripting.Hosting {
         /// &lt;/summary&gt;
         /// &lt;exception cref=&quot;ArgumentNullException&quot;&gt;&lt;paramref name=&quot;name&quot;/&gt; is a &lt;c&gt;null&lt;/c&gt; reference.&lt;/exception&gt;
         public void SetVariable(string name, object value) {
-            _scope.SetName(SymbolTable.StringToId(name), value);
+            _scope.SetVariable(SymbolTable.StringToId(name), value);
         }
 
 #if !SILVERLIGHT
@@ -174,7 +174,7 @@ namespace Microsoft.Scripting.Hosting {
         /// &lt;/summary&gt;
         /// &lt;exception cref=&quot;ArgumentNullException&quot;&gt;&lt;paramref name=&quot;name&quot;/&gt; is a &lt;c&gt;null&lt;/c&gt; reference.&lt;/exception&gt;
         public bool ContainsVariable(string name) {
-            return _scope.ContainsName(SymbolTable.StringToId(name));
+            return _scope.ContainsVariable(SymbolTable.StringToId(name));
         }
 
         /// &lt;summary&gt;
@@ -183,7 +183,7 @@ namespace Microsoft.Scripting.Hosting {
         /// &lt;returns&gt;&lt;c&gt;true&lt;/c&gt; if the value existed in the scope before it has been removed.&lt;/returns&gt;
         /// &lt;exception cref=&quot;ArgumentNullException&quot;&gt;&lt;paramref name=&quot;name&quot;/&gt; is a &lt;c&gt;null&lt;/c&gt; reference.&lt;/exception&gt;
         public bool RemoveVariable(string name) {
-            return _scope.TryRemoveName(SymbolTable.StringToId(name));
+            return _scope.TryRemoveVariable(SymbolTable.StringToId(name));
         }
 
         /// &lt;summary&gt;</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Hosting/ScriptScope.cs</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.Build.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@
     &lt;SignedSym Condition=&quot;'$(SignAssembly)' == 'true'&quot;&gt;SIGNED&lt;/SignedSym&gt;
     &lt;DelaySign&gt;true&lt;/DelaySign&gt;
     &lt;BaseAddress&gt;857735168&lt;/BaseAddress&gt;
-    &lt;SilverlightPath Condition=&quot;$(SilverlightPath) == ''&quot;&gt;..\..\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
+    &lt;SilverlightPath Condition=&quot;'$(SilverlightPath)' == ''&quot;&gt;..\..\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
   &lt;/PropertyGroup&gt;
   &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'FxCop|AnyCPU' &quot;&gt;
     &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
@@ -85,8 +85,8 @@
     &lt;SilverlightBuild&gt;true&lt;/SilverlightBuild&gt;
   &lt;/PropertyGroup&gt;
   &lt;ItemGroup&gt;
-    &lt;Reference Include=&quot;System&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
-    &lt;Reference Include=&quot;System.Configuration&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Configuration&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
     &lt;Reference Include=&quot;mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;$(SilverlightPath)\mscorlib.dll&lt;/HintPath&gt;
@@ -96,8 +96,8 @@
       &lt;HintPath&gt;$(SilverlightPath)\System.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
     &lt;Reference Include=&quot;System.Data&quot; /&gt;
-    &lt;Reference Include=&quot;System.Runtime.Remoting&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
-    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Runtime.Remoting&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
     &lt;Compile Include=&quot;..\..\Hosts\Silverlight\SilverlightVersion.cs&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;
@@ -144,7 +144,6 @@
     &lt;Compile Include=&quot;Actions\OperationBinder.cs&quot; /&gt;
     &lt;Compile Include=&quot;Actions\OperationMetaObject.cs&quot; /&gt;
     &lt;Compile Include=&quot;ArgumentTypeException.cs&quot; /&gt;
-    &lt;Compile Include=&quot;Ast\CodeContextExpression.cs&quot; /&gt;
     &lt;Compile Include=&quot;Ast\FinallyFlowControlExpression.cs&quot; /&gt;
     &lt;Compile Include=&quot;Ast\FlowControlRewriter.cs&quot; /&gt;
     &lt;Compile Include=&quot;Ast\SourceFileInformation.cs&quot; /&gt;
@@ -353,7 +352,6 @@
     &lt;Compile Include=&quot;Actions\NestedTypeTracker.cs&quot; /&gt;
     &lt;Compile Include=&quot;Actions\PropertyTracker.cs&quot; /&gt;
     &lt;Compile Include=&quot;Actions\ReflectedPropertyTracker.cs&quot; /&gt;
-    &lt;Compile Include=&quot;Actions\RuleBuilder.cs&quot; /&gt;
     &lt;Compile Include=&quot;Actions\TopNamespaceTracker.cs&quot; /&gt;
     &lt;Compile Include=&quot;Actions\TrackerTypes.cs&quot; /&gt;
     &lt;Compile Include=&quot;Actions\TypeGroup.cs&quot; /&gt;
@@ -369,7 +367,6 @@
     &lt;Compile Include=&quot;Runtime\BaseSymbolDictionary.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\BinderType.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\CallTargets.cs&quot; /&gt;
-    &lt;Compile Include=&quot;Runtime\CodeContext.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\ContextId.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\CustomSymbolDictionary.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\DlrCachedCodeAttribute.cs&quot; /&gt;
@@ -403,7 +400,6 @@
     &lt;Compile Include=&quot;Runtime\StaticExtensionMethodAttribute.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\SymbolDictionary.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\TransformDictEnumerator.cs&quot; /&gt;
-    &lt;Compile Include=&quot;Runtime\UnboundNameException.cs&quot; /&gt;
     &lt;Compile Include=&quot;Runtime\Uninitialized.cs&quot; /&gt;
     &lt;Compile Include=&quot;Utils\ArrayUtils.cs&quot; /&gt;
     &lt;Compile Include=&quot;Utils\AssemblyQualifiedTypeName.cs&quot; /&gt;</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -135,9 +135,6 @@ InvalidArgumentType=Invalid type of argument {0}; expecting {1}.
 ## ExceptionType=ArgumentException
 CannotChangeNonCachingValue=Cannot change non-caching value.
 
-## ExceptionType=Microsoft.Scripting.Runtime.UnboundLocalException
-ReferencedBeforeAssignment=Local variable '{0}' referenced before assignment.
-
 ## ExceptionType=MissingMemberException
 FieldReadonly=Field {0} is read-only
 </diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.txt</filename>
    </modified>
    <modified>
      <diff>@@ -67,13 +67,12 @@ namespace Microsoft.Scripting.Runtime {
     internal static class AssemblyTypeNames {
         public static IEnumerable&lt;TypeName&gt; GetTypeNames(Assembly assem, bool includePrivateTypes) {
 #if !SILVERLIGHT
-            AssemblyName assemblyName = new AssemblyName(assem.FullName);
-            switch (assemblyName.Name) {
-                case &quot;mscorlib&quot;: return Get_mscorlib_TypeNames();
-                case &quot;System&quot;: return Get_System_TypeNames();
-                case &quot;System.Xml&quot;: return Get_SystemXml_TypeNames();
-                case &quot;System.Drawing&quot;: return Get_SystemDrawing_TypeNames();
-                case &quot;System.Windows.Forms&quot;: return Get_SystemWindowsForms_TypeNames();
+            switch (assem.FullName) {
+                case &quot;mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;: return Get_mscorlib_TypeNames();
+                case &quot;System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;: return Get_System_TypeNames();
+                case &quot;System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;: return Get_SystemXml_TypeNames();
+                case &quot;System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;: return Get_SystemDrawing_TypeNames();
+                case &quot;System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;: return Get_SystemWindowsForms_TypeNames();
             }
 #endif
 </diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/AssemblyTypeNames.cs</filename>
    </modified>
    <modified>
      <diff>@@ -92,45 +92,7 @@ namespace Microsoft.Scripting.Runtime {
             }
             return res;
         }
-
-        #region Event support
-
-        public static EventTracker EventTrackerInPlaceAdd&lt;T&gt;(CodeContext context, EventTracker self, T target) {
-            MethodInfo add = self.Event.GetAddMethod(context.LanguageContext.DomainManager.Configuration.PrivateBinding);
-            add.Invoke(null, new object[] { target });
-            return self;
-        }
-
-        public static EventTracker EventTrackerInPlaceRemove&lt;T&gt;(CodeContext context, EventTracker self, T target) {
-            MethodInfo remove = self.Event.GetRemoveMethod(context.LanguageContext.DomainManager.Configuration.PrivateBinding);
-            remove.Invoke(null, new object[] { target });
-            return self;
-        }
-
-        public static BoundMemberTracker BoundEventTrackerInPlaceAdd&lt;T&gt;(CodeContext context, BoundMemberTracker self, T target) {
-            if (self.BoundTo.MemberType == TrackerTypes.Event) {
-                EventTracker et = (EventTracker)self.BoundTo;
-
-                MethodInfo add = et.Event.GetAddMethod(context.LanguageContext.DomainManager.Configuration.PrivateBinding);
-                add.Invoke(self.ObjectInstance, new object[] { target });
-                return self;
-            }
-            throw new InvalidOperationException();
-        }
-
-        public static BoundMemberTracker BoundEventTrackerInPlaceRemove&lt;T&gt;(CodeContext context, BoundMemberTracker self, T target) {
-            if (self.BoundTo.MemberType == TrackerTypes.Event) {
-                EventTracker et = (EventTracker)self.BoundTo;
-
-                MethodInfo remove = et.Event.GetRemoveMethod(context.LanguageContext.DomainManager.Configuration.PrivateBinding);
-                remove.Invoke(self.ObjectInstance, new object[] { target });
-                return self;
-            }
-            throw new InvalidOperationException();
-        }
         
-        #endregion
-
         public static ArgumentTypeException BadArgumentsForOperation(Operators op, params object[] args) {
             StringBuilder message = new StringBuilder(&quot;unsupported operand type(s) for operation &quot;);
             message.Append(op.ToString());</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/BinderOps.cs</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,7 @@ namespace Microsoft.Scripting.Runtime {
             throw new NotImplementedException();
         }
 
-        public override Expression ConvertExpression(Expression expr, Type toType, ConversionResultKind kind, Expression context) {
+        public override Expression ConvertExpression(Expression expr, Type toType, ConversionResultKind kind, OverloadResolverFactory factory) {
             if (toType.IsAssignableFrom(expr.Type)) {
                 return expr;
             }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/DefaultLanguageContext.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,26 +20,18 @@ namespace Microsoft.Scripting.Runtime {
     /// Helper for storing information about stack frames.
     /// &lt;/summary&gt;
     public class DynamicStackFrame {
-        private CodeContext _context;
         private string _funcName;
         private string _filename;
         private int _lineNo;
         private MethodBase _method;
 
-        public DynamicStackFrame(CodeContext context, MethodBase method, string funcName, string filename, int line) {
-            _context = context;
+        public DynamicStackFrame(MethodBase method, string funcName, string filename, int line) {
             _funcName = funcName;
             _filename = filename;
             _lineNo = line;
             _method = method;
         }
 
-        public CodeContext CodeContext {
-            get {
-                return _context;
-            }
-        }
-
         [System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Design&quot;, &quot;CA1024:UsePropertiesWhereAppropriate&quot;)]
         public MethodBase GetMethod() {
             return _method;</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/DynamicStackFrame.cs</filename>
    </modified>
    <modified>
      <diff>@@ -112,17 +112,7 @@ namespace Microsoft.Scripting.Runtime {
             return TryGetAssociatedStackTraces(rethrow, out result) ? result : null;
         }
 
-        public static void UpdateStackTrace(CodeContext context, MethodBase method, string funcName, string filename, int line) {
-            if (line != -1) {
-                Debug.Assert(filename != null);
-                if (_stackFrames == null) _stackFrames = new List&lt;DynamicStackFrame&gt;();
-    
-                Debug.Assert(line != SourceLocation.None.Line);
-    
-                _stackFrames.Add(new DynamicStackFrame(context, method, funcName, filename, line));
-            }
-        }
-
+        
         public static List&lt;DynamicStackFrame&gt; AssociateDynamicStackFrames(Exception clrException) {
             if (_stackFrames != null) {
                 clrException.Data[typeof(DynamicStackFrame)] = _stackFrames;
@@ -287,7 +277,7 @@ namespace Microsoft.Scripting.Runtime {
                 }
             }
 
-            return new DynamicStackFrame(null, method, methodName, filename, line);
+            return new DynamicStackFrame(method, methodName, filename, line);
         }
 
         #endregion</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/ExceptionHelpers.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,13 +18,9 @@ using System.Collections.Generic;
 namespace Microsoft.Scripting.Runtime {
 
     /// &lt;summary&gt;
-    /// Provides a list of all the members of an instance.  ie. all the keys in the 
-    /// dictionary of the object. Note that it can contain objects that are not strings. 
-    /// 
-    /// Such keys can be added in IronPython using syntax like:
-    ///     obj.__dict__[100] = someOtherObject
+    /// Provides a list of all the members of an instance.  
     /// &lt;/summary&gt;
     public interface IMembersList {
-        IList&lt;object&gt; GetMemberNames(CodeContext context);
+        IList&lt;string&gt; GetMemberNames();
     }
 }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/IMembersList.cs</filename>
    </modified>
    <modified>
      <diff>@@ -152,78 +152,6 @@ namespace Microsoft.Scripting.Runtime {
 
         #endregion
 
-
-        /// &lt;summary&gt;
-        /// Looks up the name in the provided Scope using the current language's semantics.
-        /// &lt;/summary&gt;
-        public virtual bool TryLookupName(Scope scope, SymbolId name, out object value) {
-            if (scope.TryLookupName(name, out value) &amp;&amp; value != Uninitialized.Instance) {
-                return true;
-            }
-
-            return TryLookupGlobal(scope, name, out value);
-        }
-
-        /// &lt;summary&gt;
-        /// Looks up the name in the provided scope using the current language's semantics.
-        /// 
-        /// If the name cannot be found throws the language appropriate exception or returns
-        /// the language's appropriate default value.
-        /// &lt;/summary&gt;
-        public virtual object LookupName(Scope scope, SymbolId name) {
-            object value;
-            if (!TryLookupName(scope, name, out value) || value == Uninitialized.Instance) {
-                throw MissingName(name);
-            }
-
-            return value;
-        }
-
-        /// &lt;summary&gt;
-        /// Attempts to set the name in the provided scope using the current language's semantics.
-        /// &lt;/summary&gt;
-        public virtual void SetName(Scope scope, SymbolId name, object value) {
-            scope.SetName(name, value);
-        }
-
-        /// &lt;summary&gt;
-        /// Attempts to remove the name from the provided scope using the current language's semantics.
-        /// &lt;/summary&gt;
-        public virtual bool RemoveName(Scope scope, SymbolId name) {
-            if (!scope.TryRemoveName(name)) {
-                throw MissingName(name);
-            }
-            return true;
-        }
-
-        /// &lt;summary&gt;
-        /// Attemps to lookup a global variable using the language's semantics called from
-        /// the provided Scope.  The default implementation will attempt to lookup the variable
-        /// at the host level.
-        /// &lt;/summary&gt;
-        public virtual bool TryLookupGlobal(Scope scope, SymbolId name, out object value) {
-            value = null;
-            return false;
-        }
-
-        /// &lt;summary&gt;
-        /// Called when a lookup has failed and an exception should be thrown.  Enables the 
-        /// language context to throw the appropriate exception for their language when
-        /// name lookup fails.
-        /// &lt;/summary&gt;
-        protected internal virtual Exception MissingName(SymbolId name) {
-            return Error.NameNotDefined(SymbolTable.IdToString(name));
-        }
-
-        [System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Reliability&quot;, &quot;CA2001:AvoidCallingProblematicMethods&quot;, MessageId = &quot;System.Reflection.Assembly.LoadFile&quot;)]
-        public virtual Assembly LoadAssemblyFromFile(string file) {
-#if SILVERLIGHT
-            return null;
-#else
-            return Assembly.LoadFile(file);
-#endif
-        }
-
         #region ScriptEngine API
 
         public virtual Version LanguageVersion {</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/LanguageContext.cs</filename>
    </modified>
    <modified>
      <diff>@@ -143,53 +143,26 @@ namespace Microsoft.Scripting.Runtime {
         /// Trys to lookup the provided name in the current scope.  Search includes
         /// names that are only visible to the provided LanguageContext.
         /// &lt;/summary&gt;
-        public bool TryGetName(SymbolId name, out object value) {
-            if (_dict.TryGetValue(name, out value)) return true;
-
-            value = null;
-            return false;
+        public bool TryGetVariable(SymbolId name, out object value) {
+            return _dict.TryGetValue(name, out value);
         }
-
-        /// &lt;summary&gt;
-        /// Attempts to lookup the provided name in this scope or any outer scope.
-        /// &lt;/summary&gt;
-        public bool TryLookupName(SymbolId name, out object value) {
-            Scope curScope = this;
-            do {
-                if (curScope == this || curScope.IsVisible) {
-                    if (curScope.TryGetName(name, out value)) {
-                        return true;
-                    }
-                }
-
-                curScope = curScope.Parent;
-            } while (curScope != null);
-
-            value = null;
-            return false;
-        }
-
-        /// &lt;summary&gt;
-        /// Attempts to lookup the provided name in this scope or any outer scope.
-        /// If the name is not defined the language defined MissingName exception is thrown.
-        /// &lt;/summary&gt;
-        public object LookupName(LanguageContext context, SymbolId name) {
-            object res;
-            if (!TryLookupName(name, out res)) {
-                throw context.MissingName(name);
+		
+		public object GetVariable(SymbolId name) {
+            object value;
+            if (!TryGetVariable(name, out value)) {
+                throw Error.NameNotDefined(SymbolTable.IdToString(name));
             }
-
-            return res;
+            return value;
         }
 
         /// &lt;summary&gt;
         /// Sets the name to the specified value for the current context.
         /// &lt;/summary&gt;
         /// &lt;exception cref=&quot;MemberAccessException&quot;&gt;The name has already been published and marked as ReadOnly&lt;/exception&gt;
-        public void SetName(SymbolId name, object value) {
+        public void SetVariable(SymbolId name, object value) {
             _dict[name] = value;
         }
-
+		
         /// &lt;summary&gt;
         /// Removes all members from the dictionary and any context-sensitive dictionaries.
         /// &lt;/summary&gt;
@@ -200,20 +173,15 @@ namespace Microsoft.Scripting.Runtime {
             }
         }
 
-        /// &lt;summary&gt;
-        /// Determines if this context or any outer scope contains the defined name that
-        /// is available from the provided LanguageContext.
-        /// &lt;/summary&gt;
-        public bool ContainsName(SymbolId name) {
-            object tmp;
-            return TryLookupName(name, out tmp);
+        public bool ContainsVariable(SymbolId name) {
+            return _dict.ContainsKey(name);
         }
 
         /// &lt;summary&gt;
         /// Attemps to remove the provided name from this scope removing names visible
         /// to both the current context and all contexts.
         /// &lt;/summary&gt;
-        public bool TryRemoveName(SymbolId name) {
+        public bool TryRemoveVariable(SymbolId name) {
             bool fRemoved = false;
 
             // TODO: Ideally, we could do this without having to do two lookups.
@@ -225,19 +193,6 @@ namespace Microsoft.Scripting.Runtime {
             return fRemoved;
         }
 
-        // Emitted by TupleSlotFactory
-        /// &lt;summary&gt;
-        /// Gets the outer-most scope associated with this scope.  
-        /// &lt;/summary&gt;
-        public Scope ModuleScope {
-            get {
-                Scope cur = this;
-                while (cur.Parent != null) cur = cur.Parent;
-
-                return cur;
-            }
-        }
-
         /// &lt;summary&gt;
         /// Default scope dictionary
         /// &lt;/summary&gt;
@@ -292,5 +247,24 @@ namespace Microsoft.Scripting.Runtime {
         }
 
         #endregion
+
+        #region Obsolete
+
+        [Obsolete(&quot;Use SetVariable instead&quot;)]
+        public void SetName(SymbolId name, object value) {
+            SetVariable(name, value);
+        }
+
+        [Obsolete(&quot;Use TryGetVariable instead&quot;)]
+        public bool TryGetName(SymbolId name, out object value) {
+            return TryGetVariable(name, out value);
+        }
+
+        [Obsolete(&quot;Use ContainsVariable instead&quot;)]
+        public bool ContainsName(SymbolId name) {
+            return ContainsVariable(name);
+        }
+
+        #endregion
     }
 }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/Scope.cs</filename>
    </modified>
    <modified>
      <diff>@@ -112,10 +112,6 @@ namespace Microsoft.Scripting.Runtime {
             return new MissingMemberException(message);
         }
 
-        public static void ThrowUnboundLocalError(SymbolId name) {
-            throw Error.ReferencedBeforeAssignment(SymbolTable.IdToString(name));
-        }
-
         public static object ReadOnlyAssignError(bool field, string fieldName) {
             if (field) {
                 throw Error.FieldReadonly(fieldName);</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/ScriptingRuntimeHelpers.cs</filename>
    </modified>
    <modified>
      <diff>@@ -456,13 +456,6 @@ namespace Microsoft.Scripting {
         }
 
         /// &lt;summary&gt;
-        /// A string like  &quot;Local variable '{0}' referenced before assignment.&quot;
-        /// &lt;/summary&gt;
-        internal static string ReferencedBeforeAssignment(object p0) {
-            return FormatString(&quot;Local variable '{0}' referenced before assignment.&quot;, p0);
-        }
-
-        /// &lt;summary&gt;
         /// A string like  &quot;Field {0} is read-only&quot;
         /// &lt;/summary&gt;
         internal static string FieldReadonly(object p0) {
@@ -874,13 +867,6 @@ namespace Microsoft.Scripting {
         }
 
         /// &lt;summary&gt;
-        /// Microsoft.Scripting.Runtime.UnboundLocalException with message like &quot;Local variable '{0}' referenced before assignment.&quot;
-        /// &lt;/summary&gt;
-        internal static Exception ReferencedBeforeAssignment(object p0) {
-            return new Microsoft.Scripting.Runtime.UnboundLocalException(Strings.ReferencedBeforeAssignment(p0));
-        }
-
-        /// &lt;summary&gt;
         /// MissingMemberException with message like &quot;Field {0} is read-only&quot;
         /// &lt;/summary&gt;
         internal static Exception FieldReadonly(object p0) {</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Utils/ExceptionFactory.Generated.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ namespace Microsoft.Scripting.Utils {
 
     // Like ReadOnlyCollection&lt;T&gt;: wraps an IDictionary&lt;K, V&gt; in a read-only wrapper
     [Serializable]
-    internal sealed class ReadOnlyDictionary&lt;K, V&gt; : IDictionary&lt;K, V&gt; {
+    public sealed class ReadOnlyDictionary&lt;K, V&gt; : IDictionary&lt;K, V&gt; {
 
         // For wrapping non-readonly Keys, Values collections
         // Not used for standard dictionaries, which return read-only Keys and Values
@@ -84,7 +84,7 @@ namespace Microsoft.Scripting.Utils {
 
         private readonly IDictionary&lt;K, V&gt; _dict;
 
-        internal ReadOnlyDictionary(IDictionary&lt;K, V&gt; dict) {
+        public ReadOnlyDictionary(IDictionary&lt;K, V&gt; dict) {
             ReadOnlyDictionary&lt;K, V&gt; rodict = dict as ReadOnlyDictionary&lt;K, V&gt;;
             _dict = (rodict != null) ? rodict._dict : dict;
         }</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Utils/ReadOnlyDictionary.cs</filename>
    </modified>
    <modified>
      <diff>@@ -23,22 +23,28 @@ namespace Microsoft.Scripting.Utils {
     /// provides a thread-safe implementation. It holds onto a Dictionary[TKey, TValue] instead of inheriting from
     /// it so that users who need to do manual synchronization can access the underlying Dictionary[TKey, TValue].
     /// &lt;/summary&gt;
-    internal class SynchronizedDictionary&lt;TKey, TValue&gt; :
+    public class SynchronizedDictionary&lt;TKey, TValue&gt; :
         IDictionary&lt;TKey, TValue&gt;,
         ICollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;,
         IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt; {
 
-        Dictionary&lt;TKey, TValue&gt; _dictionary = new Dictionary&lt;TKey, TValue&gt;();
+        Dictionary&lt;TKey, TValue&gt; _dictionary;
 
         /// &lt;summary&gt;
         /// This returns the raw unsynchronized Dictionary[TKey, TValue]. Users are responsible for locking
         /// on it before accessing it. Also, it should not be arbitrarily handed out to other code since deadlocks
         /// can be caused if other code incorrectly locks on it.
         /// &lt;/summary&gt;
-        internal Dictionary&lt;TKey, TValue&gt; UnderlyingDictionary {
-            get {
-                return _dictionary;
-            }
+        public Dictionary&lt;TKey, TValue&gt; UnderlyingDictionary {
+            get { return _dictionary; }
+        }
+
+        public SynchronizedDictionary() 
+            : this(new Dictionary&lt;TKey, TValue&gt;()) {
+        }
+
+        public SynchronizedDictionary(Dictionary&lt;TKey, TValue&gt; dictionary) {
+            _dictionary = dictionary;
         }
 
         #region IDictionary&lt;TKey,TValue&gt; Members</diff>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Utils/SynchronizedDictionary.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Collections.ObjectModel;
 using System.Dynamic.Utils;
 using System.Linq.Expressions;
 
+#if SILVERLIGHT
+using System.Core;
+#endif //SILVERLIGHT
+
 namespace System.Dynamic {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Actions/CallInfo.cs</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,10 @@ using System.Linq.Expressions;
 using System.Linq.Expressions.Compiler;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif //SILVERLIGHT
+
 namespace System.Runtime.CompilerServices {
 
     //</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Actions/CallSite.cs</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,10 @@ using System.Linq.Expressions;
 using System.Threading;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif //SILVERLIGHT
+
 namespace System.Runtime.CompilerServices {
     /// &lt;summary&gt;
     /// Class responsible for runtime binding of the dynamic operations on the dynamic call site.
@@ -131,9 +135,10 @@ namespace System.Runtime.CompilerServices {
             //
             // finally produce the new rule if we need to
             //
-#if !MICROSOFT_SCRIPTING_CORE
+#if !MICROSOFT_SCRIPTING_CORE &amp;&amp; !SILVERLIGHT
             // We cannot compile rules in the heterogeneous app domains since they
             // may come from less trusted sources
+            // Silverlight always uses a homogenous appdomain, so we don&#8217;t need this check
             if (!AppDomain.CurrentDomain.IsHomogenous) {
                 throw Error.HomogenousAppDomainRequired();
             }</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Actions/CallSiteBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,12 @@ using System.Collections.Generic;
 using System.Dynamic.Utils;
 using System.Linq.Expressions;
 using System.Reflection;
+
+#if SILVERLIGHT
+using System.Core;
+#else
 using System.Runtime.Remoting;
+#endif
 
 namespace System.Dynamic {
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Actions/DynamicMetaObject.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,12 @@ using System.Dynamic.Utils;
 using System.Linq.Expressions;
 using System.Linq.Expressions.Compiler;
 using System.Runtime.CompilerServices;
+
+#if SILVERLIGHT
+using System.Core;
+#else
 using System.Runtime.Remoting;
+#endif
 
 namespace System.Dynamic {
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Actions/DynamicMetaObjectBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,10 @@ using System.Dynamic.Utils;
 using System.Linq.Expressions;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Dynamic {
     /// &lt;summary&gt;
     /// Represents an object with members that can be dynamically added and removed at runtime.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Actions/ExpandoObject.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/BinaryExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Threading;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents a block that contains a sequence of expressions where variables can be defined.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/BlockExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/CatchBlock.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Dynamic.Utils;
 using System.Diagnostics;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/ConditionalExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/ConstantExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Emits or clears a sequence point for debug information.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/DebugInfoExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,10 @@ using System.Linq.Expressions.Compiler;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents a dynamic operation.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/DynamicExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,10 @@ using System.Reflection;
 using System.Text;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents the initialization of a list.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/ElementInit.cs</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,10 @@ using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Threading;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// The base type for all nodes in Expression Trees.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/Expression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Specifies what kind of jump this &lt;see cref=&quot;GotoExpression&quot;/&gt; represents.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/GotoExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,10 @@ using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Text;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents indexing a property or array.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/IndexExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents an expression that applies a delegate or lambda expression to a list of argument expressions.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/InvocationExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,10 @@ using System.Reflection.Emit;
 using System.Threading;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Creates a &lt;see cref=&quot;LambdaExpression&quot;/&gt; node.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/LambdaExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,10 @@ using System.Dynamic.Utils;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents a constructor call that has a collection initializer.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/ListInitExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents an infinite loop. It can be exited with &quot;break&quot;.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/LoopExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Dynamic.Utils;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents assignment to a member of an object.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/MemberAssignment.cs</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/MemberExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Collections.ObjectModel;
 using System.Dynamic.Utils;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/MemberListBinding.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Collections.ObjectModel;
 using System.Dynamic.Utils;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents initializing members of a member of a newly created object.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/MemberMemberBinding.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,10 @@ using System.Dynamic.Utils;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents a call to either static or an instance method.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/MethodCallExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/NewArrayExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,10 @@ using System.Dynamic.Utils;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/NewExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/ParameterExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents a control expression that handles multiple selections by passing control to a &lt;see cref=&quot;SwitchCase&quot;/&gt;.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/SwitchExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Collections.ObjectModel;
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents a try/catch/finally/fault block.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/TryExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
     /// &lt;summary&gt;
     /// Represents an operation between an expression and a type. </diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/TypeBinaryExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Diagnostics;
 using System.Linq.Expressions;
 using System.Reflection;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Dynamic.Utils {
 
     internal static class TypeUtils {
@@ -139,8 +143,9 @@ namespace System.Dynamic.Utils {
             return false;
         }
 
-        internal static bool AreEquivalent(Type t1, Type t2) {
-#if MICROSOFT_SCRIPTING_CORE
+        internal static bool AreEquivalent(Type t1, Type t2)
+        {
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
             return t1 == t2;
 #else
             return t1 == t2 || t1.IsEquivalentTo(t2);</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/TypeUtils.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Dynamic.Utils;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Ast/UnaryExpression.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     /// &lt;summary&gt;
     /// This type tracks &quot;runtime&quot; constants--live objects that appear in</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/BoundConstants.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,10 @@ using System.Runtime.CompilerServices;
 using System.Dynamic;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     internal enum VariableStorageKind {
         Local,</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/CompilerScope.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@
  *
  * ***************************************************************************/
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 using ILGenerator = System.Linq.Expressions.Compiler.OffsetTrackingILGenerator;
 #endif
 </diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/DebugInfoGenerator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@
  *
  * ***************************************************************************/
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 using ILGenerator = System.Linq.Expressions.Compiler.OffsetTrackingILGenerator;
 #endif
 
@@ -24,6 +24,10 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
 
     internal static class ILGen {</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/ILGen.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Collections.Generic;
 using System.Linq.Expressions;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/KeyedQueue.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@
  *
  * ***************************************************************************/
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 using ILGenerator = System.Linq.Expressions.Compiler.OffsetTrackingILGenerator;
 #endif
 
@@ -22,6 +22,10 @@ using System.Diagnostics;
 using System.Dynamic.Utils;
 using System.Reflection.Emit;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/LabelInfo.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Dynamic.Utils;
 using System.Reflection;
 using System.Reflection.Emit;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     partial class LambdaCompiler {
 </diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/LambdaCompiler.Binary.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,10 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     partial class LambdaCompiler {
         [Flags]</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/LambdaCompiler.Expressions.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Dynamic.Utils;
 using System.Reflection;
 using System.Reflection.Emit;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
 
     partial class LambdaCompiler {</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/LambdaCompiler.Logical.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,10 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Globalization;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     partial class LambdaCompiler {
         private void EmitBlockExpression(Expression expr, CompilationFlags flags) {</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/LambdaCompiler.Statements.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,10 @@ using System.Reflection;
 using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     partial class LambdaCompiler {
 </diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/LambdaCompiler.Unary.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@
  *
  * ***************************************************************************/
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 using ILGenerator = System.Linq.Expressions.Compiler.OffsetTrackingILGenerator;
 #endif
 
@@ -83,7 +83,7 @@ namespace System.Linq.Expressions.Compiler {
         private LambdaCompiler(AnalyzedTree tree, LambdaExpression lambda) {
             Type[] parameterTypes = GetParameterTypes(lambda).AddFirst(typeof(Closure));
 
-#if SILVERLIGHT
+#if SILVERLIGHT &amp;&amp; MICROSOFT_SCRIPTING_CORE
             var method = new DynamicMethod(lambda.Name ?? &quot;lambda_method&quot;, lambda.ReturnType, parameterTypes);
 #else
             var method = new DynamicMethod(lambda.Name ?? &quot;lambda_method&quot;, lambda.ReturnType, parameterTypes, true);
@@ -93,7 +93,7 @@ namespace System.Linq.Expressions.Compiler {
             _lambda = lambda;
             _method = method;
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
             _ilg = new OffsetTrackingILGenerator(method.GetILGenerator());
 #else
             _ilg = method.GetILGenerator();
@@ -132,7 +132,7 @@ namespace System.Linq.Expressions.Compiler {
             _typeBuilder = (TypeBuilder)method.DeclaringType;
             _method = method;
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
             _ilg = new OffsetTrackingILGenerator(method.GetILGenerator());
 #else
             _ilg = method.GetILGenerator();</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/LambdaCompiler.cs</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,7 @@ using System.Diagnostics.SymbolStore;
 // Not needed in CLR 4 builds because we have the
 // ILGenerator.ILOffset property.
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 
 namespace System.Linq.Expressions.Compiler {
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/OffsetTrackingILGenerator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,10 @@ using System.Collections.ObjectModel;
 using System.Dynamic.Utils;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
 
     internal partial class StackSpiller {</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/StackSpiller.Bindings.cs</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,10 @@ using System.Dynamic.Utils;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/StackSpiller.cs</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@
  *
  * ***************************************************************************/
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 using ILGenerator = System.Linq.Expressions.Compiler.OffsetTrackingILGenerator;
 #endif
 
@@ -25,6 +25,10 @@ using System.Linq.Expressions.Compiler;
 using System.Reflection;
 using System.Reflection.Emit;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Runtime.CompilerServices {
     /// &lt;summary&gt;
     /// Generator of PDB debugging information for expression trees.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/SymbolDocumentGenerator.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,10 @@ using System.Collections.ObjectModel;
 using System.Diagnostics;
 using System.Dynamic.Utils;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Linq.Expressions.Compiler {
     /// &lt;summary&gt;
     /// Determines if variables are closed over in nested lambdas and need to</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Compiler/VariableBinder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@
     &lt;SignAssembly Condition=&quot;'$(SignAssembly)' == '' And Exists('$(AssemblyOriginatorKeyFile)')&quot;&gt;true&lt;/SignAssembly&gt;
     &lt;SignedSym Condition=&quot;'$(SignAssembly)' == 'true'&quot;&gt;SIGNED&lt;/SignedSym&gt;
     &lt;DelaySign&gt;true&lt;/DelaySign&gt;
-    &lt;SilverlightPath Condition=&quot;$(SilverlightPath) == ''&quot;&gt;..\..\..\..\..\..\Merlin\Main\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
+    &lt;SilverlightPath Condition=&quot;'$(SilverlightPath)' == ''&quot;&gt;..\..\..\..\..\..\Merlin\Main\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
     &lt;BaseAddress&gt;855638016&lt;/BaseAddress&gt;
   &lt;/PropertyGroup&gt;
   &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'FxCop|AnyCPU' &quot;&gt;
@@ -91,8 +91,8 @@
     &lt;SilverlightBuild&gt;true&lt;/SilverlightBuild&gt;
   &lt;/PropertyGroup&gt;
   &lt;ItemGroup&gt;
-    &lt;Reference Include=&quot;System&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
-    &lt;Reference Include=&quot;System.Configuration&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Configuration&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
     &lt;Reference Include=&quot;mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;$(SilverlightPath)\mscorlib.dll&lt;/HintPath&gt;
@@ -101,8 +101,8 @@
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;$(SilverlightPath)\System.dll&lt;/HintPath&gt;
     &lt;/Reference&gt;
-    &lt;Reference Include=&quot;System.Data&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
-    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Data&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System.Xml&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
     &lt;Compile Include=&quot;..\..\..\..\..\..\Merlin\Main\Hosts\Silverlight\SilverlightVersion.cs&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Microsoft.Scripting.Core.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@
     &lt;SignedSym Condition=&quot;'$(SignAssembly)' == 'true'&quot;&gt;SIGNED&lt;/SignedSym&gt;
     &lt;DelaySign&gt;true&lt;/DelaySign&gt;
     &lt;BaseAddress&gt;866123776&lt;/BaseAddress&gt;
-    &lt;SilverlightPath Condition=&quot;$(SilverlightPath) == ''&quot;&gt;..\..\..\..\..\..\Merlin\Main\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
+    &lt;SilverlightPath Condition=&quot;'$(SilverlightPath)' == ''&quot;&gt;..\..\..\..\..\..\Merlin\Main\Utilities\Silverlight\x86ret\&lt;/SilverlightPath&gt;
   &lt;/PropertyGroup&gt;
   &lt;PropertyGroup Condition=&quot; '$(Configuration)|$(Platform)' == 'FxCop|AnyCPU' &quot;&gt;
     &lt;DebugType&gt;pdbonly&lt;/DebugType&gt;
@@ -79,7 +79,7 @@
     &lt;SilverlightBuild&gt;true&lt;/SilverlightBuild&gt;
   &lt;/PropertyGroup&gt;
   &lt;ItemGroup&gt;
-    &lt;Reference Include=&quot;System&quot; Condition=&quot; $(SilverlightBuild) != 'true' &quot; /&gt;
+    &lt;Reference Include=&quot;System&quot; Condition=&quot; '$(SilverlightBuild)' != 'true' &quot; /&gt;
     &lt;Reference Include=&quot;mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e&quot; Condition=&quot; '$(SilverlightBuild)' == 'true' &quot;&gt;
       &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
       &lt;HintPath&gt;$(SilverlightPath)\mscorlib.dll&lt;/HintPath&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Microsoft.Scripting.ExtensionAttribute.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,13 @@ using System.Dynamic.Utils;
 
 #if SILVERLIGHT // Stubs
 
+// This is needed so we can build Silverlight version on Codeplex
+// where System.Core namespace is not defined.
+namespace System.Core 
+{ 
+    class Dummy { } 
+}
+
 namespace System {
 
     /// &lt;summary&gt;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Stubs.cs</filename>
    </modified>
    <modified>
      <diff>@@ -14,14 +14,14 @@
  * ***************************************************************************/
 
 namespace System {
-    #if MICROSOFT_SCRIPTING_CORE
+    #if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 
     /// &lt;summary&gt;
     /// Encapsulates a method that takes no parameters and does not return a value.
     /// &lt;/summary&gt;
     public delegate void Action();
 
-    #endif
+#endif
 
     // public delegate void Action&lt;T&gt;(T obj); -- Already defined in mscorlib
    
@@ -30,7 +30,7 @@ namespace System {
     // *** BEGIN GENERATED CODE ***
     // generated by function: gen_action_types from: generate_dynsites.py
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 
     /// &lt;summary&gt;
     /// Encapsulates a method that takes two parameters and does not return a value.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Utils/Action.cs</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,10 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq.Expressions;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Dynamic.Utils {
 
     // Will be replaced with CLRv4 managed contracts</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Utils/ContractUtils.cs</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@
 
 namespace System {
 
-    #if MICROSOFT_SCRIPTING_CORE
+    #if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 
     /// &lt;summary&gt;
     /// Encapsulates a method that has no parameters and returns a value of the type specified by the TResult parameter.
@@ -33,14 +33,14 @@ namespace System {
     /// &lt;returns&gt;The return value of the method that this delegate encapsulates.&lt;/returns&gt;
     public delegate TResult Func&lt;T, TResult&gt;(T arg);
 
-    #endif
+#endif
 
     #region Generated Func Types
 
     // *** BEGIN GENERATED CODE ***
     // generated by function: gen_func_types from: generate_dynsites.py
 
-#if MICROSOFT_SCRIPTING_CORE
+#if MICROSOFT_SCRIPTING_CORE || SILVERLIGHT
 
     /// &lt;summary&gt;
     /// Encapsulates a method that has two parameters and returns a value of the type specified by the TResult parameter.</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Utils/Function.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,12 +18,18 @@ using System.Collections.ObjectModel;
 using System.Dynamic.Utils;
 using System.Linq.Expressions;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Runtime.CompilerServices {
     /// &lt;summary&gt;
     /// The builder for read only collection.
     /// &lt;/summary&gt;
     /// &lt;typeparam name=&quot;T&quot;&gt;The type of the collection element.&lt;/typeparam&gt;
+#if !SILVERLIGHT
     [Serializable]
+#endif
     [System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Naming&quot;, &quot;CA1710:IdentifiersShouldHaveCorrectSuffix&quot;)]
     public sealed class ReadOnlyCollectionBuilder&lt;T&gt; : IList&lt;T&gt;, System.Collections.IList {
         private const int DefaultCapacity = 4;
@@ -31,7 +37,10 @@ namespace System.Runtime.CompilerServices {
         private T[] _items;
         private int _size;
         private int _version;
+
+#if !SILVERLIGHT
         [NonSerialized]
+#endif
         private Object _syncRoot;
 
         static readonly T[] _emptyArray = new T[0];
@@ -439,7 +448,9 @@ namespace System.Runtime.CompilerServices {
             throw new ArgumentException(Strings.InvalidObjectType(value != null ? value.GetType() : (object)&quot;null&quot;, typeof(T)), argument);
         }
 
+#if !SILVERLIGHT
         [Serializable]
+#endif
         private class Enumerator : IEnumerator&lt;T&gt;, System.Collections.IEnumerator {
             private readonly ReadOnlyCollectionBuilder&lt;T&gt; _builder;
             private readonly int _version;</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Utils/ReadOnlyCollectionBuilder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,10 @@
 using System.Collections.Generic;
 using System.Linq.Expressions;
 
+#if SILVERLIGHT
+using System.Core;
+#endif
+
 namespace System.Dynamic.Utils {
 
     // Like ReadOnlyCollection&lt;T&gt;: wraps an IDictionary&lt;K, V&gt; in a read-only wrapper</diff>
      <filename>ndp/fx/src/Core/Microsoft/Scripting/Utils/ReadOnlyDictionary.cs</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/array/zip_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/bignum/div_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/bignum/divmod_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/bignum/modulo_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/bignum/remainder_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/bignum/to_s_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/get_print_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/lock_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/post_form_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/post_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/propfind_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/proppatch_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/put_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/request_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/send_request_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/library/net/http/http/unlock_tags.txt</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Languages/Ruby/IronRuby.Tests.VS/IronRuby.Tests.VS.csproj</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Languages/Ruby/IronRuby.Tests.VS/MsTest.cs</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Languages/Ruby/RubyCodeCoverage.testrunconfig</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Languages/Ruby/RubyCodeCoverage.vsmdi</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Actions/RuleBuilder.cs</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Ast/CodeContextExpression.cs</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/CodeContext.cs</filename>
    </removed>
    <removed>
      <filename>Merlin/Main/Runtime/Microsoft.Scripting/Runtime/UnboundNameException.cs</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>4a4455dcbc726d7210996b57cd60e8ff0374f6bb</id>
    </parent>
    <parent>
      <id>b5f157e1d9da99a863dbfd24d0a6ab05cc3d59bf</id>
    </parent>
  </parents>
  <author>
    <name>Jim Deville</name>
    <email>jdeville@microsoft.com</email>
  </author>
  <url>http://github.com/shri/ironruby/commit/05ed08e4ab67cc3ec43e9f49265ddd48c3c0c320</url>
  <id>05ed08e4ab67cc3ec43e9f49265ddd48c3c0c320</id>
  <committed-date>2009-07-27T09:14:05-07:00</committed-date>
  <authored-date>2009-07-27T09:14:05-07:00</authored-date>
  <message>Merge branch 'master' of git@github.com:ironruby/ironruby</message>
  <tree>52b9c09a17d1000bf76838259d17dc9bf6ca1360</tree>
  <committer>
    <name>Jim Deville</name>
    <email>jdeville@microsoft.com</email>
  </committer>
</commit>
