Re: [IronPython] Building via AST

2010-04-15 Thread Justin Chase
s for all the help! > > > On Wed, Apr 14, 2010 at 6:21 PM, Dino Viehland wrote: > >> Try calling SetLoc on the FunctionDefinition and also try setting the >> Header property. I think if it’s some reasonable span it’ll work. >> >> >> >> *F

Re: [IronPython] Building via AST

2010-04-15 Thread Justin Chase
om] *On Behalf Of *Justin Chase > *Sent:* Wednesday, April 14, 2010 3:35 PM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Building via AST > > > > Ok awesome! > > > > So now I have: > > dynamic example = globals["Example"]; > >

Re: [IronPython] Building via AST

2010-04-14 Thread Dino Viehland
: Discussion of IronPython Subject: Re: [IronPython] Building via AST Ok awesome! So now I have: dynamic example = globals["Example"]; dynamic instance = example(); Console.WriteLine(instance.Do()); But I'm getting an exception about a line number. Any idea how I can get past that? I&#

Re: [IronPython] Building via AST

2010-04-14 Thread Justin Chase
boun...@lists.ironpython.com] *On Behalf Of *Justin Chase > *Sent:* Wednesday, April 14, 2010 11:24 AM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Building via AST > > > > I feel like I'm so close but something isn't quite working.

Re: [IronPython] Building via AST

2010-04-14 Thread Dino Viehland
script scope and just pull Example out of the globals dictionary as well. From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Justin Chase Sent: Wednesday, April 14, 2010 11:24 AM To: Discussion of IronPython Subject: Re: [IronPython] Building via

Re: [IronPython] Building via AST

2010-04-14 Thread Justin Chase
lass can give you a LanguageContext from the ScriptEngine > for Python which you can cast to a PythonContext. > > > > Let me know if it works! J > > > > *From:* users-boun...@lists.ironpython.com [mailto: > users-boun...@lists.ironpython.com] *On Behalf Of *Justin Chase > *Sen

Re: [IronPython] Building via AST

2010-04-12 Thread Justin Chase
J *From:* users-boun...@lists.ironpython.com [mailto: users-boun...@lists.ironpython.com] *On Behalf Of *Justin Chase *Sent:* Monday, April 12, 2010 4:09 PM To: Discussion of IronPython Subject: Re: [IronPython] Building via AST Ok, so at risk of being a nuissance I have one last question beca

Re: [IronPython] Building via AST

2010-04-12 Thread Dino Viehland
...@lists.ironpython.com] On Behalf Of Justin Chase Sent: Monday, April 12, 2010 4:09 PM To: Discussion of IronPython Subject: Re: [IronPython] Building via AST Ok, so at risk of being a nuissance I have one last question because I feel like I'm half way there. I have the following example that seems to

Re: [IronPython] Building via AST

2010-04-12 Thread Justin Chase
method defined in a PythonType type (which is stored as an instance > field in the object). So while it sucks that we need to generate the IL by > hand it’s small enough that it’s not a big deal. > > > > *From:* users-boun...@lists.ironpython.com [mailto: > users-boun...@lis

Re: [IronPython] Building via AST

2010-04-12 Thread Dino Viehland
: [IronPython] Building via AST Ok so I'm wondering if I'm perhaps using the wrong words to try to say what I mean. Because when I look into the IronPython source code I see a class called Microsoft.Scripting.Generation.TypeGen (http://ironpython.codeplex.com/SourceControl/changeset/

Re: [IronPython] Building via AST

2010-04-12 Thread Justin Chase
mpileToMethod(method); > > type.CreateType(); > > asm.Save("foo.dll"); > > } > > } > > enum Foox { > > Bar, > > Baz > > } > > > > *From:* users-boun...@lists.ironpython.com [mailto: > users-boun...@

Re: [IronPython] Building via AST

2010-04-12 Thread Dino Viehland
.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Justin Chase Sent: Monday, April 12, 2010 1:21 PM To: users@lists.ironpython.com Subject: [IronPython] Building via AST Suppose I would like to build an AST programmatically and compile that into an assembly dynamically (mean

[IronPython] Building via AST

2010-04-12 Thread Justin Chase
Suppose I would like to build an AST programmatically and compile that into an assembly dynamically (meaning an assembly flagged with RunAndCollect) from C#. How would I do that with IronPython's help? I do not what to author Python code and compile that I would like to just deal directly with the