[Ironruby-core] Code Review: InitAndScopes6
Tomas Matousek
Tomas.Matousek at microsoft.com
Tue Jan 6 14:16:53 EST 2009
tfpt review "/shelveset:InitAndScopes6;REDMOND\tomat"
Outer-ring DLR changes (Hosting API implementation):
Any code compilation/execution without explicitly given scope should eventually call SourceUnit.Compile overload that creates a new scope for the execution, so that a) the creation of an implicit empty scope is implemented on a single place and b) the language can adjust compilation based upon whether the code is executed against a scope or not (different overloads of LanguageContext.GetCompilerOptions are called).
Adds SourceUnit.Execute overload taking ErrorSink parameter to match Compile overloads.
Ruby changes:
Enables sharing of Ruby top-level binding across multiple executions against the same DLR Scope, which enables local variables in a console implemented via DLR Hosting API.
Refactors control flow handling in rules:
- Methods that build rules are of two kinds: BuildXxxNoFlow and BuildXxx, where the former produces a rule w/o control flow and optionally stores a control flow builder delegate on MetaObjectBuilder if CF handling is needed. The latter calls the former and if there has been a CF builder registered applies it on the resulting meta object. This allows to compose rules w/o CF and then apply CF handling once on the final result.
- Fixes IO#open not to dynamically dispatch to "new". The implementation requires the above rule composition.
Scope cleanup:
- Renames GlobalScopeExtension to RubyGlobalScope.
- Removes unnecessary dependencies on RubyScope where RubyContext is sufficient.
- Replaces uses of Scope where RubyGlobalScope is more suitable.
- Removes RubyContext.DefaultGlobalScope and adds Ruby.RequireFile taking a ScriptScope.
Replaces Booleans on RubyCompilerOptions with an enum.
Fixes method definition in module_eval or define_method.
Adds /py option to unit test driver, which enables tests dependent on IronPython.
Tomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090106/8e3efb20/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InitAndScopes6.diff
Type: application/octet-stream
Size: 140799 bytes
Desc: InitAndScopes6.diff
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090106/8e3efb20/attachment-0001.obj>
More information about the Ironruby-core
mailing list