[Mono-list] Javascript eval() function in c#

Martin Hinks mhinks at gmail.com
Tue Jun 7 16:41:33 EDT 2005


I think it's a good idea - very useful when you want the end user to
be able to enter their own mathematical expressions to have a
pre-built parser and evaluator.

There's an interesting article on the topic (and a full implementation
(in VB.NET)) at
http://www.codeproject.com/vb/net/math_expression_evaluator.asp.

Hope that helps,

Martin

On 6/7/05, Alek Storm <stormdoggy at gmail.com> wrote:
> On 6/7/05, Kornél Pál <kornelpal at hotmail.com> wrote:
> > >This function evaluates mathematical expressions.  Currently it
> > >only does addition, subtraction, multiplication, division, and
> > >exponents, but can be easily extended.  It's meant to work like the
> > >Javascript eval() function.  Please let me know if you find it useful.
> >
> > eval() is supported in .NET Framework implementation of JScript.NET but it
> > is not yet implemented in Mono.
> >
> > eval() is intended to execute any valid JScript.NET code so it should use
> > the built in JScript.NET compiler instead of a separate interpreter
> > implementation.
> >
> > But if your work is just a mathematical expression evaluator that targets
> > any language I think it is useful.
> >
> > Kornél
> >
> >
> 
> Ah.  I thought Javascript eval() only did mathemeatical expressions.
> I guess it would be kind of lofty for me to say it emulated Javascript
> eval(), then.  But yes, it does do mathematical expressions.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>


More information about the Mono-list mailing list