[plt-scheme] nntp.ss - does it work ? now imap.ss and head.ss
Hello,
Here's another tiny bug in the net collection.
(require (lib "imap.ss" "net"))
(require (lib "head.ss" "net"))
(define-values (imp mc rmc) (imap-connect "an.imap.server.com" "my-
id" "my-pw" "the-drawer-on-the-left"))
(extract-field "From" (caar (imap-get-messages imp '(1) '(header))))
pops up an error:
string-length: expects argument of type <string>; given #"Return-
Path: blah blah blah...
I understand extract-field expects a string and complains because
it's a byte-string (MzScheme manual 12.2.4.7) ? It works by adding a
(bytes->string/utf-8 ... appropriately.
In the doc, it is said that (imap-get-messages ... '(... header ...))
will return header (as in head.ss) values which are string values,
but we see it returns a byte-string value (and that could be better).
Whereas (imap-get-messages ... '(... body ...)) should return byte-
string values.
So I don't know if you'd rather update (imap-get-messages ...
'header...) to produce strings, or head.ss to use byte-strings.
___________________________________________________________________________
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com