Citát Nicolas Roard <[EMAIL PROTECTED]>: > On 5/26/06, Stefan Urbanek <[EMAIL PROTECTED]> wrote: > > Citát Quentin Mathé <[EMAIL PROTECTED]>: > > > > > Le 25 mai 06 ŕ 12:03, Nicolas Roard a écrit : > > > <snip>
> > > It works very well. Excellent work ! I got it working with StepTalk > > > (GNUstep) properly yesterday. I hacked IoLanguageEngine to have > > > Io_State kept value in an ivar. This way between each call to - > > > interpretScript:inContext: the context is maintained. The correct way > > > to do it would be to store Io_State in STContext instance I think. > > > > > > > How it works? Do you need some language-engine specific configuration to be > > saved into the STContext in a special way (different to context's > variables)? > > If yes, would it be thread safe - when two threads will be acessing the > same > > (parent)context? > > > > Btw. how it is with bridging Objective-C objects with io? Is it only > isolated io > > computation engine or can I pass objects in and out? > > > > Is it possible to implement STEngine createMethod:... for the io language? > > I'm thinking that StepTalk could simply be used as a standard way of > accessing objective-c objects -- eg, for the languages that have a > proper bridge to objc (io, ruby, scheme, gnu smalltalk) do not use the > languages bundles only to execute methods, but let them completely > handles objects. It would be much more efficient than building an OO > architecture with STActor (although this is nice too -- it provides > "one" OO language/architecture where methods can be in any language) > and more importantly it would let people really take advantage of each > language's strength. > (moved to discuss-gnustep only) Well ... "much more efficient than building an OO architecture with STActor " ... it depends on your needs. Neither STActor nor standard script execution is better or worse, both have quite different uses and both can "really take advantage of each language's strength". Actors can have behaviour written in different languages - depending on the needs of each method. Language itself do not have to provide method ceration - script is enough. Howeverm the language engine have to support passing arguments either named or not to the script. If it is not possible to generate method from the language, one of many ways how to create the method can be like the following that is going to be used for NSPredicate based language: valueIsBetween:lowerBound and:upperBound value >= lowerBound && value <= upperBound Engine pre-parses the source, extracts the method name and adds method variables to a method execution contex that is passed then to the engine. Method name is stripped from the method source and rest is passed as a script to the engine. Engine do not have to compile the method, it can only pack source in an object and then execute it as requested... Stefan Urbanek -- http://stefan.agentfarms.net First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi _______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
