Neil Jerram | 3 Aug 2008 01:24

Re: rationalize returns inexact results.

2008/7/26 Anye Li <li.anye.0 <at> gmail.com>:
> Even if it is not a bug that rationalize returns inexact results (surprising
> and useless as they may be to me), I believe it is still a bug that (help
> rationalize) says "Return an exact number..." when in fact it does not.

Agreed.  I'm just fixing this now, to make (help rationalize) say the
same as the Guile manual says:

Returns the  <at> emph{simplest} rational number differing
from  <at> var{x} by no more than  <at> var{eps}.

As required by  <at> acronym{R5RS},  <at> code{rationalize} only returns an
exact result when both its arguments are exact.  Thus, you might need
to use  <at> code{inexact->exact} on the arguments.

 <at> lisp
(rationalize (inexact->exact 1.2) 1/100)
 <at> result{} 6/5

Regards,
       Neil

Martin Pitt | 6 Aug 2008 13:51
Picon

[bug #24009] does not check for short write()s


URL:
  <http://savannah.gnu.org/bugs/?24009>

                 Summary: does not check for short write()s
                 Project: Guile
            Submitted by: martinpitt
            Submitted on: Mittwoch 06.08.2008 um 11:51
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

When building guile under current ubuntu (gcc-4.3, with FORTIFY_SOURCE=2), it
detects a lot of cases where write() is called without checking the return
value:

/bin/bash ../libtool --tag=CC   --mode=compile i486-linux-gnu-gcc
-DHAVE_CONFIG_H  -I.. -I.. -I..   -pthread -O2 -g -Wall -Wmissing-prototypes
-Werror -MT libguile_la-async.lo -MD -MP -MF .deps/libguile_la-async.Tpo -c -o
libguile_la-async.lo `test -f 'async.c' || echo './'`async.c
 i486-linux-gnu-gcc -DHAVE_CONFIG_H -I.. -I.. -I.. -pthread -O2 -g -Wall
(Continue reading)

Martin Pitt | 6 Aug 2008 15:19
Picon

[bug #17344] Problem compiling guile 1.8.0


Follow-up Comment #2, bug #17344 (project guile):

That patch didn't work for me, I get the same build failure. Completely
removing this part works fine, though, as done in Gentoo:
https://bugs.gentoo.org/show_bug.cgi?id=212723

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?17344>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/

Neil Jerram | 6 Aug 2008 22:08
Picon

[bug #24009] does not check for short write()s


Follow-up Comment #1, bug #24009 (project guile):

Thanks for noticing and reporting this.  I think you are right - at least for
the one in async.c (I haven't checked any others yet), so we'll hopefully get
to fixing this soon.

     Neil

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?24009>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/

Neil Jerram | 8 Aug 2008 23:25

Re: procedure-source inconsistencies

2008/7/22 Gregory Marton <gremio <at> csail.mit.edu>:
> Hi folks,
>
> We're running into an issue where we're trying to associate some information
> about functions by associating the info with their serialized form, which is
> in part their procedure-source.  Unfortunately, the procedure-source changes
> when a function is invoked:
>
> (define (equal-source-after-apply? f)
>   (if (not (equal? (procedure-source f)
>                   (begin (f)
>                          (procedure-source f))))
>       (procedure-source f)
>       #t))
>
> (equal-source-after-apply? (lambda () (let ((x 3)) x)))
> ;; before: (lambda () (let ((x 3)) x))
> ;;  after: (lambda () (let* ((x 3)) x))
> (equal-source-after-apply? (lambda () '#:g))
> ;; before: (lambda () (quote #:g))
> ;;  after: (lambda () (begin #:g))

Do you have to use the procedure source as your assoc key?  Why not
use the procedure itself?

> I can imagine one solution to be remembering the actual source somewhere
> instead of regenerating it in procedure-source.  That would be great.

I believe the 'copy read-option does that.  i.e. if you do

(Continue reading)

Gregory Marton | 8 Aug 2008 23:36
Picon
Picon
Favicon

Re: procedure-source inconsistencies

Thank you, Neil!

> Do you have to use the procedure source as your assoc key?  Why not
> use the procedure itself?

We have to serialize the procedure-qua-association-key to a file between 
when we set the value and when we'll need it next time.

>> I can imagine one solution to be remembering the actual source somewhere
>> instead of regenerating it in procedure-source.  That would be great.
>
> I believe the 'copy read-option does that.  i.e. if you do
>
> (read-enable 'copy)
>
> Guile will store a copy of the original source, and return that as the
> result of a (procedure-source ...) call.

I hadn't even dared hope it would be that easy.  Thank you.

Grem

--

-- 
------ __ <at>    Gregory A. Marton                http://csail.mit.edu/~gremio/
--- _`\<,_                                                                .
-- (*)/ (*)            #The grappling hooks on to the enemy ship.
~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~

Ludovic Courtès | 11 Aug 2008 11:50
Picon

Re: Guile Logo License

Hello Martin,

Martin Grabmueller <magr <at> cs.tu-berlin.de> writes:

> I have now dual-licensed the artwork on this page:
>
> http://uebb.cs.tu-berlin.de/~magr/guile/guile-logo.en.html
>
> under the GPL/FDL.

This is nice, thanks a lot!

> I plan to assign the copyright to the FSF, but that takes a little
> time as I'm on holidy now.

Good.  Could you please let us know when this is done?

Thanks,
Ludovic.

Bill Schottstaedt | 11 Aug 2008 19:19
Picon

rationalize bug

I hate to report a bug in my own handiwork, but I noticed
this morning, while writing a scheme numerics test suite
(numtst.c in the Snd tools directory), that if the error is
1.0, rationalize rounds the wrong way:

guile> (rationalize 0.1 1.0)
1.0
guile> (rationalize -0.9 1.0)
0.0

Rats.  I'll try to look at libguile/numbers.c soon.

Bill Schottstaedt | 11 Aug 2008 20:15
Picon

(gcd -2) -> -2

guile> (gcd -2)
-2

(or any negative single argument).

Bill Schottstaedt | 11 Aug 2008 23:03
Picon

(< complex) and friends

guile> (< 1.0+1.0i)
#t
guile> (< 2.0 1.0+1.0i)

Backtrace:
In standard input:
   2: 0* [< 2.0 {1.0+1.0i}]

standard input:2:1: In procedure < in expression (< 2.0 1.0+1.0i):
standard input:2:1: Wrong type: 1.0+1.0i
ABORT: (wrong-type-arg)

(Happens also with > <= >=)


Gmane