[Mono-dev] Need PutVar method on Mono.CSharp.Evaluator

Charles Rich rich at WPI.EDU
Mon Aug 15 16:04:48 EDT 2011

Thanks again, but Slide has the idea.  I tried to make simplest
example to illustrate the point.  But I cannot use Tom's suggestion
because I don't know which variable (e.g., x) will be used at the time
the original expression is evaluated.   Again, most evaluators let you
update as well as read the context.   I think this is just a matter of
adding an additional method to the API.

Oh, and I did think of the static class variable solution.   That's my fallback.


On Mon, Aug 15, 2011 at 11:59 AM, Tom Spink <tspink at gmail.com> wrote:
> Hi slide,
> On 15 August 2011 16:49, Slide <slide.o.mix at gmail.com> wrote:
>> I think Charles is wondering how he gets his stuff inside the evaluator in
>> the first place. For instance, if he has OUTSIDE the evaluator, some
>> instance of an object, how does he get that object into the evaluator so the
>> evaluator can interact with it. From my experience, there is access to the
>> scope in which the evaluator is created in, I added objects to a "context"
>> object and then grab them out inside the repl code as needed, but is there a
>> better way to do it?
>> Thanks,
>> slide
> Well, his initial sample could be solved the way I suggested.  However, a
> quick Google turned up the following thread, which may be of some use:
> http://stackoverflow.com/questions/3788096/injecting-a-variable-into-the-mono-csharp-evaluator-runtime-compiling-a-linq-que
> --
> Tom Spink

Dr. Charles Rich, Professor of Computer Science
Interactive Media and Game Development
Worcester Polytechnic Institute, Fuller Laboratories B25b
100 Institute Road, Worcester, MA 01609-2280

Email: rich at wpi.edu   Phone: 508-831-5945   Fax: 508-831-5776
Home: http://www.cs.wpi.edu/~rich

More information about the Mono-devel-list mailing list