Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[lazy-k]

- Add some links in README
- Add test for cat.lazy


git-svn-id: http://svn.perl.org/parrot/trunk@17181 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 527181848f7a48998a5b69dffdd9c78aea0c122a 1 parent 8f8217b
bernhard authored
Showing with 63 additions and 11 deletions.
  1. +8 −4 README
  2. +1 −1  powers2.lazy
  3. +5 −6 t/calc.t
  4. +49 −0 t/cat.t
View
12 README
@@ -1,17 +1,21 @@
-This is an incomplete implementation of Lazy-k - only 'ski parsing is
+This is an incomplete implementation of Lazy K - only 'ski parsing is
done currently.
Lazy K programs live in the same timeless Platonic realm as mathematical
functions, what the Unlambda page calls "the blessed realm of the pure untyped
lambda calculus."
-There is no special syntax for IO, lazy-k programs get their input (from stdin)
+There is no special syntax for IO, Lazy K programs get their input (from stdin)
as a list of church numerals and create a list of these, which is converted to
8-bit characters as output of the computation, 256 is serving as EOF.
References:
+http://esolangs.org/wiki/Lazy_K
+
http://homepages.cwi.nl/~tromp/cl/lazy-k.html
-http://en.wikipedia.org/wiki/Lazy_K_programming_language
-The 2 example files are copyrighted GPL by the author of Lazy-k.
+There used to be an entry about Lazy K on Wikipedia:
+http://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Lazy_K
+
+The 2 example files are copyrighted GPL by Ben Rudiak-Gould, the author of Lazy K.
View
2  powers2.lazy
@@ -1,4 +1,4 @@
-# print an infinte number of stars representing powers of 2
+# print an infinite number of stars representing powers of 2
`k````sii``s`k`si``s`k`s`k``s`k`s``si`k``s`k``s``s`kski``s``s`ksk```s
ii``s``s`kskik``s``s`ks``s`kk``sii`k``s``s`kski``s`k`s``si`k``s`k``s`
View
11 t/calc.t
@@ -1,14 +1,13 @@
-# Copyright (C) 2005, The Perl Foundation.
+# Copyright (C) 2005-2007, The Perl Foundation.
# $Id$
=head1 NAME
lazy-k/t/calc.t - testing calc.lazy
-
=head1 SYNOPSIS
- % cd languages && perl lazy-k/t/calc.t
+ % cd languages && perl lazy-k/t/calc.t
=head1 DESCRIPTION
@@ -34,16 +33,16 @@ my $is_win32 = $^O eq 'MSWin32';
my $parrot = File::Spec->catfile( File::Spec->updir(), $PConfig{test_prog} );
my $lazy_k = $parrot . q{ } . File::Spec->catfile( 'lazy-k', 'lazy.pir' );
-my $calc_lazy = File::Spec->catfile( 'lazy-k', 'calc.lazy' );
+my $source_fn = File::Spec->catfile( 'lazy-k', 'calc.lazy' );
# XXX This does not look portable.
my $cmd;
if ($is_win32) {
# Don't quote the string on Windows, it is passed on literally
- $cmd = qq{echo 1+2*3 | $lazy_k $calc_lazy};
+ $cmd = qq{echo 1+2*3 | $lazy_k $source_fn};
}
else {
- $cmd = qq{echo '1+2*3' | $lazy_k $calc_lazy};
+ $cmd = qq{echo '1+2*3' | $lazy_k $source_fn};
}
# die Dumper( $cmd );
View
49 t/cat.t
@@ -0,0 +1,49 @@
+# Copyright (C) 2005-2007, The Perl Foundation.
+# $Id$
+
+=head1 NAME
+
+lazy-k/t/cat.t - testing cat.lazy
+
+=head1 SYNOPSIS
+
+ % cd languages && perl lazy-k/t/cat.t
+
+=head1 DESCRIPTION
+
+Test cat.lazy.
+
+=head1 AUTHOR
+
+Bernhard Schmalhofer - C<Bernhard.Schmalhofer@gmx.de>
+
+=cut
+
+use strict;
+use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../../../lib";
+
+use Data::Dumper;
+use Test::More tests => 1;
+use Parrot::Config;
+use File::Spec();
+
+my $is_win32 = $^O eq 'MSWin32';
+
+my $parrot = File::Spec->catfile( File::Spec->updir(), $PConfig{test_prog} );
+my $lazy_k = $parrot . q{ } . File::Spec->catfile( 'lazy-k', 'lazy.pir' );
+my $source_fn = File::Spec->catfile( 'lazy-k', 'cat.lazy' );
+
+# XXX This does not look portable.
+my $cmd;
+if ($is_win32) {
+ # Don't quote the string on Windows, it is passed on literally
+ $cmd = qq{echo 1+2*3 | $lazy_k $source_fn};
+}
+else {
+ $cmd = qq{echo '1+2*3' | $lazy_k $source_fn};
+}
+
+# die Dumper( $cmd );
+is( `$cmd`, "1+2*3\n", 'cat.lazy' );
Please sign in to comment.
Something went wrong with that request. Please try again.