[MLton-commit] r6530
Vesa Karvonen
vesak at mlton.org
Sun Apr 6 07:08:28 PDT 2008
Another iterator example.
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/eratosthenes.mlb
A mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.mlb
A mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.sml
U mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/pythagoras.mlb
----------------------------------------------------------------------
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/eratosthenes.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/eratosthenes.mlb 2008-04-06 01:33:00 UTC (rev 6529)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/eratosthenes.mlb 2008-04-06 14:08:28 UTC (rev 6530)
@@ -4,6 +4,6 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
-$(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb
+../../basis.mlb
eratosthenes.sml
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.mlb 2008-04-06 01:33:00 UTC (rev 6529)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.mlb 2008-04-06 14:08:28 UTC (rev 6530)
@@ -0,0 +1,9 @@
+(* Copyright (C) 2008 Vesa Karvonen
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+../../basis.mlb
+
+number.sml
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.mlb
___________________________________________________________________
Name: svn:eol-style
+ native
Added: mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.sml 2008-04-06 01:33:00 UTC (rev 6529)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.sml 2008-04-06 14:08:28 UTC (rev 6530)
@@ -0,0 +1,21 @@
+(* Copyright (C) 2008 Vesa Karvonen
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+(**
+ * This is a simple example of using iterator combinators. Given a text
+ * file, this program prints the file to standard output with line
+ * numbers.
+ *)
+
+open Cvt Iter
+
+val () =
+ case CommandLine.arguments ()
+ of [file] =>
+ (index From 1 $ (inTextFile file By lines $))
+ (fn ln & i => prints [D i, ":\t", ln])
+ | _ =>
+ printlns ["Usage: ", OS.Path.file (CommandLine.name ()), " <file>"]
Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/number.sml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/pythagoras.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/pythagoras.mlb 2008-04-06 01:33:00 UTC (rev 6529)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/example/iter/pythagoras.mlb 2008-04-06 14:08:28 UTC (rev 6530)
@@ -4,6 +4,6 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
-$(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb
+../../basis.mlb
pythagoras.sml
More information about the MLton-commit
mailing list