From: Albert G. <Dr....@t-...> - 2008-08-19 07:08:30
|
Ryan Schmidt wrote: >> Can you please send me the output of this command: >> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff >> test/prelude.log - > > No output! Hmm, that's how it's supposed to be. But still 'make check' fails? What does the following command print? DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff test/prelude.log -; echo $? (That should print just the exit code '0' if everything is all right.) > Separately: I tested on Tiger. There, prelude.pure and all other tests > pass, except test017.pure which fails. I deleted test017.log and ran > "make logs", and test017.log is different; attached. Yeah, apparently CLOCKS_PER_SEC differs from the usual value on some Apple systems. Should be fixed in r537. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-19 08:37:54
|
On Aug 19, 2008, at 02:09, Albert Graef wrote: >>> Can you please send me the output of this command: >>> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | >>> diff >>> test/prelude.log - >> >> No output! > > Hmm, that's how it's supposed to be. But still 'make check' fails? > What > does the following command print? > > DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff > test/prelude.log -; echo $? > > (That should print just the exit code '0' if everything is all right.) It does print 0. Perhaps this output is helpful: $ DYLD_LIBRARY_PATH=. PURELIB=./lib ./pure -v7 ./lib/prelude.pure 2>&1 | diff -u - ./test/prelude.log --- - 2008-08-19 03:34:56.000000000 -0500 +++ ./test/prelude.log 2008-08-19 03:25:20.000000000 -0500 @@ -1,4 +1,4 @@ -./lib/prelude.pure:70.0-23: symbol 'false' is already defined as a constant +const false,true = 0,1; f/*0:01*/$x/*0:1*/ = f/*0:01*/ x/*0:1*/; (f/*0:001*/.g/*0:01*/) x/*0:1*/ = f/*0:001*/ (g/*0:01*/ x/*0:1*/); void _/*0:1*/ = (); $ On Leopard, the -n flag is not passed to pure, I suppose because $ (ECHO_N) is empty, which was done to begin to fix the problem of the string "-n" being output during the testing and the result (passed or FAILED) being printed on the next line. The first part ("-n" being printed out) has been fixed, the second (the result going to the second line) has not. >> Separately: I tested on Tiger. There, prelude.pure and all other >> tests >> pass, except test017.pure which fails. I deleted test017.log and ran >> "make logs", and test017.log is different; attached. > > Yeah, apparently CLOCKS_PER_SEC differs from the usual value on some > Apple systems. Should be fixed in r537. Is fixed, thanks! Something else: I'm noticing that I cannot cancel the "make check" by pressing ^C. It just causes the currently-running test to fail, and proceeds with the next test. |
From: Albert G. <Dr....@t-...> - 2008-08-19 10:19:23
|
Ryan Schmidt wrote: >> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | diff >> test/prelude.log -; echo $? >> >> (That should print just the exit code '0' if everything is all right.) > > It does print 0. Then everything should be all right and make check should work ok, too (all make check does is in fact checking the return code of that diff command). I'm beginning to suspect that ./pure might pick up an old installed libpure.dylib from somewhere. Can you please run 'sudo make uninstall', verify that all libpure's have been exorcised from your system and recheck? > Perhaps this output is helpful: > > $ DYLD_LIBRARY_PATH=. PURELIB=./lib ./pure -v7 ./lib/prelude.pure > 2>&1 | diff -u - ./test/prelude.log That won't work. You need to pass -n before -v7 there. > The first part ("-n" being > printed out) has been fixed, the second (the result going to the > second line) has not. Hmm, I'll probably have to append that \c thingy, too. Will see what I can do. > Something else: I'm noticing that I cannot cancel the "make check" by > pressing ^C. It just causes the currently-running test to fail, and > proceeds with the next test. Right. But you can kill the make process. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-19 10:57:50
|
On Aug 19, 2008, at 05:20, Albert Graef wrote: > Ryan Schmidt wrote: >>> DYLD_LIBRARY_PATH=. PURELIB=lib ./pure -n -v7 lib/prelude.pure | >>> diff >>> test/prelude.log -; echo $? >>> >>> (That should print just the exit code '0' if everything is all >>> right.) >> >> It does print 0. > > Then everything should be all right and make check should work ok, too > (all make check does is in fact checking the return code of that diff > command). > > I'm beginning to suspect that ./pure might pick up an old installed > libpure.dylib from somewhere. Can you please run 'sudo make > uninstall', > verify that all libpure's have been exorcised from your system and > recheck? No, that's not it: >> Perhaps this output is helpful: >> >> $ DYLD_LIBRARY_PATH=. PURELIB=./lib ./pure -v7 ./lib/prelude.pure >> 2>&1 | diff -u - ./test/prelude.log > > That won't work. You need to pass -n before -v7 there. You're not passing -n before -v7. You're passing $(ECHO_N), and you've set $(ECHO_N) to empty on Leopard. But I don't think you should: >> The first part ("-n" being >> printed out) has been fixed, the second (the result going to the >> second line) has not. > > Hmm, I'll probably have to append that \c thingy, too. Will see what I > can do. I don't know about this "\c" thing. The issue is that "echo -n" on Leopard works, by design, in bash but not in sh. And your Makefile sets SHELL=/bin/sh. If I set $(ECHO_N) to "-n" and SHELL to /bin/bash the printing works correctly. Or you could call /bin/echo -n instead of echo -n, but I think setting SHELL to bash if bash is available is the proper solution. Here is the documentation on echo in Leopard: http://developer.apple.com/releasenotes/Darwin/RN-Unix03Conformance/ index.html#//apple_ref/doc/uid/TP40004772-DontLinkElementID_5 |
From: Albert G. <Dr....@t-...> - 2008-08-19 11:52:07
|
Ryan Schmidt wrote: > You're not passing -n before -v7. You're passing $(ECHO_N), and > you've set $(ECHO_N) to empty on Leopard. But I don't think you should: Rrright. Counting 2+2=5, it just dawned on me, too. ;-) Silly editing blunder! Of course that's supposed to be a -n there, but apparently I just did a global s/-n/$(ECHO_N)/ when "fixing" the Makefile for the Leopard shell. Aaahrgh, I can't tell you how silly I feel now... Ok, this should be fixed now, along with the missing $(ECHO_C) thing. Can you please give it another go? Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-08-19 12:22:08
|
On Aug 19, 2008, at 06:52, Albert Graef wrote: > Ryan Schmidt wrote: >> You're not passing -n before -v7. You're passing $(ECHO_N), and >> you've set $(ECHO_N) to empty on Leopard. But I don't think you >> should: > > Rrright. Counting 2+2=5, it just dawned on me, too. ;-) Silly editing > blunder! Of course that's supposed to be a -n there, but apparently I > just did a global s/-n/$(ECHO_N)/ when "fixing" the Makefile for the > Leopard shell. That's how it seemed to me too! :) > Aaahrgh, I can't tell you how silly I feel now... > > Ok, this should be fixed now, along with the missing $(ECHO_C) thing. > Can you please give it another go? It is considerably less silly now, and in fact all tests pass on Tiger and Leopard and the make check output is formatted correctly on both. Long live $(ECHO_C)! Thanks for fixing this. I updated the pure-devel port in MacPorts to r543. |
From: Eddie R. <er...@bm...> - 2008-08-18 13:29:32
|
Should the rule a%b = a if b == 1 || b == 1L; be added to math.pure or should this be defined by the user? e.r. On Mon, 2008-08-18 at 08:02 -0500, Eddie Rucker wrote: > On Mon, 2008-08-18 at 14:08 +0200, Albert Graef wrote: > > Albert Graef wrote: > > > - The discussion I had with Libor about how to implement a sequencing > > > operator ("first x, then y") also kept me thinking, because the solution > > > I proposed there is not tail-recursive. To do this in a proper way, we'd > > > need a built-in sequencing operator (special form). While it's not > > > strictly needed, it's much more convenient than having to write 'y when > > > _ = x end' all the time. > > > > This is now implemented as well. ($$ operator) > > > > I'm basically through with my 0.5 TODO list now (Windows port > > notwithstanding; I can hopefully take a look at that later today). So if > > anyone is still listening, it would be nice if you could take the latest > > svn for a test drive. ;-) > > > > I also vaguely recall that someone volunteered to write a little test > > module for math.pure, or did I just dream that up? :) > > Was that me? I'll see what I can do ASAP. > > e.r. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > pure-lang-users mailing list > pur...@li... > https://lists.sourceforge.net/lists/listinfo/pure-lang-users |
From: Albert G. <Dr....@t-...> - 2008-08-18 16:50:14
|
Eddie Rucker wrote: > Should the rule > > a%b = a if b == 1 || b == 1L; > > be added to math.pure or should this be defined by the user? That's not how it's supposed to work. % should always return rationals for any combination of integer and rational arguments. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Eddie R. <er...@bm...> - 2008-08-18 13:43:14
|
IMHO, the following rules should be added for pow: pow n::int (x%y) | pow n::bigint (x%y) | pow n::double (x%y) = pow n (x/y); So that > pow 16 (1%2); 4.0 instead of the current > pow 16 (1%2); pow 16 (1L%2L) e.r. On Mon, 2008-08-18 at 08:29 -0500, Eddie Rucker wrote: > Should the rule > > a%b = a if b == 1 || b == 1L; > > be added to math.pure or should this be defined by the user? > > e.r. > > On Mon, 2008-08-18 at 08:02 -0500, Eddie Rucker wrote: > > On Mon, 2008-08-18 at 14:08 +0200, Albert Graef wrote: > > > Albert Graef wrote: > > > > - The discussion I had with Libor about how to implement a sequencing > > > > operator ("first x, then y") also kept me thinking, because the solution > > > > I proposed there is not tail-recursive. To do this in a proper way, we'd > > > > need a built-in sequencing operator (special form). While it's not > > > > strictly needed, it's much more convenient than having to write 'y when > > > > _ = x end' all the time. > > > > > > This is now implemented as well. ($$ operator) > > > > > > I'm basically through with my 0.5 TODO list now (Windows port > > > notwithstanding; I can hopefully take a look at that later today). So if > > > anyone is still listening, it would be nice if you could take the latest > > > svn for a test drive. ;-) > > > > > > I also vaguely recall that someone volunteered to write a little test > > > module for math.pure, or did I just dream that up? :) > > > > Was that me? I'll see what I can do ASAP. > > > > e.r. > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > > Build the coolest Linux based applications with Moblin SDK & win great prizes > > Grand prize is a trip for two to an Open Source event anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > pure-lang-users mailing list > > pur...@li... > > https://lists.sourceforge.net/lists/listinfo/pure-lang-users > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > pure-lang-users mailing list > pur...@li... > https://lists.sourceforge.net/lists/listinfo/pure-lang-users |
From: Eddie R. <er...@bm...> - 2008-08-18 13:46:56
|
On Mon, 2008-08-18 at 08:43 -0500, Eddie Rucker wrote: > IMHO, the following rules should be added for pow: > > pow n::int (x%y) | > pow n::bigint (x%y) | > pow n::double (x%y) = pow n (x/y); > > So that > > pow 16 (1%2); > 4.0 > > instead of the current > > pow 16 (1%2); > pow 16 (1L%2L) > Forgot to mention the reason: > 15^(-1%2); 3.87298334620742 > pow 15 (1%2); pow 15 (1L%2L) should be consistent. e.r. |
From: Albert G. <Dr....@t-...> - 2008-08-18 17:05:31
|
Eddie Rucker wrote: >> pow n::int (x%y) | >> pow n::bigint (x%y) | >> pow n::double (x%y) = pow n (x/y); Hmm, there's a reason that we have both ^ and pow, they're not the same. In Q, pow started out as a wrapper for the GMP bigint power function. The idea was to have a function that handles all the cases where exact powers can be computed. Unfortunately, when I ported that definition over to Pure, for some reason I decided that pow should also wrap the C pow function, maybe that was a mistake... I'll have to think about this. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Eddie R. <er...@bm...> - 2008-08-18 14:59:55
|
On Mon, 2008-08-18 at 09:56 -0500, Eddie Rucker wrote: > Something bad is happening here for the complex numbers: > > > sqrt (1+:2); > 2.23606797749979*cos (t/2)+:2.23606797749979*sin (t/2) > > the angle t is missing. > > Another nice way of doing this is: > > sqrt (x+:y) = sqrt (0.5*(r+a)) +: sqrt (0.5*(r-a)) > when > r = sqrt x*x+y*y; > end; > > e.r. Oops. That r should be r = sqrt (x*x+y*y). I have to go to a Faculty Advising workshop now. Will return soon I hope. e.r. |
From: Albert G. <Dr....@t-...> - 2008-08-19 08:10:14
|
Hi all, in addition to the changes originally proposed, I also renamed the 'def' keyword in constant definitions to 'const' now, as Eddie originally suggested. The reason is that I soon want to use the 'def' keyword (which is still reserved) for macro definitions. Scripts and syntax highlighting files have been updated accordingly. (Libor, I updated your dates.pure example as well.) These changes are implemented in r539 (a rather big changeset since many source files were touched), updated documentation will follow in the next revision. Sorry for the short notice, I really want to get Pure 0.5 out of the door asap... Cheers, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |