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

2011-05-17 Thread Christian Kellermann
Hi Jeronimo,

Thank you for your nice bug report! You have indeed encountered a
bunch of them I hope the experience has not been too discouraging.
To add pain to misery some of the issues you have encountered were
sitting in trunk awaiting a new tag.

So some of your issues are gone now as I have tagged a new version
0.4, please try this one.

* Jeronimo Pellegrini j...@aleph0.info [110516 21:16]:
 #;1 (use isbn openlibrary)
 #;2 (define isbn 8573261854)
 #;3 (valid-isbn? isbn)
 #;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
 
This has been fixed.

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

This will return a normalized form since the dashes are totally
bogus as the isbn egg does not lookup the group identifier or
publisher codes and those are variable length (and can be determined
only with a table).

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

This has been fixed.


 Also, is this really supposed to work?
 
 #;2 (valid-isbn? blah blah 8573261854)
 #t

This is one of the ugliest parts of the egg. Atm it is stupid and
will throw away all non number chars and checks that.

The proper solution would be to parse the input correctly (either
with a regexp or a real parser).  This issue remains unsolved. I
have put it on my list.

However, in the mean time, you could scrub all input that's valid
through normalize:

#;4 (normalize-isbn blah blah 8573261854)
8573261854

normalize itself will check again for validity, so you can rely on
it matching up the pieces.

 
 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:

I am aware that this is still all a bit messy, thanks for your
input! I will tag 0.5 with a more reliable input parsing soon.

Does this help you?

Kind regards,

Christian

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] ANN: FreeTDS egg

2011-05-17 Thread Peter Danenberg
Response Genetics, Inc. [1] funded the development of a FreeTDS egg
for connecting to e.g. MSSQL and Sybase databases:

  http://wiki.call-cc.org/eggref/4/freetds

It's encouraging to see commercial interest in Chicken.


Footnotes: 
[1]  http://www.responsegenetics.com/


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


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

2011-05-17 Thread Jeronimo Pellegrini
On Tue, May 17, 2011 at 09:51:51AM +0200, Christian Kellermann wrote:
 Hi Jeronimo,

Hi Christian!

 Thank you for your nice bug report! You have indeed encountered a
 bunch of them I hope the experience has not been too discouraging.
 To add pain to misery some of the issues you have encountered were
 sitting in trunk awaiting a new tag.
 
 So some of your issues are gone now as I have tagged a new version
 0.4, please try this one.

Hey, that was fast! :-)
Thanks!

 * Jeronimo Pellegrini j...@aleph0.info [110516 21:16]:
  #;1 (use isbn openlibrary)
  #;2 (define isbn 8573261854)
  #;3 (valid-isbn? isbn)
  #;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
  
 This has been fixed.

:-)

  #;6 (isbn10-isbn13 isbn)
  = 978-8-57326-185-1
 
 This will return a normalized form since the dashes are totally
 bogus as the isbn egg does not lookup the group identifier or
 publisher codes and those are variable length (and can be determined
 only with a table).
 
  #;7 (normalize-isbn 978-8-57326-185-1)
 
 This has been fixed.

:-)

  Also, is this really supposed to work?
  
  #;2 (valid-isbn? blah blah 8573261854)
  #t
 
 This is one of the ugliest parts of the egg. Atm it is stupid and
 will throw away all non number chars and checks that.
 
 The proper solution would be to parse the input correctly (either
 with a regexp or a real parser).  This issue remains unsolved. I
 have put it on my list.

I suppose it would be good to have different procedures for
mathingextracting an ISBN and actually validating one...

Something like

(extract-isbn blah blah 978-0262011532)
= 9780262011532  ; already normalized

(extract-isbn blah)
= #f

(valid-isbn? blah blah 978-0262011532)
= #f 

But it's just a suggestion!

 However, in the mean time, you could scrub all input that's valid
 through normalize:
 
 #;4 (normalize-isbn blah blah 8573261854)
 8573261854

That's cool!

  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:
 
 I am aware that this is still all a bit messy, thanks for your
 input! I will tag 0.5 with a more reliable input parsing soon.

 Does this help you?

Of course! :-)
Thanks for the quick reply!

J.


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users