::If(
    cond      => 
       ::Apply(
            arguments => [ ::Proto( name => $node.name ) ],
            code => ::Var( name => 'VAR_defined', twigil => '', sigil => '&', ),
        ),
    body      => '',
    otherwise => 
        ::Lit::Code(
            body => [ 
                ::Bind(
                    'parameters' => ::Proto( name => $node.name ),  
                    'arguments'  => ::Call(
                        'invocant' => $metaobject,
                        'method'   => 'PROTOTYPE',
                        'hyper'    => '',
                    ),
                )
            ],
            sig   =>
              ::Sig( named => {}, invocant => '', positional => [], ),
            pad   => ($node.body).pad,
            state => { },
        ),
);

is written like that with quasi quotes

q:code {
    if (defined {{{::Proto( name => $node.name )}}}) {
    } else {
        {{{::Proto( name => $node.name )}}} := {{{$metaobject}}}.PROTOTYPE;
    }
}

they compile to the same thing


Example of intended use in Token.pm

return 'do { ' ~ 
     'my $ret = self.'~$.closure ~ ';' ~
     'if $ret {' ~
        '$MATCH.result = $ret; ' ~
        'return $MATCH;' ~
     '};' ~
     '1' ~
'}'

return q:code {
    do {
        my $ret = sub { {{{$.closure}}} };
        if $ret {
            $MATCH.result = $ret;
            return $MATCH;
        };
        1;
    }
}
