[pure-lang-svn] SF.net SVN: pure-lang: [406] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-07-07 00:14:00
|
Revision: 406 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=406&view=rev Author: agraef Date: 2008-07-06 17:14:10 -0700 (Sun, 06 Jul 2008) Log Message: ----------- Bugfix in init function. Modified Paths: -------------- pure/trunk/lib/prelude.pure pure/trunk/test/prelude.log Modified: pure/trunk/lib/prelude.pure =================================================================== --- pure/trunk/lib/prelude.pure 2008-07-06 23:58:01 UTC (rev 405) +++ pure/trunk/lib/prelude.pure 2008-07-07 00:14:10 UTC (rev 406) @@ -263,7 +263,7 @@ init [x] = []; init (x:xs) = accum [x] xs with - accum ys [] = reverse ys; + accum ys [x] = reverse ys; accum ys (x:xs) = accum (x:ys) xs; accum ys xs = reverse ys+init xs; end; Modified: pure/trunk/test/prelude.log =================================================================== --- pure/trunk/test/prelude.log 2008-07-06 23:58:01 UTC (rev 405) +++ pure/trunk/test/prelude.log 2008-07-07 00:14:10 UTC (rev 406) @@ -355,37 +355,37 @@ foldr1 f/*0:01*/ (x/*0:101*/:xs/*0:11*/) = f/*0:01*/ x/*0:101*/ (foldl1 (flip f/*0:01*/) (reverse xs/*0:11*/)); head (x/*0:101*/:xs/*0:11*/) = x/*0:101*/; init [x/*0:101*/] = []; -init (x/*0:101*/:xs/*0:11*/) = accum/*0*/ [x/*0:101*/] xs/*0:11*/ with accum ys/*0:01*/ [] = reverse ys/*0:01*/; accum ys/*0:01*/ (x/*0:101*/:xs/*0:11*/) = accum/*1*/ (x/*0:101*/:ys/*0:01*/) xs/*0:11*/; accum ys/*0:01*/ xs/*0:1*/ = reverse ys/*0:01*/+init xs/*0:1*/ { - rule #0: accum ys [] = reverse ys +init (x/*0:101*/:xs/*0:11*/) = accum/*0*/ [x/*0:101*/] xs/*0:11*/ with accum ys/*0:01*/ [x/*0:101*/] = reverse ys/*0:01*/; accum ys/*0:01*/ (x/*0:101*/:xs/*0:11*/) = accum/*1*/ (x/*0:101*/:ys/*0:01*/) xs/*0:11*/; accum ys/*0:01*/ xs/*0:1*/ = reverse ys/*0:01*/+init xs/*0:1*/ { + rule #0: accum ys [x] = reverse ys rule #1: accum ys (x:xs) = accum (x:ys) xs rule #2: accum ys xs = reverse ys+init xs state 0: #0 #1 #2 <var> state 1 state 1: #0 #1 #2 <var> state 2 - [] state 3 - <app> state 4 + <app> state 3 state 2: #2 - state 3: #0 #2 - state 4: #1 #2 + state 3: #0 #1 #2 + <var> state 4 + <app> state 6 + state 4: #2 <var> state 5 - <app> state 7 state 5: #2 - <var> state 6 - state 6: #2 - state 7: #1 #2 + state 6: #0 #1 #2 + <var> state 7 + : state 10 + state 7: #2 <var> state 8 - : state 11 state 8: #2 <var> state 9 state 9: #2 - <var> state 10 - state 10: #2 - state 11: #1 #2 + state 10: #0 #1 #2 + <var> state 11 + state 11: #0 #1 #2 <var> state 12 + [] state 13 state 12: #1 #2 - <var> state 13 - state 13: #1 #2 + state 13: #0 #1 #2 } end; last [x/*0:101*/] = x/*0:101*/; last (x/*0:101*/:xs/*0:11*/) = last xs/*0:11*/; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |