[pure-lang-svn] SF.net SVN: pure-lang: [427] pure/trunk/examples/libor
Status: Beta
Brought to you by:
agraef
From: <ye...@us...> - 2008-07-09 09:28:28
|
Revision: 427 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=427&view=rev Author: yes Date: 2008-07-09 02:28:37 -0700 (Wed, 09 Jul 2008) Log Message: ----------- fixed 'timex', removed succ and pred from queens.pure, as they are now in prelude.pure Modified Paths: -------------- pure/trunk/examples/libor/date.pure pure/trunk/examples/libor/queens.pure Modified: pure/trunk/examples/libor/date.pure =================================================================== --- pure/trunk/examples/libor/date.pure 2008-07-09 04:06:57 UTC (rev 426) +++ pure/trunk/examples/libor/date.pure 2008-07-09 09:28:37 UTC (rev 427) @@ -27,8 +27,8 @@ /******************************************************************************/ // first a couple of functions generally useful in Pure: -// timer function: (timex (id (foo arg))) returns cputime, value of (foo arg) -timex fn = (clock-t)/CLOCKS_PER_SEC $ res when t = clock; res = fn end; +// Albert Graef's timer function: returns cputime, value of (f onearg) +timex f x = (clock-t0)/CLOCKS_PER_SEC, res when t0 = clock; res = f x end; /* extended mod operator to work on doubles, so that int, bigint and double times can be conveniently used */ Modified: pure/trunk/examples/libor/queens.pure =================================================================== --- pure/trunk/examples/libor/queens.pure 2008-07-09 04:06:57 UTC (rev 426) +++ pure/trunk/examples/libor/queens.pure 2008-07-09 09:28:37 UTC (rev 427) @@ -11,9 +11,6 @@ >tailqueens 8; // gives solution no. 89, which is a reflection of no. 52 >map succ (thequeens 8); // gives solution no. 56 */ -// increment and decrement general utility -succ x::int = 1+x; pred x::int = x-1; - // row j in current column not attacked by any queens in preceding columns? safe _ _ [] = 1; safe id::int j::int (j2::int:l) = // id is the column positions difference This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |