[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-janitors] #1359: mbox-string's mbox-file->messages does not obv
From: |
Chicken Trac |
Subject: |
[Chicken-janitors] #1359: mbox-string's mbox-file->messages does not obviously match its documentation |
Date: |
Tue, 04 Apr 2017 22:54:44 -0000 |
#1359: mbox-string's mbox-file->messages does not obviously match its
documentation
----------------------------+--------------------------------
Reporter: nxg | Owner:
Type: defect | Status: new
Priority: major | Milestone: someday
Component: unknown | Version: 4.12.0
Keywords: mbox typeclass | Estimated difficulty:
----------------------------+--------------------------------
The documentation in module `mbox` mentions a module `mbox-string`
{{{
[procedure] (mbox-file->messages FILENAME-OR-PORT) => MESSAGE LIST
Given a filename or port, parses the given file as an mbox database, and
returns a list of message objects. The contents of the message are
represented as a string.
}}}
If, however, I use this in the way that this documentation indicates, it
seems to produce errors as illustrated below.
The paragraph before the discussion of `mbox-file->messages` says 'The
procedures in module mbox-string operate on strings.' This seems to
contradict the documentation of `mbox-file->messages`, which claims to
operate on filename-or-port, as explicitly opposed to a string.
Incidentally: I cannot deduce from the documentation how one is supposed
to use any of `mbox`, `internet-messages` `abnf` or `typeclass`. Each of
the first three points to `typeclass` for more information, but that
documentation doesn't say what 'type-class-style' is (it has only one line
of description) and provides an example which doesn't actually seem to use
the objects it has set up. This discussion might be a little too concise
to be useful. The only further information I could google about 'type-
class style' was
https://groups.google.com/d/topic/comp.lang.scheme/J2-TpYsMhfY , which
appears to lead us back where we started.
{{{
% csi
CHICKEN
(c) 2008-2017, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.12.0 (rev 6ea24b6)
macosx-unix-clang-x86-64 [ 64bit manyargs dload ptables ]
compiled 2017-02-19 on yves.more-magic.net (Linux)
#;1> (use mbox-string)
; loading /Data/tools/chicken-4.12/lib/chicken/8/mbox-string.import.so ...
; loading /Data/tools/chicken-4.12/lib/chicken/8/chicken.import.so ...
;;; [...]
; loading /Data/tools/chicken-4.12/lib/chicken/8/mbox.so ...
#;2> (define text (with-input-from-file "test.mbox" read-string))
#;3> text
"From address@hidden: from [12.34.56.78] (nowhere.example.org
[12.34.56.78])\n by 0.0.0.0:587 (trex/5.7.12);\n Mon, 03 Apr 2017
10:16:04 -0400\nFrom: Test User <address@hidden>\nTo:
address@hidden: Nothing much\nDate: Mon, 03 Apr 2017
15:16:02 +0100\n\nThis is a message for reading.\nIt's quite
simple.\n\nAnd on multiple lines.\n"
#;4> (call-with-input-string text mbox-file->messages)
Error: call of non-procedure: #<unspecified>
Call history:
<syntax> (call-with-input-string text mbox-
file->messages)
<eval> (call-with-input-string text mbox-file->messages)
<--
#;4> (call-with-input-file "test.mbox" mbox-file->messages)
Error: call of non-procedure: #<unspecified>
Call history:
<syntax> (call-with-input-file "test.mbox" mbox-
file->messages)
<eval> (call-with-input-file "test.mbox" mbox-file->messages)
<--
#;4> (mbox-file->messages "test.mbox")
Error: call of non-procedure: #<unspecified>
Call history:
<syntax> (mbox-file->messages "test.mbox")
<eval> (mbox-file->messages "test.mbox") <--
#;4>
}}}
--
Ticket URL: <https://bugs.call-cc.org/ticket/1359>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.
- [Chicken-janitors] #1359: mbox-string's mbox-file->messages does not obviously match its documentation,
Chicken Trac <=