Re: fix for expt bug

2010-11-03 Thread Ramakrishnan Muthukrishnan
Thanks again, Mark and Ludovic. Attached is an updated patch. thanks --   Ramakrishnan From a1dd2da8562ddeb2052f2994ad0302bcc8d5d1a2 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan vu3...@gmail.com Date: Sun, 31 Oct 2010 23:22:52 +0530 Subject: [PATCH] Adding a case for `expt' when

Re: fix for expt bug

2010-11-03 Thread Mark H Weaver
Hi Ramakrishnan, We're almost there, but you neglected one of the comments I made about your previous patch. + /* If base is negative, expt needs to find -x^n = (-1^n) * (x^n). + We find x^n and then if n is odd, we also multiply the result + with -1. These changes apply

Re: fix for expt bug

2010-11-03 Thread Mark H Weaver
Ramakrishnan and others, I just realized that there is a better way to fix these bugs. We don't need a new top-level case in expt after all. Instead, we generalize the scm_integer_expt case to support inexact integer exponents. Within that case, if the exponent is an inexact integer, then we

Re: fix for expt bug

2010-11-03 Thread Ramakrishnan Muthukrishnan
On Wed, Nov 3, 2010 at 9:02 PM, Mark H Weaver m...@netris.org wrote: Hi Ramakrishnan, We're almost there, but you neglected one of the comments I made about your previous patch. Sorry, I should pay more attention. :-( Attaching the modified patch. --   Ramakrishnan From

Re: fix for expt bug

2010-11-03 Thread Ramakrishnan Muthukrishnan
On Wed, Nov 3, 2010 at 9:52 PM, Mark H Weaver m...@netris.org wrote: Ramakrishnan and others, I just realized that there is a better way to fix these bugs.  We don't need a new top-level case in expt after all.  Instead, we generalize the scm_integer_expt case to support inexact integer

Re: fix for expt bug

2010-11-03 Thread Ramakrishnan Muthukrishnan
On Wed, Nov 3, 2010 at 11:23 PM, Ramakrishnan Muthukrishnan vu3...@gmail.com wrote: On Wed, Nov 3, 2010 at 9:52 PM, Mark H Weaver m...@netris.org wrote: Ramakrishnan and others, I just realized that there is a better way to fix these bugs.  We don't need a new top-level case in expt after

Re: The progress of hacking guile and prolog

2010-11-03 Thread Ludovic Courtès
Hi Stefan, Lots of stuff here, which is why I took the time to read it. :-) Stefan Israelsson Tampe stefan.ita...@gmail.com writes: 1. The theorem prover (leanCop) is a nice exercise [...] 2. Kanren is a nice way to program like with prolog, Great that you’re mentioning them. It looks

Re: fix for expt bug

2010-11-03 Thread Ludovic Courtès
Hi Mark, Mark H Weaver m...@netris.org writes: I just realized that there is a better way to fix these bugs. We don't need a new top-level case in expt after all. Instead, we generalize the scm_integer_expt case to support inexact integer exponents. You mean “inexact number”, right? The

Re: The progress of hacking guile and prolog

2010-11-03 Thread Noah Lavine
Hello all, Not to derail the thread of discussion, but I've had an idea for a feature bouncing around that I think might hook into this. I think that Guile should offer optional static checking - not just of types, but of everything that we can check. It could be used partly for optimization, but