Re: [IronPython] Type analysis of expression

2009-10-24 Thread Christian Schmidt
Hi Jeff, 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? Can you give some examples of expressions you need to infer? arithmetic operations: a + b / c functions: sqrt(a) logical

Re: [IronPython] Type analysis of expression

2009-10-24 Thread Jeff Hardy
On Sat, Oct 24, 2009 at 3:22 PM, Christian Schmidt christian2.schm...@gmx.de wrote: Hi Jeff, I'm going to assume that you have a way of determing the types of the input variables a, b, and c. If not, well, I'm not sure how much help this will be. You can use the IronPython parser classes to

Re: [IronPython] Type analysis of expression

2009-10-21 Thread Jeff Hardy
On Mon, Oct 19, 2009 at 1:03 AM, Christian Schmidt christian2.schm...@gmx.de wrote: 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? Can you give some examples of expressions you

Re: [IronPython] Type analysis of expression

2009-10-20 Thread Christian Schmidt
Hi Vernon, Maybe I'm missing the point -- are you trying to load data into an existing data table, or to DEFINE a new data table? Sorry for not clarifying this. I'm able to export to _new_ tables, which will be created at runtime. For existing tables we could easily work out with the

[IronPython] Type analysis of expression

2009-10-19 Thread Christian Schmidt
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

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Michael Foord
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

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Lepisto, Stephen P
...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, October 19, 2009 4:21 AM To: Discussion of IronPython Subject: Re: [IronPython] Type analysis of expression Christian Schmidt wrote: Hello, we are using IronPython embedded into our application to evaluate user defined expression

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Jonathan Hartley
Of Michael Foord Sent: Monday, October 19, 2009 4:21 AM To: Discussion of IronPython Subject: Re: [IronPython] Type analysis of expression Christian Schmidt wrote: Hello, we are using IronPython embedded into our application to evaluate user defined expression. The variables used

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Vernon Cole
Christian: While Python is type agnostic, most databases are pretty fussy about what you feed them. I presume that you need to convert the user's data into a form acceptable to the database. You do not specify what tool you are using to write your results to the database, so I will provide

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Lepisto, Stephen P
...@lists.ironpython.com] On Behalf Of Jonathan Hartley Sent: Monday, October 19, 2009 7:19 AM To: Discussion of IronPython Subject: Re: [IronPython] Type analysis of expression Hey all, Stephen, I infer that Christian can't evaluate the expression yet. (If he could, then deriving the type of the result would

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Jonathan Hartley
: Monday, October 19, 2009 7:19 AM To: Discussion of IronPython Subject: Re: [IronPython] Type analysis of expression Hey all, Stephen, I infer that Christian can't evaluate the expression yet. (If he could, then deriving the type of the result would be trivial) Presumably

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Christian Schmidt
Hi all, thanks for your discussion. Actually I'm having an in-memory table of strongly typed columns. The user can provide per-row (python-)expressions as additional columns. Now if the user wants his result to be exported to a database (e.g. SQL Server or Oracle) I need to set a type for

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Lepisto, Stephen P
of IronPython Subject: Re: [IronPython] Type analysis of expression Hi all, thanks for your discussion. Actually I'm having an in-memory table of strongly typed columns. The user can provide per-row (python-)expressions as additional columns. Now if the user wants his result to be exported

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Vernon Cole
Christian: Maybe I'm missing the point -- are you trying to load data into an existing data table, or to DEFINE a new data table? I was assuming the former, a fairly easy case. If you are trying to create Data Definition Language to create a new table, then you have a real challenge. DDL is not

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Curt Hagenlocher
On Mon, Oct 19, 2009 at 12:12 PM, Christian Schmidt christian2.schm...@gmx.de wrote: When an expression is parsed at runtime, the interpreter also needs to decide which .NET-functions to call. For strongly typed input these functions should normally have typed return values... Wouldn't this