Permalink
Browse files

docs updates; use '.new()' instead of '::Class()' style constructors …

…everywhere
  • Loading branch information...
1 parent 2efef6c commit 0c96ff2140a7495dbfb4d9c7b2c71fa6685719f9 @fglock committed Mar 19, 2010
Showing with 28 additions and 37 deletions.
  1. +5 −3 ChangeLog
  2. +3 −1 README
  3. +6 −12 TODO
  4. +0 −7 doc/miniperl6-spec.pod
  5. +1 −1 lib/MiniPerl6/Eval.pm
  6. +1 −1 t/11-accessor.t
  7. +1 −1 t/11-class-open.t
  8. +1 −1 t/11-class.t
  9. +1 −1 t/11-hyper.t
  10. +1 −1 t/12-match-more.t
  11. +1 −1 t/12-match.t
  12. +7 −7 t/20-eval.t
View
@@ -1,9 +1,11 @@
4.0 (plan)
-- 'Eval' module - implements a MiniPerl6 interpreter in MiniPerl6.
+- Currently supported backends are: Perl5, Javascript, JVM, Lisp, Go
+- New 'Eval.pm' module - implements a MiniPerl6 interpreter in MiniPerl6.
This should add some debugging capabilities later on.
-- New test suite. Added 'prove' how-to to README
-- Supported backends are: Perl5, Javascript, JVM, Lisp, Go
+- New test suite. See README on how to use 'prove' for each backend.
- New compiler options to create binary executables
+- The Go backend updated to the latest Go spec.
+ Small programs work fine, but bigger programs (compiler, eval tests) are unstable.
3.0 2010-01-21
- Go language backend; using Go: http://golang.org
View
4 README
@@ -2,7 +2,7 @@ MiniPerl6 "Perlito" compiler
Go backend
- Compiling to Go currently requires Perl 5:
+ The Go backend is not bootstrapped. Compiling to Go currently requires a Perlito compiler built in Perl5, Lisp, or Javascript:
perl mp6.pl -Bgo t/04-op.t
@@ -13,6 +13,8 @@ Java class backend
perl mp6.pl -Bjava-class -e 'class Main { say "hello, World!" }'
java tmp
+ Creating a bootstrapped compiler, using mp6.pl:
+
perl mp6.pl -v -Bjava-class util/mp6.pl
java tmp -Cjs t/04-op.t
View
18 TODO
@@ -1,14 +1,12 @@
-Eval module
-
-- debug Go
+Eval.pm module
- add exceptions
Command line compiler (mp6.pl)
- implement -Clisp-bin (requires some changes in the lisp emitter)
-Command line compiler (util/mp6)
+Command line compiler (util/mp6.pl)
- build Ast cache using JSON (we currently use Perl5 Data::Dumper) or XML (Go has XML and JSON input)
@@ -18,16 +16,14 @@ Command line compiler (util/mp6)
- does it need a config file? (lib location, make details)
-- debug Go
+- add '-B' option (execute)
MiniPerl6 in Rakudo
- Rakudo should be able to execute MiniPerl6 directly. What do we need to fix in both sides?
MiniPerl6 in Lisp
-- implement command line switches '-C' and '-B' (use util/mp6)
-
- fix warnings
MiniPerl6 in Go
@@ -38,8 +34,7 @@ MiniPerl6 in Go
MiniPerl6 in Perl5
-- generate 'my' variables for subroutine signatures;
- currently depends on autovivification
+(no issues at the moment)
MiniPerl6 in Parrot
@@ -51,7 +46,7 @@ Missing Backends
- Haskell
-- MO in MP6 (MP6-2)
+- MO in MP6
- Python
@@ -67,7 +62,7 @@ Missing Features
- autoquote hash keys - FIXED
-- double quote interpolation
+- double quote variable and expression interpolation
- operator precedence
@@ -96,4 +91,3 @@ Nice to Have
- run some tests from the standard test suite
-
View
@@ -111,14 +111,7 @@ MiniPer6 specification
macro statement_control:<is> {...}
update:
-Implementation-specific limitations in the Perl5 backend:
-
- - uses "no strict vars" inside subs and methods, because it currently depends on
- autovivification of the parameter list variables
-
-update:
Implementation-specific limitations in the Parrot backend:
- 'for' variables need to be predeclared
- blocks do not create a new lexical pad
- - variables should never be re-declared (infinite loop in Parrot 0.4.7 release)
View
@@ -365,7 +365,7 @@ class Sub {
push( @param_name, $field.plain_name );
}
my $sub :=
- ::EvalFunction(
+ EvalFunction.new(
func => sub ( $env, $args ) {
my %context;
my $n := 0;
View
@@ -10,7 +10,7 @@ class Main {
say '1..3';
say 'ok 1 - load ok';
- my $other := ::Other( a => 2 );
+ my $other := Other.new( a => 2 );
$other.subr();
$other.a := 3;
View
@@ -12,7 +12,7 @@ class Main {
say '1..2';
- my $other := ::Other();
+ my $other := Other.new();
my $x := 0;
$x := $other.subr( 1, 2 );
View
@@ -10,7 +10,7 @@ class Main {
say '1..2';
- my $other := ::Other();
+ my $other := Other.new();
my $x := 0;
$x := $other.subr( 1, 2 );
View
@@ -13,7 +13,7 @@ class Main {
say '1..3';
say 'ok 1 - load ok';
- my $other := [ ::Other( a => 2 ), ::Other( a => 3 ) ];
+ my $other := [ Other.new( a => 2 ), Other.new( a => 3 ) ];
my @r := $other.>>subr();
say '# [', @r, ']';
View
@@ -2,7 +2,7 @@ use v6;
class Main {
say '1..2';
- my $m := ::MiniPerl6::Match( str => 'abcdef', from => 2, to => 4, bool => 1 );
+ my $m := MiniPerl6::Match.new( str => 'abcdef', from => 2, to => 4, bool => 1 );
# say 'match scalar: ', $$m;
if ($$m) eq 'cd' {
say 'ok 1';
View
@@ -2,7 +2,7 @@ use v6;
class Main {
say '1..2';
- my $m := ::MiniPerl6::Match( str => 'abcdef', from => 2, to => 4, bool => 1 );
+ my $m := MiniPerl6::Match.new( str => 'abcdef', from => 2, to => 4, bool => 1 );
say '# match scalar: ', $$m;
if ($$m) eq 'cd' {
say 'ok 1';
View
@@ -14,15 +14,15 @@ class Main {
my $env :=
[
{
- 'print' => ::EvalFunction(
+ 'print' => EvalFunction.new(
func => sub ( $env, $args ) {
for @($args) -> $v {
print $v.eval($env);
}
return 1;
},
),
- 'say' => ::EvalFunction(
+ 'say' => EvalFunction.new(
func => sub ( $env, $args ) {
for @($args) -> $v {
print $v.eval($env);
@@ -31,31 +31,31 @@ class Main {
return 1;
},
),
- 'infix:<+>' => ::EvalFunction(
+ 'infix:<+>' => EvalFunction.new(
func => sub ( $env, $args ) {
($args[0]).eval($env) + ($args[1]).eval($env)
},
),
- 'infix:<==>' => ::EvalFunction(
+ 'infix:<==>' => EvalFunction.new(
func => sub ( $env, $args ) {
($args[0]).eval($env) == ($args[1]).eval($env)
},
),
}
];
- my $m := ::Val::Num( num => 123 );
+ my $m := Val::Num.new( num => 123 );
if ($m.eval) eq 123 {
say 'ok 1';
}
else {
say 'not ok 1';
}
- $m := ::Apply(
+ $m := Apply.new(
code => 'say',
namespace => '',
- arguments => [ ::Val::Buf( buf => '# ok eval-ast' ) ],
+ arguments => [ Val::Buf.new( buf => '# ok eval-ast' ) ],
);
$m.eval( $env );

0 comments on commit 0c96ff2

Please sign in to comment.