System.Linq.Expressions vs Microsoft.Scripting.Ast

Dec 11, 2011 at 1:39 PM

Hi,

I'm learning to use the DLR and there is one thing I can't figure out.

There are two very similar classes called Expression in two different namespaces and assemblies:

  • System.Linq.Expressions
  • Microsoft.Scripting.Ast

Which one should I use in which case?

If I understand correctly the assembly Microsoft.Dynamic.dll use System.Linq.Expressions?

 

Thank you,

Ido.

Dec 11, 2011 at 7:40 PM

Microsoft.Scripting.Ast is the original version of the DLR expression trees; for .NET 4, these were added to System.Linq.Expressions. .NET 4 builds should use System.Linq.Expressions (and NOT link to Microsoft.Scripting.Core); .NET 2/3/3.5 builds should use Microsoft.Scripting.Ast and link to Microsoft.Scripting.Core.

IronPython uses a namespace alias that points to the correct one depending on the CLR version being built:

#if !CLR2
using MSAst = System.Linq.Expressions;
#else
using MSAst = Microsoft.Scripting.Ast;
#endif
Dec 11, 2011 at 8:46 PM

Thank you very much.

If you will be so kind to put a link to official documentation about it it will be great.

The DLR in general lack documentation, hope it will be fixed in the future.

 

Thanks again,

Ido.

Dec 11, 2011 at 8:46 PM

Thank you very much.

If you will be so kind to put a link to official documentation about it it will be great.

The DLR in general lack documentation, hope it will be fixed in the future.

 

Thanks again,

Ido.

Dec 11, 2011 at 10:20 PM

I'm not sure there is any documentation for quirks like that, unfortunately. Most of the DLR knowledge is in the source code of the language implementations.

Coordinator
Dec 12, 2011 at 3:54 PM

Ido, please see the documentation at http://dlr.codeplex.com/wikipage?title=Docs%20and%20specs&referringTitle=Home&ProjectName=dlr . There is full spec on expr trees, overview doc, etc.

Bill

From: ido_ran [email removed]
Sent: Sunday, December 11, 2011 12:47 PM
To: Bill Chiles
Subject: Re: System.Linq.Expressions vs Microsoft.Scripting.Ast [dlr:282550]

From: ido_ran

Thank you very much.

If you will be so kind to put a link to official documentation about it it will be great.

The DLR in general lack documentation, hope it will be fixed in the future.

Thanks again,

Ido.

Dec 13, 2011 at 9:16 PM

Thank you.

This is a lot of information about the DLR.

 

Ido.