On Mon Mar 23 13:09:56 2009, szab...@gmail.com wrote:
> I am not sure if this is a Parrot or Rakudo bug
> or just a plain invalid usage on my side.
> 
> The following code runs, prints the prompt but when I
> enter a response I get a Segmentation fault.
> 
> Gabor
> 
> 
> #!/usr/bin/perl
> use strict;
> use warnings;
> 
> 
> # Needs two environment variables:
> # PARROT_DIR needs to point to the directory where parrot was checked 
out
> # export LD_LIBRARY_PATH=$PARROT_DIR/blib/lib/
> 
> # cwd still needs to be PARROT_DIR or I get the following error:
> #"load_bytecode" couldn't find file 'PCT.pbc'
> #current instr.: '' pc 743 (src/classes/Object.pir:20)
> #called from Sub 'myperl6' pc 3 (EVAL_1:3)
> 
> # Before running I had to build Parrot::Embed:
> # cd $ENV{PARROT_DIR}/ext/Parrot-Embed/
> # perl Build.PL
> # perl Build
> # perl Build test
> 
> 
> die "need PARROT_DIR" if not $ENV{PARROT_DIR};
> unshift @INC, (
>               "$ENV{PARROT_DIR}/ext/Parrot-Embed/blib/lib",
>               "$ENV{PARROT_DIR}/ext/Parrot-Embed/blib/arch",
>               );
>               
> require Parrot::Embed;
> my $interp = Parrot::Interpreter->new;
> 
> my $perl6 =<<"END_PIR";
> .sub myperl6
>         .param string    in_string
>         load_bytecode '$ENV{RAKUDO_DIR}/perl6.pbc'
> 
>         \$P0 = get_hll_global 'prompt'
>         .tailcall \$P0('Enter your name: ')
> .end
> END_PIR
> 
> my $eval = $interp->compile( $perl6 );
> my $foo = $interp->find_global('myperl6');
> my $pmc = $foo->invoke( 'PS', 'say "hello"' );
> print $pmc->get_string(), "\n";

Parrot::Embed is no longer bundled with parrot, so closing this ticket, 
sorry.


-- 
Will "Coke" Coleda

Reply via email to