Changeset 6738

Show
Ignore:
Timestamp:
09/05/05 20:21:17 (3 years ago)
Author:
iblech
Message:

* Usual svn props.
* All examples/ which are tested in t/examples/examples.t:

Added remaining reminders to update examples.t and examples/output.

* New examples/output/algorithms/lambda-calculus:

example.t tests the output of dankogai++'s lambda-calculus.p6 now.

* pugs::hack: Added the settings needed to make <Tab> indent by four spaces in

Vim, dduncan++, can somebody add the appropriate settings for emacs?

Files:
1 added
14 modified

Legend:

Unmodified
Added
Removed
  • examples/algorithms/hanoi.p6

    r4521 r6738  
    44 
    55# 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 
    711sub hanoi ($a,$b,$s,$d) { 
    812   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 
    12# 
    23# $Id: lambda-calculus.p6,v 0.1 2005/09/05 12:16:18 dankogai Exp dankogai $ 
    34# 
     5# Please remember to update t/examples/examples.t and rename 
     6# examples/output/algorithms/lambda-calculus if you rename/move this file. 
    47 
    58use v6; 
     
    811 
    912Message-Id: <A77477E9-C139-48D2-86C2-CE60842FA659@dan.co.jp> 
     13    http://www.nntp.perl.org/group/perl.perl6.language/22991 
     14 
    1015Message-Id: <20050905061111.GA25085@aut.dyndns.org> 
     16    http://www.nntp.perl.org/group/perl.perl6.language/22992 
    1117 
    1218=cut 
     
    2329our $MULT = sub($m){ sub($n){ sub($f){ $m.($n.($f)) }}}; 
    2430our $POW  = sub($m){ sub($n){ $n.($m) }}; 
     31 
     32=for alternative 
     33 
     34our $ZERO = -> $f { -> $x { $x } }; 
     35our $SUCC = -> $n { -> $f { -> $x { $f.($n.($f)($x)) }}}; 
     36# ... 
     37 
     38=cut 
    2539 
    2640sub num2int($n){ $n.(sub($i){ 1 + $i })(0) } 
  • examples/algorithms/quicksort.p6

    r5502 r6738  
    11#!/usr/bin/pugs 
    22use v6; 
     3 
     4# Please remember to update t/examples/examples.t and rename 
     5# examples/output/algorithms/quicksort if you rename/move this file. 
    36 
    47multi quicksort ( ) { () } 
  • examples/functional/fp.p6

    r3174 r6738  
    55# mimic the pattern matching style of functional programming 
    66# languages.  
     7 
     8# Please remember to update t/examples/examples.t and rename 
     9# examples/output/functional/fp if you rename/move this file. 
    710 
    811multi sub length ()          returns Int { 0               } 
  • examples/junctions/1.p6

    r3174 r6738  
     1#!/usr/bin/pugs 
     2 
     3use 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 
    18my @color = qw(red green blue); 
    29 
  • examples/junctions/3.p6

    r3174 r6738  
     1#!/usr/bin/pugs 
     2 
     3use 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 
    18my @oldval  = (5, 8, 12); 
    29my @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 
    32 
    4 my @atlantic   = qw(400 420 300 211); 
     3use 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 
     8my @pacific  = qw(800 720 600 511); 
     9@pacific     = qw(715 550 411); 
     10 
     11my @atlantic = qw(400 420 300 211); 
    512 
    613if (all(@pacific) > all(@atlantic)) { 
  • examples/junctions/all-any.p6

    r3174 r6738  
     1#!/usr/bin/pugs 
     2 
     3use 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 
    18my @new_data   = qw(100 90 70); 
    29my @old_data   = qw(55 35 5); 
  • examples/junctions/any-any.p6

    r3174 r6738  
     1#!/usr/bin/pugs 
     2 
     3use 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 
    18# any compared with any 
    29 
  • examples/junctions/any-any2.p6

    r3174 r6738  
     1#!/usr/bin/pugs 
     2 
     3use 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 
    18# any compared with any - example 2 
    29 
  • examples/junctions/grades.p6

    r3174 r6738  
     1#!/usr/bin/pugs 
     2 
     3use 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 
    18my $threshold = 70; 
    29 
  • lib/pugs/hack.pod

    r6689 r6738  
    280280tabs, so the code and documentation looks the same to everyone. 
    281281 
     282If use use Vim, you may want to set the following settings: 
     283 
     284    set shiftwidth=4 autoindent expandtab smarttab softtabstop=1 
     285 
     286This will cause Vim to insert four spaces instead of a real tab upon pressing 
     287C<< <Tab> >>. 
     288 
    282289=head2 Testing 
    283290 
  • 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  
    99 
    1010This loads some of the scripts of the examples/ dir and compares their output 
    11 with a expected output. 
     11with the expected output (stored in examples/output/). 
    1212 
    1313=cut 
     
    1515my @examples = < 
    1616  functional/fp functional/reverse 
    17   algorithms/hanoi algorithms/quicksort 
     17  algorithms/hanoi algorithms/quicksort algorithms/lambda-calculus 
    1818  junctions/1 junctions/3 junctions/all-all junctions/all-any junctions/any-any 
    1919  junctions/any-any2 junctions/grades