delete: $/Dev10/feature/vs_langs01/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/core/proc;C840659
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C928062
File: RubyTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C928062  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;ProcToS
@@ -235,6 +235,7 @@
                 MethodToProc1,
                 DefineMethod1,
                 DefineMethod2,
+                ProcPosition1,
                 
                 Scenario_RubyInitializers0,
                 Scenario_RubyInitializers1,
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/BlockTests.cs;C857486
File: BlockTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/BlockTests.cs;C857486  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/BlockTests.cs;ProcToS
@@ -1172,6 +1172,30 @@
 
         }
 
+        [Options(Compatibility = RubyCompatibility.Ruby19)]
+        public void ProcPosition1() {
+             AssertOutput(() => CompilerTest(@"
+def foo &q 
+  p q
+end
+
+class C < Proc
+end
+
+foo { }                         # line 9
+p lambda {}                     
+p Proc.new {}                   
+p method(:foo).to_proc          # TODO: source info not available
+p C.new {}                      
+"), @"
+#<Proc:0x*@*ProcPosition1.rb:9>
+#<Proc:0x*@*ProcPosition1.rb:10 (lambda)>
+#<Proc:0x*@*ProcPosition1.rb:11>
+#<Proc:0x*@(unknown):0>
+#<C:0x*@*ProcPosition1.rb:13>
+", OutputFlags.Match);
+        }
+
         public void BlockArity1() {
             AssertOutput(delegate() {
                 CompilerTest(@"
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/OverloadResolutionTests.cs;C893105
File: OverloadResolutionTests.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/OverloadResolutionTests.cs;C893105  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/OverloadResolutionTests.cs;ProcToS
@@ -56,7 +56,7 @@
 
         public void OverloadResolution_Block1() {
             var scope = Context.EmptyScope;
-            var proc = new Proc(ProcKind.Proc, null, scope, new BlockDispatcher0((x, y) => null, BlockSignatureAttributes.None));
+            var proc = new Proc(ProcKind.Proc, null, scope, null, 0, new BlockDispatcher0((x, y) => null, BlockSignatureAttributes.None));
 
             var arguments = new[] {
                 // 1.times
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C926894
File: Initializers.Generated.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C926894  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;ProcToS
@@ -4051,6 +4051,10 @@
                 new System.Func<IronRuby.Builtins.Proc, IronRuby.Builtins.Proc>(IronRuby.Builtins.ProcOps.ToProc)
             );
             
+            module.DefineLibraryMethod("to_s", 0x51, 
+                new System.Func<IronRuby.Builtins.Proc, IronRuby.Builtins.MutableString>(IronRuby.Builtins.ProcOps.ToS)
+            );
+            
         }
         
         private static void LoadProc_Class(IronRuby.Builtins.RubyModule/*!*/ module) {
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ProcOps.cs;C802160
File: ProcOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ProcOps.cs;C802160  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ProcOps.cs;ProcToS
@@ -34,39 +34,56 @@
 
         #region Public Instance Methods
 
-        [RubyMethod("==", RubyMethodAttributes.PublicInstance)]
+        [RubyMethod("==")]
         public static bool Equal(Proc/*!*/ self, [NotNull]Proc/*!*/ other) {
             return self.Dispatcher == other.Dispatcher;
         }
 
-        [RubyMethod("==", RubyMethodAttributes.PublicInstance)]
+        [RubyMethod("==")]
         public static bool Equal(Proc/*!*/ self, object other) {
             return false;
         }
         
-        [RubyMethod("arity", RubyMethodAttributes.PublicInstance)]
+        [RubyMethod("arity")]
         public static int GetArity(Proc/*!*/ self) {
             return self.Dispatcher.Arity;
         }
 
-        [RubyMethod("binding", RubyMethodAttributes.PublicInstance)]
+        [RubyMethod("binding")]
         public static Binding/*!*/ GetLocalScope(Proc/*!*/ self) {
             return new Binding(self.LocalScope);
         }
 
-        [RubyMethod("dup", RubyMethodAttributes.PublicInstance)]
-        [RubyMethod("clone", RubyMethodAttributes.PublicInstance)]
+        [RubyMethod("dup")]
+        [RubyMethod("clone")]
         public static Proc/*!*/ Clone(Proc/*!*/ self) {
             return self.Copy();
         }
 
-        [RubyMethod("to_proc", RubyMethodAttributes.PublicInstance)]
+        [RubyMethod("to_proc")]
         public static Proc/*!*/ ToProc(Proc/*!*/ self) {
             return self;
         }
 
-        //    to_s
+        [RubyMethod("to_s")]
+        public static MutableString/*!*/ ToS(Proc/*!*/ self) {
+            var context = self.LocalScope.RubyContext;
 
+            var str = RubyUtils.ObjectToMutableStringPrefix(context, self);
+            str.Append('@');
+            str.Append(self.SourcePath ?? "(unknown)");
+            str.Append(':');
+            str.Append(self.SourceLine.ToString());
+
+            if (context.RubyOptions.Compatibility >= RubyCompatibility.Ruby19 && self.Kind == ProcKind.Lambda) {
+                str.Append(" (lambda)"); 
+            }
+
+            str.Append('>');
+
+            return str;
+        }
+
         #endregion
 
         #region call, []
@@ -123,6 +140,10 @@
 
         #endregion
 
+        #region TODO: ===, eql?, hash, yield, curry, source_location, lambda? (1.9)
+
+        #endregion
+
         #region Singleton Methods
 
         [RubyMethod("new", RubyMethodAttributes.PublicSingleton)]
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Proc.cs;C857486
File: Proc.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Proc.cs;C857486  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Proc.cs;ProcToS
@@ -44,16 +44,17 @@
         // Local scope inside the proc captured by the block definition:
         private readonly RubyScope/*!*/ _scope;
 
+        // position of the block definition (opening brace):
+        private readonly string _sourcePath;
+        private readonly int _sourceLine;
+
         private readonly BlockDispatcher/*!*/ _dispatcher;
         private ProcKind _kind;
 
         // we need to remember the block's owner and proc-converter frames:
-        private RuntimeFlowControl _owner;
-        private RuntimeFlowControl _converter;
+        internal RuntimeFlowControl Owner { get; set; }
+        internal RuntimeFlowControl Converter { get; set; }
 
-        internal RuntimeFlowControl Owner { get { return _owner; } set { _owner = value; } }
-        internal RuntimeFlowControl Converter { get { return _converter; } set { _converter = value; } }
-
         public ProcKind Kind {
             get { return _kind; }
             // friend: RuntimeFlowControl
@@ -72,22 +73,32 @@
             get { return _scope; }
         }
 
+        public string SourcePath {
+            get { return _sourcePath; }
+        }
+
+        public int SourceLine {
+            get { return _sourceLine; }
+        }
+
         internal static PropertyInfo/*!*/ SelfProperty { get { return typeof(Proc).GetProperty("Self"); } }
 
         #region Construction, Conversion
 
-        internal Proc(ProcKind kind, object self, RubyScope/*!*/ scope, BlockDispatcher/*!*/ dispatcher) {
+        internal Proc(ProcKind kind, object self, RubyScope/*!*/ scope, string sourcePath, int sourceLine, BlockDispatcher/*!*/ dispatcher) {
             Assert.NotNull(scope, dispatcher);
             _kind = kind;
             _self = self;
             _scope = scope;
             _dispatcher = dispatcher;
+            _sourcePath = sourcePath;
+            _sourceLine = sourceLine;
         }
 
         protected Proc(Proc/*!*/ proc)
-            : this(proc.Kind, proc.Self, proc.LocalScope, proc.Dispatcher) {
-            _owner = proc._owner;
-            _converter = proc._converter;
+            : this(proc.Kind, proc.Self, proc.LocalScope, proc.SourcePath, proc.SourceLine, proc.Dispatcher) {
+            Owner = proc.Owner;
+            Converter = proc.Converter;
         }
 
         /// <summary>
@@ -271,7 +282,7 @@
 
         public static Proc/*!*/ Create(RubyContext/*!*/ context, Delegate/*!*/ clrMethod, object self, int parameterCount) {
             // scope is used to get to the execution context:
-            return new Proc(ProcKind.Block, self, context.EmptyScope, BlockDispatcher.Create(clrMethod, parameterCount, BlockSignatureAttributes.None));
+            return new Proc(ProcKind.Block, self, context.EmptyScope, null, 0, BlockDispatcher.Create(clrMethod, parameterCount, BlockSignatureAttributes.None));
         }
 
         // The following methods are block implementations, therefore they need to have signature like a block.
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;C902904
File: RubyMethod.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;C902904  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyMethod.cs;ProcToS
@@ -78,7 +78,9 @@
                 );
             }
 
-            return new Proc(ProcKind.Block, scope.SelfObject, scope, _procDispatcher);
+            // TODO: 
+            // MRI: source file/line are that of the to_proc method call:
+            return new Proc(ProcKind.Block, scope.SelfObject, scope, null, 0, _procDispatcher);
         }
 
         #region Dynamic Operations
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/BlockDefinition.cs;C928099
File: BlockDefinition.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/BlockDefinition.cs;C928099  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/BlockDefinition.cs;ProcToS
@@ -184,7 +184,9 @@
                     attributes
                 ),
                 AstUtils.Constant(parameterCount),
-                AstUtils.Constant(attributes)
+                AstUtils.Constant(attributes),
+                gen.SourcePathConstant,
+                AstUtils.Constant(Location.Start.Line)
             );
         }
 
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;C928099
File: RubyOps.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;C928099  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;ProcToS
@@ -215,12 +215,12 @@
 
         [Emitted]
         public static Proc/*!*/ DefineBlock(RubyScope/*!*/ scope, RuntimeFlowControl/*!*/ runtimeFlowControl, object self, Delegate/*!*/ clrMethod,
-            int parameterCount, BlockSignatureAttributes attributesAndArity) {
+            int parameterCount, BlockSignatureAttributes attributesAndArity, string sourcePath, int startLine) {
             Assert.NotNull(scope, clrMethod);
 
             // closes block over self and context
             BlockDispatcher dispatcher = BlockDispatcher.Create(clrMethod, parameterCount, attributesAndArity);
-            Proc result = new Proc(ProcKind.Block, self, scope, dispatcher);
+            Proc result = new Proc(ProcKind.Block, self, scope, sourcePath, startLine, dispatcher);
 
             result.Owner = runtimeFlowControl;
             return result;
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C930038
File: RubyUtils.cs
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C930038  (server)    6/4/2009 9:26 AM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;ProcToS
@@ -121,7 +121,7 @@
             }
         }
 
-        internal static MutableString/*!*/ FormatObject(string/*!*/ className, int objectId, bool isTainted) {
+        public static MutableString/*!*/ FormatObjectPrefix(string/*!*/ className, int objectId, bool isTainted) {
             MutableString str = MutableString.CreateMutable();
             str.Append("#<");
             str.Append(className);
@@ -130,16 +130,22 @@
             str.Append(':');
             AppendFormatHexObjectId(str, objectId);
 
-            str.Append(">");
-
             str.IsTainted |= isTainted;
             return str;
         }
 
+        public static MutableString/*!*/ FormatObject(string/*!*/ className, int objectId, bool isTainted) {
+            return FormatObjectPrefix(className, objectId, isTainted).Append(">");
+        }
+
         public static MutableString/*!*/ ObjectToMutableString(RubyContext/*!*/ context, object obj) {
             return FormatObject(context.GetClassDisplayName(obj), GetObjectId(context, obj), context.IsObjectTainted(obj));
         }
 
+        public static MutableString/*!*/ ObjectToMutableStringPrefix(RubyContext/*!*/ context, object obj) {
+            return FormatObjectPrefix(context.GetClassDisplayName(obj), GetObjectId(context, obj), context.IsObjectTainted(obj));
+        }
+
         public static MutableString/*!*/ AppendFormatHexObjectId(MutableString/*!*/ str, int objectId) {
             return str.AppendFormat("0x{0:x7}", 2 * objectId);
         }
===================================================================
