bug#13485: wrong warning for format ~!

2013-01-18 Thread Daniel Llorens

In 2.0.7

scheme@(guile-user)> (import (ice-9 format))
scheme@(guile-user)> (format #t "~!")
;;; :2:0: warning: "~!": wrong number of `format' arguments: expected 1, 
got 0
$1 = #t
scheme@(guile-user)> (format #t "~!" 3)
$2 = #t
scheme@(guile-user)> (format #t "~!~a" 3 9)  
3$3 = #t
scheme@(guile-user)> (format #t "~a~!" 3 9)  
3$4 = #t
scheme@(guile-user)> (version)
$5 = "2.0.7.28-581f4"

So it doesn't take an argument, it only affects the warning.

Regards,

Daniel




bug#13491:

2013-01-18 Thread David Serafini
Minor bug: in http://www.gnu.org/software/guile/ideas.html, the link
 "Paul Wilson's survey papers on garbage collection"

is dead, and the UT's CS dept. search doesn't have anything for Paul Wilson
although google does find a paper at
http://www.cse.nd.edu/~dthain/courses/cse40243/spring2006/gc-survey.pdf







bug#13485: wrong warning for format ~!

2013-01-18 Thread Ian Price
Daniel Llorens  writes:

> In 2.0.7
>
> scheme@(guile-user)> (import (ice-9 format))
> scheme@(guile-user)> (format #t "~!")
> ;;; :2:0: warning: "~!": wrong number of `format' arguments: expected 
> 1, got 0
> $1 = #t
> scheme@(guile-user)> (format #t "~!" 3)
> $2 = #t
> scheme@(guile-user)> (format #t "~!~a" 3 9)  
> 3$3 = #t
> scheme@(guile-user)> (format #t "~a~!" 3 9)  
> 3$4 = #t
> scheme@(guile-user)> (version)
> $5 = "2.0.7.28-581f4"
>
> So it doesn't take an argument, it only affects the warning.
Okay, I've confirmed this, and as far as I've been able to determine you
are correct. The problem only seems to be with the warning, not format
itself.

In format-string-argument-count in the module
module/language/tree-il/analyze.scm the ~! option gets picked up by the
else case of the loop, which adds one to both the max and minimum number
of parameters. Clearly this is a mistake.

I'm currently looking through the format docs to see if any others are
mishandled, and will post a patch later.


PS. I'm really glad this wasn't a bug in format, since that is one scary
function. :)

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"