From CSWiki
shell %> + moe.ck larry.ck
shell %> code
chuck %>
int foo;
float bar;
X obj;
int z;
while( true ) : scope mywhileloop
{
int z;
while( true )
{
print z;
100
}
stmt 1;
stmt 2;
...
}
if( ... ) : scope myifstmt
{
int z;
// ...
}
scope( larry )
{
}
scope( moe )
{
}
10 => foo;
obj.dothisnow();
chuck %> 10 => int foo;
chuck %> loop( 8 )
------%> {
------%> print foo;
------%> }
10
10
10
chuck %> 11=>foo;
chuck %> 2 => z;
11
11
11
11
chuck %> push mywhileloop;
chuck %> print scope;
int z;
while( true )
{
print z;
100
}
stmt 1;
stmt 2;
...
chuck %> replace line 1 with "foo => int z";
chuck %> myifstmt.body => mywhileloop.body;
chuck %> 3 => z;
chuck %> print scope.vars();
int z;
chuck %> pop scope;
chuck %> print scope.vars();
int foo;
float bar;
X obj;
int z;
chuck %> print scope.name():