Integration with System.Linq.Expression<T>

Nov 20, 2010 at 12:44 AM
Edited Nov 20, 2010 at 12:46 AM

Hi, All!

I suppose all of you are not internet rasists already, except mr. DavidJJon, of cause. Don't take it personally, thow.

I'm interested whether your project has plans of interation with System.Linq.Expression<T> compilation and evaluation.

For example:

         [TestMethod ]
         public  void  Test1_6()
         {
             CellExpression expression = Text .Parse("6+((7-2)/5-9)*0.5-2+1");
             System.Linq.Expressions.Expression<Func<double>> ex = () => expression.Eval();
             Func <double> func = ex.Compile();
             double  result = func();
             bool  expected = true;
             bool  actual = result == 1.0;
             Assert .AreEqual(expected, actual);
         }


See my project at http://expressionscompiler.codeplex.com/

Happy coding!

Nov 20, 2010 at 12:03 PM

Hi Artur,

Much better name :-)

I am certaintly not an Internet racist - it's a security issue - look up rootkit on Wikipedia and then you will understand.

Best regards,

David

 

 

 

Coordinator
Nov 20, 2010 at 3:31 PM

Hi Artur,

My parser already has such features, as expression evaluation and compiling to Func<>.

Nov 21, 2010 at 1:13 AM
Edited Nov 21, 2010 at 1:14 AM

Cool! Next time i'll ask codeplex admins to swith all my projects to new nick. Or you can, David. You can tell that i'm very positive in that way, but suppose they will fail to help me (or anyone with such acclaims)

By the way, I found 2 more bugs, already. I can't explain my feelings right now, but I'm much more effective in finding bugs, exploring code or such under my "real" nickname, where i feel myself more comfortable, guess you know, which one

1-(0)+1,

and

the demo UI bug

Cheers! :)

Happy coding!

Coordinator
Nov 21, 2010 at 3:36 AM

You probably used not the latest version of my code, as this expression is parsed normally.

So please update source code on you machine.

Nov 21, 2010 at 9:35 AM
Edited Nov 21, 2010 at 9:37 AM

Unfortunately, I have downloaded and tested this bug on a 59839 change set. When you enter to input window sequence "1" "-" "(" "0" ")" "+" "1", result is "0", which is not correct