Re: [IronPython] Warning CS3006

2008-10-10 Thread Dino Viehland
It sure looks like it - are there more though? I'd expect one for each action kind. The methods differ in generic arity and the type of array they accept so at the very least the error string is wrong even if it is bad style to differ that way. -Original Message- From: [EMAIL

Re: [IronPython] Warning CS3006

2008-10-10 Thread Seo Sanghyeon
2008/10/11 Dino Viehland [EMAIL PROTECTED]: It sure looks like it - are there more though? I'd expect one for each action kind. The methods differ in generic arity and the type of array they accept so at the very least the error string is wrong even if it is bad style to differ that way.

Re: [IronPython] Warning CS3006

2008-10-10 Thread Dino Viehland
Oh, that makes sense... The warning is certainly hard to understand but we should probably not do that :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seo Sanghyeon Sent: Friday, October 10, 2008 11:18 AM To: Discussion of IronPython Subject: Re:

[IronPython] Can I pre-add namespaces?

2008-10-10 Thread Marty Nelson
I know I can load assemblies into the script runtime, but how can I add the imports into the scope programmatically? I'm trying to avoid forcing people to write things like imports System for scripts. Microsoft.Scripting.Actions.NamespaceTracker seems to be involved, but it isn't there till

Re: [IronPython] Can I pre-add namespaces?

2008-10-10 Thread Dino Viehland
I think if you're not replacing Globals on the script runtime you can fetch the namespace from the ScriptRuntime.Globals scope. If that doesn't work for some reason you can always new up a TopNamespaceTracker, load assemblies into it, and get the namespace trackers from it. You'll need to get

Re: [IronPython] Can I pre-add namespaces?

2008-10-10 Thread Marty Nelson
Maybe it would it be easier just to append it to the text prior to execution. It didn't appear to have a side effect. Any performance considerations? ScriptSource scriptSource = engine.CreateScriptSourceFromString( import System\r\n + script, SourceCodeKind.Statements);

Re: [IronPython] Can I pre-add namespaces?

2008-10-10 Thread Dino Viehland
That seems like a good solution, the perf should be fine. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marty Nelson Sent: Friday, October 10, 2008 1:38 PM To: Discussion of IronPython Subject: Re: [IronPython] Can I pre-add namespaces? Maybe it would it be easier just to append

Re: [IronPython] Can I pre-add namespaces?

2008-10-10 Thread Marty Nelson
Except when I start including from x import * type statements, I start getting hundreds and hundres of variables. The following doesn't seem to work though. I am probably not understanding runtime.Globals: ScriptRuntime runtime = Python.CreateRuntime();

Re: [IronPython] Can I pre-add namespaces?

2008-10-10 Thread Dino Viehland
I was thinking more of just runtime.Globals.TryGetVariable() and then injecting the object you get there into the scope you'll run the code against. From x import * will tend to pollute your namespace and therefore isn't that great (it also makes it harder when reading the code to know where

Re: [IronPython] Can I pre-add namespaces?

2008-10-10 Thread Leo Carbajal
Would it be possible to use scriptSource.IncludeFile(path) instead to get the same effect? I was perusing the hostingAPI and the Runtime has a whole paragraph for UseFile but when you look at the class declaration (again on the hostingAPI doc) it's not listed there, so I'm not sure if that's just

Re: [IronPython] Can I pre-add namespaces?

2008-10-10 Thread Dino Viehland
UseFile is about just running a piece of code that lives somewhere the language can find (on sys.path for Python) and returning the new ScriptScope that it was executed in - it doesn't do anything with namespaces so it won't help here. It's supposed to be an easy way to just run some one-off

Re: [IronPython] What happened to source drops?

2008-10-10 Thread Dave Fugate
The sources have just been updated and I believe this includes the changes you wanted. Dave -Original Message- From: Dave Fugate Sent: Wednesday, October 01, 2008 8:52 AM To: Discussion of IronPython Subject: RE: [IronPython] What happened to source drops? My best guess is the fixes