chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] (ISBN egg) How is normalize-isbn supposed to be used?


From: Jeronimo Pellegrini
Subject: [Chicken-users] (ISBN egg) How is normalize-isbn supposed to be used?
Date: Mon, 16 May 2011 16:15:53 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

I have installed the isbn egg, and have successfully used
valid-isbn? and isbn->alist. However, I can't seem to get
normalize-isbn, even with strings for which valid-isbn?
return #t:

#;1> (use isbn openlibrary)
...

#;2> (define isbn "8573261854")

#;3> (valid-isbn? isbn)
=> #t

#;4> (isbn->alist isbn '(title authors))
=> ((title . "Memórias do Subsolo") (authors ("Fiodor Dostoievski")))

#;5> (normalize-isbn isbn)

Error: Not a valid length for an isbn: "8573261854"

        Call history:

        isbn#string->isbn         
        string->list      
        g7281     
        g7281     
        g7281     
        g7281     
        g7281     
        g7281     
        g7281     
        g7281     
        g7281     
        g7281     
        fold      
        reverse   
        reverse   
        error           <--

I thought I'd have to convert it to ISBN-13 first, but that didn't
help:

#;6> (isbn10->isbn13 isbn)
=> "978-8-57326-185-1"

#;7> (normalize-isbn "978-8-57326-185-1")

Error: Not a valid length for an isbn: "978-8-57326-185-1"
...

Is it a bug or did I miss something?

Also, is this really supposed to work?

#;2> (valid-isbn? "blah blah 8573261854")
#t

It's actually nice if I'm trying to detect the ISBN within
a line (text converted from PDF, for example), but then
I can't use it as a valid ISBN as input to the other
procedures:

#3;> (isbn->alist "978-0262011532")
=> ((isbn . "978-0262011532") (title . "Structure and interpretation of 
computer programs") (authors ("Harold Abelson and Gerald Jay Sussman, with 
Julie Sussman; foreword by Alan J. Perlis")) (publisher "Cambridge, Mass. : MIT 
Press ; c1996."))

#4;> (isbn->alist "blah blah 978-0262011532")
=> ((isbn . "blah blah 978-0262011532"))

Thanks!
J.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]