[IronPython] Type analysis of expression

Michael Foord fuzzyman at voidspace.org.uk
Mon Oct 19 13:20:36 CEST 2009


Christian Schmidt wrote:
> Hello,
>
> we are using IronPython embedded into our application to evaluate user
> defined expression. The "variables" used in the expressions are strongly
> typed and the results need to be written back into a database.
>
> I know that the return type of a dynamic expression cannot be determined
> in general. But what would be a pragmatic way to guess the return type
> of an expression?

Hehe. If you're evaluating arbitrary functions provided by the user then 
I don't know of any way of 'inferring' the return type - beyond parsing 
it and modelling the type flow through the expression (which would be a 
lot of work).

All the best,

Michael
>
> Thanks,
> Christian
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list