Perl 6
SMOP Code Implementation: Revision 1

Code is the object responsible for invoking a specific chunk of code inside a specific lexical scope. Every code object has an "outer scope", which may be the file's scope.

In Perl 6, every block is a closure, so the Code object can only be initialized with the proper outer scope that is dinamically defined when the containing block is executed.

Every block also has a Signature, the default block signature is ($_ is rw = OUTER::<$_>), as discussed in SMOP Lexical Scope Implementation.

The current implementation of block uses mold as the "source code".

Modelling

This is the structure of the Code object.

class Code {
  has $.outer;
  has $.signature = :($_ is rw = OUTER::<$_>);
  has Mold $.mold;
  method postcircumfix:<()> ($invocation_capture) {
    my $inner_scope = LexicaScope.new();
    $inner_scope.outer = $.outer;
    $.signature.BIND($invocation_capture, $inner_scope);
    my $frame = MoldFrame.new($.mold);
    $frame.set_reg(0, $inner_scope);
    $frame();
  }
}

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: