Sign in
Haibo Luo's weblog
Options
RSS for Posts
Atom
RSS for Comments
OK
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Search
Tags
DynamicMethod
IronPython
IronRuby
Miscellaneous
Pages
Reflection
Reflection.Emit
VisualStudio
Archive
Archives
April 2010
(1)
March 2008
(5)
October 2007
(6)
September 2007
(3)
August 2007
(1)
November 2006
(7)
October 2006
(2)
August 2006
(1)
July 2006
(1)
April 2006
(1)
February 2006
(2)
January 2006
(2)
November 2005
(2)
October 2005
(2)
September 2005
(2)
August 2005
(3)
MSDN Blogs
>
Haibo Luo's weblog
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Haibo Luo's weblog
ILVisualizer 2010 Solution
Posted
Mon, Apr 19 2010
by
Haibo_Luo
0
Comments
The projects are set to be built against the .NET 4.0.
Haibo Luo's weblog
IronPython: System.Reflection.Assembly object
Posted
Wed, Mar 12 2008
by
Haibo_Luo
1
Comments
IronPython offers a little bit more love to the Assembly object instance: we can directly access the assembly's top-level members (namespace, public type) via the dot operation. System.Reflection provides many ways to let you hold the assembly object...
Haibo Luo's weblog
IronPython: System.Array
Posted
Wed, Mar 12 2008
by
Haibo_Luo
1
Comments
When you start interop'ing with .NET in IronPython, sooner or later, you will find that you are in need of creating an array as argument. There are mainly 2 ways to create array objects: Array with type indexing (for one-dimensional array object only...
Haibo Luo's weblog
IronPython: ipyw.exe
Posted
Wed, Mar 12 2008
by
Haibo_Luo
1
Comments
Each IronPython binary release ships two executable files: ipy.exe and ipyw.exe. Their (only) difference is, ipy.exe is a console application and ipyw.exe is a windows application. So given the following winform.py, ## winform.py import clr clr.AddReference...
Haibo Luo's weblog
SignatureResolver (unfinished)
Posted
Sat, Mar 8 2008
by
Haibo_Luo
1
Comments
While writing the ILVisualizer for dynamic method late 2005, I'd like to show the local variable information as well; so I started working on the managed signature parser, at least to parse LocalVarSig (Ecma-335 23.2.6). It was 2+ years ago, and never...
Haibo Luo's weblog
ILVisualizer VS2008 solution
Posted
Fri, Mar 7 2008
by
Haibo_Luo
5
Comments
I attached the ILVisualizer VS2008 solution in this post. There is no source code update; the only change is to upgrade the Microsoft.VisualStudio.DebuggerVisualizers.dll reference from version 8.0.0.0 to version 9.0.0.0. Just for your convenience, so...
Haibo Luo's weblog
IronPython: Accessing the .NET Field
Posted
Sun, Oct 28 2007
by
Haibo_Luo
0
Comments
The .NET libraries normally do not expose the public field, but we can still find its' presence for certain scenarios. IronPython treats the .NET fields like python attribute. For python attribute, the typical operations are set, get and delete. In general...
Haibo Luo's weblog
VisualStudio as my IronPython editor
Posted
Wed, Oct 17 2007
by
Haibo_Luo
9
Comments
The following steps are what I did to get Visual Studio ready as my IronPython (and IronRuby) editor. Install the latest internal dogfood build of Visual Studio 2008. you may use Visual Studio 2005 or download the VS 2008 public beta2 ; Download and install...
Haibo Luo's weblog
IronPython: explicitly choose one method
Posted
Thu, Oct 11 2007
by
Haibo_Luo
0
Comments
C# allows method overloading. Given an argument list, the compiler performs the overload resolution to select the best method to invoke. The chosen method token is baked into the assembly. IronPython does the method resolution at the IronPython run time...
Haibo Luo's weblog
IronPython: Provide (or not) Argument for by-ref Parameter
Posted
Fri, Oct 5 2007
by
Haibo_Luo
1
Comments
Python function may return multiple objects as a tuple. The .NET method can only return one object as the result of a call; in order to return more than one objects, by-ref parameters are needed. They are decorated with the parameter modifier (ref, out...
Haibo Luo's weblog
IronPython: Keyword Argument to Set .NET Property/Field
Posted
Tue, Oct 2 2007
by
Haibo_Luo
0
Comments
Use keyword arguments to set properties or fields… you likely ask the question: where can we do this? IronPython allows it in the constructor call, the call against the .NET type. Such keyword should be the name of public field, or property (which is...
Haibo Luo's weblog
IronPython: Passing Arguments for a Call
Posted
Mon, Oct 1 2007
by
Haibo_Luo
0
Comments
After getting a CLR type, we can play it like a python type. We can get the class/static methods using the dot operator ("attribute reference") on the type, or create an instance of it and then get the instance methods. In Python’s word, these methods...
Haibo Luo's weblog
IronPython: Grab the .NET Type
Posted
Tue, Sep 25 2007
by
Haibo_Luo
0
Comments
After loading the assembly by clr.AddReference and then import namespace, we are ready to take hold of types and down-level namespaces using " attribute references ". >>> import System >>> System.DateTime # type <type 'DateTime'>...
Haibo Luo's weblog
IronPython: clr.AddReference
Posted
Tue, Sep 25 2007
by
Haibo_Luo
5
Comments
In order to interop with .NET libraries, we need first load in the assemblies we want to play with. The family of AddReference methods in the clr module serves the purpose. clr.AddReference clr.AddReferenceByName clr.AddReferenceByPartialName clr.AddReferenceToFile...
Haibo Luo's weblog
IronPython: import clr
Posted
Tue, Sep 25 2007
by
Haibo_Luo
0
Comments
clr is an IronPython built-in module, which provides some functionalities in order to interop with .NET. When writing "import clr" in a python module, it means you intend to leverage the .NET libraries. One classical example is python string's methods...
Haibo Luo's weblog
DebuggerTypeProxy for IronPython Old-style Class and Instance
Posted
Fri, Aug 3 2007
by
Haibo_Luo
1
Comments
First I want to make it clear that this post means nothing related to IronPython's plan about debugging python code in the future; it serves more as an interesting example to demonstrate DebuggerTypeProxyAttribute and how types can be created dynamically...
Haibo Luo's weblog
Name of Array Type
Posted
Wed, Nov 29 2006
by
Haibo_Luo
0
Comments
Two things related to array type name came to my mind while writing the previous post. Given an one-dimensional non-zero based double array x, x.GetType().ToString() returns "System.Double [*] "; we can use Type.GetType("System.Double[*]") to get hold...
Haibo Luo's weblog
Late-bound Array SetValue
Posted
Mon, Nov 27 2006
by
Haibo_Luo
0
Comments
The type " System.Array " provides us a set of API for the late-bound array operations, including array creation ( Array.CreateInstance ), read/write access to array element ( Array.SetValue / Array.GetValue ). They are convenient to use. Let me start...
Haibo Luo's weblog
Take Two: IL Visualizer
Posted
Thu, Nov 16 2006
by
Haibo_Luo
6
Comments
I was glad to hear many positive feedbacks about the DebuggerVisualizer for DynamicMethod ; on the sad side, it shows our lack of good LCG debugging support (on which, Mike Stall is seeking your opinion ). Recently along with the ILReader update, I made...
Haibo Luo's weblog
Turn MethodInfo to DynamicMethod
Posted
Tue, Nov 7 2006
by
Haibo_Luo
2
Comments
I do not know why anyone ever need this :) but few readers did ask me similar questions before. Solving this problem also demonstrates one more ILReader usage. To build a DynamicMethod, we can choose either DynamicILGenerator or DynamicILInfo . My first...
Haibo Luo's weblog
System.Reflection-based ILReader
Posted
Mon, Nov 6 2006
by
Haibo_Luo
2
Comments
Compared to what I posted previously here (or what was used in the DynamicMethod visualizer ), this new version introduced the Visitor pattern . A do-nothing visitor ILInstructionVisitor is included; the users can focus on their domain-specific logic...
Haibo Luo's weblog
Always Peverify IL Code of your Dynamic Method
Posted
Wed, Nov 1 2006
by
Haibo_Luo
0
Comments
Current dynamic method implementation does not have built-in support to pre-check whether the dynamic method code is verifiable. With bad IL sequence, very often you will get "System. InvalidProgramException : Common Language Runtime detected an invalid...
Haibo Luo's weblog
Shift Away from CLR Reflection Area
Posted
Wed, Nov 1 2006
by
Haibo_Luo
0
Comments
After 2-year Reflection test ownership and 1-year babysitting for Reflection.Emit and DynamicMethod areas, I am gradually away from these CLR feature areas, and will be more focusing on IronPython (and maybe others later). Before completely leaving them...
Haibo Luo's weblog
ILGenerator.EmitCall Mainly For vararg Methods
Posted
Sun, Aug 13 2006
by
Haibo_Luo
0
Comments
Vararg (variable arguments) methods accept argument lists of unknown length and type. CLR supports this by the IL instruction (arglist) and other BCL types, such as System.ArgIterator . C# compiler has undocumented keyword "__arglist" to support defining...
Haibo Luo's weblog
Member Order Returned by GetFields, GetMethods ...
Posted
Mon, Jul 10 2006
by
Haibo_Luo
9
Comments
As John mentioned in his post , every Reflection user should keep this in mind: our code should not count on the member order returned by GetFields, GetMethods and other similar GetXXXs calls. Given two fields (F1, F2) in one type, I think the compiler...
Page 1 of 2 (38 items)
1
2