Changeset 6738
- Timestamp:
- 09/05/05 20:21:17 (3 years ago)
- Files:
-
- 1 added
- 14 modified
-
examples/algorithms/hanoi.p6 (modified) (1 diff)
-
examples/algorithms/lambda-calculus.p6 (modified) (3 diffs, 2 props)
-
examples/algorithms/quicksort.p6 (modified) (1 diff)
-
examples/functional/fp.p6 (modified) (1 diff)
-
examples/junctions/1.p6 (modified) (1 diff)
-
examples/junctions/3.p6 (modified) (1 diff)
-
examples/junctions/all-all.p6 (modified) (1 diff)
-
examples/junctions/all-any.p6 (modified) (1 diff)
-
examples/junctions/any-any.p6 (modified) (1 diff)
-
examples/junctions/any-any2.p6 (modified) (1 diff)
-
examples/junctions/grades.p6 (modified) (1 diff)
-
examples/output/algorithms/lambda-calculus (added)
-
lib/pugs/hack.pod (modified) (1 diff)
-
perl5/Perl6-MetaModel2.0/t/15_submethods.t (modified) (2 props)
-
t/examples/examples.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
examples/algorithms/hanoi.p6
r4521 r6738 4 4 5 5 # Towers of Hanoi 6 # move from tower A to tower B using tower S as the spare 6 7 # Please remember to update t/examples/examples.t and rename 8 # examples/output/algorithms/hanoi if you rename/move this file. 9 10 # move from tower A to tower B using tower S as the spare 7 11 sub hanoi ($a,$b,$s,$d) { 8 12 if $d > 0 { -
examples/algorithms/lambda-calculus.p6
- Property svn:mime-type set to text/plain; charset=UTF-8
- Property svn:eol-style set to native
r6723 r6738 1 #!/usr/bin/pugs 1 2 # 2 3 # $Id: lambda-calculus.p6,v 0.1 2005/09/05 12:16:18 dankogai Exp dankogai $ 3 4 # 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/algorithms/lambda-calculus if you rename/move this file. 4 7 5 8 use v6; … … 8 11 9 12 Message-Id: <A77477E9-C139-48D2-86C2-CE60842FA659@dan.co.jp> 13 http://www.nntp.perl.org/group/perl.perl6.language/22991 14 10 15 Message-Id: <20050905061111.GA25085@aut.dyndns.org> 16 http://www.nntp.perl.org/group/perl.perl6.language/22992 11 17 12 18 =cut … … 23 29 our $MULT = sub($m){ sub($n){ sub($f){ $m.($n.($f)) }}}; 24 30 our $POW = sub($m){ sub($n){ $n.($m) }}; 31 32 =for alternative 33 34 our $ZERO = -> $f { -> $x { $x } }; 35 our $SUCC = -> $n { -> $f { -> $x { $f.($n.($f)($x)) }}}; 36 # ... 37 38 =cut 25 39 26 40 sub num2int($n){ $n.(sub($i){ 1 + $i })(0) } -
examples/algorithms/quicksort.p6
r5502 r6738 1 1 #!/usr/bin/pugs 2 2 use v6; 3 4 # Please remember to update t/examples/examples.t and rename 5 # examples/output/algorithms/quicksort if you rename/move this file. 3 6 4 7 multi quicksort ( ) { () } -
examples/functional/fp.p6
r3174 r6738 5 5 # mimic the pattern matching style of functional programming 6 6 # languages. 7 8 # Please remember to update t/examples/examples.t and rename 9 # examples/output/functional/fp if you rename/move this file. 7 10 8 11 multi sub length () returns Int { 0 } -
examples/junctions/1.p6
r3174 r6738 1 #!/usr/bin/pugs 2 3 use v6; 4 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/junctions/1 if you rename/move this file. 7 1 8 my @color = qw(red green blue); 2 9 -
examples/junctions/3.p6
r3174 r6738 1 #!/usr/bin/pugs 2 3 use v6; 4 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/junctions/3 if you rename/move this file. 7 1 8 my @oldval = (5, 8, 12); 2 9 my @newval1 = (17, 15, 14); -
examples/junctions/all-all.p6
r3174 r6738 1 my @pacific = qw(800 720 600 511); 2 @pacific = qw(715 550 411); 1 #!/usr/bin/pugs 3 2 4 my @atlantic = qw(400 420 300 211); 3 use v6; 4 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/junctions/all-all if you rename/move this file. 7 8 my @pacific = qw(800 720 600 511); 9 @pacific = qw(715 550 411); 10 11 my @atlantic = qw(400 420 300 211); 5 12 6 13 if (all(@pacific) > all(@atlantic)) { -
examples/junctions/all-any.p6
r3174 r6738 1 #!/usr/bin/pugs 2 3 use v6; 4 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/junctions/all-any if you rename/move this file. 7 1 8 my @new_data = qw(100 90 70); 2 9 my @old_data = qw(55 35 5); -
examples/junctions/any-any.p6
r3174 r6738 1 #!/usr/bin/pugs 2 3 use v6; 4 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/junctions/any-any if you rename/move this file. 7 1 8 # any compared with any 2 9 -
examples/junctions/any-any2.p6
r3174 r6738 1 #!/usr/bin/pugs 2 3 use v6; 4 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/junctions/any-any2 if you rename/move this file. 7 1 8 # any compared with any - example 2 2 9 -
examples/junctions/grades.p6
r3174 r6738 1 #!/usr/bin/pugs 2 3 use v6; 4 5 # Please remember to update t/examples/examples.t and rename 6 # examples/output/junctions/grades if you rename/move this file. 7 1 8 my $threshold = 70; 2 9 -
lib/pugs/hack.pod
r6689 r6738 280 280 tabs, so the code and documentation looks the same to everyone. 281 281 282 If use use Vim, you may want to set the following settings: 283 284 set shiftwidth=4 autoindent expandtab smarttab softtabstop=1 285 286 This will cause Vim to insert four spaces instead of a real tab upon pressing 287 C<< <Tab> >>. 288 282 289 =head2 Testing 283 290 -
perl5/Perl6-MetaModel2.0/t/15_submethods.t
- Property svn:mime-type set to text/plain; charset=UTF-8
- Property svn:eol-style set to native
-
t/examples/examples.t
r6639 r6738 9 9 10 10 This loads some of the scripts of the examples/ dir and compares their output 11 with a expected output.11 with the expected output (stored in examples/output/). 12 12 13 13 =cut … … 15 15 my @examples = < 16 16 functional/fp functional/reverse 17 algorithms/hanoi algorithms/quicksort 17 algorithms/hanoi algorithms/quicksort algorithms/lambda-calculus 18 18 junctions/1 junctions/3 junctions/all-all junctions/all-any junctions/any-any 19 19 junctions/any-any2 junctions/grades
