[Ironruby-core] Code Review: InitAndScopes6
John Messerly
jomes at microsoft.com
Tue Jan 6 16:50:15 EST 2009
DLR changes look good too.
From: Curt Hagenlocher
Sent: Tuesday, January 06, 2009 1:41 PM
To: Tomas Matousek; IronRuby External Code Reviewers; DLR Code Reviews
Cc: ironruby-core at rubyforge.org
Subject: RE: Code Review: InitAndScopes6
Awesome! Ruby changes are good (other than a typo "bidning" in a comment in HostingTests.cs :)).
From: Tomas Matousek
Sent: Tuesday, January 06, 2009 11:17 AM
To: IronRuby External Code Reviewers; DLR Code Reviews
Cc: ironruby-core at rubyforge.org
Subject: Code Review: InitAndScopes6
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/d4b702e8/attachment.html>
More information about the Ironruby-core
mailing list