Not so important, but why the AST is shown twice?
rbx /X:ShowASTs
IronRuby 0.1 on .NET 2.0.50727.1433
Copyright (c) Microsoft Corporation. All rights reserved.
Note that local variables do not work today in the console.
As a workaround, use globals instead (eg $x = 42 instead of x = 42).
1
//
// AST wrapper
//
.codeblock Object wrapper ( global,)() {
.return (RubyOps.RunMain)(
.context,
(Boolean)True,
(Object).block (main #1),
);
}
//
// CODE BLOCK: main (1)
//
.codeblock Object main ()() {
.var RuntimeFlowControl #rfc (Local)
.var Object #self (Local)
.var RubyScope #scope (Local)
{
(.bound #scope) = (RubyOps.GetScope)(
.context,
)
(.bound #rfc) = (RubyOps.GetRfc)(
(.bound #scope),
)
(.bound #self) = (RubyOps.GetSelf)(
(.bound #scope),
)
{
.return 1;
}
}
}
//
// AST wrapper
//
.codeblock Object wrapper ( global,)() {
.return (RubyOps.RunMain)(
.context,
(Boolean)True,
(Object).block (main #1),
);
}
//
// CODE BLOCK: main (1)
//
.codeblock Object main ()() {
.var RuntimeFlowControl #rfc (Local)
.var Object #self (Local)
.var RubyScope #scope (Local)
{
(.bound #scope) = (RubyOps.GetScope)(
.context,
)
(.bound #rfc) = (RubyOps.GetRfc)(
(.bound #scope),
)
(.bound #self) = (RubyOps.GetSelf)(
(.bound #scope),
)
{
.return 1;
}
}
}
=> 1
On Wed, Mar 12, 2008 at 8:47 AM, Ivan Porto C.
[email protected]