-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
guile: Fix the mu:body message method #2801
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,23 @@ exec guile -e main -s $0 $@ | |
(str-equal-or-exit (mu:subject msg) "atoms") | ||
(str-equal-or-exit (mu:to msg) "Democritus <[email protected]>") | ||
(str-equal-or-exit (mu:from msg) "Richard P. Feynman <[email protected]>") | ||
;;(str-equal-or-exit (mu:header msg "Content-transfer-encoding") "7BIT") | ||
;;(str-equal-or-exit (mu:header msg "Content-Transfer-Encoding") "8bit") | ||
(str-equal-or-exit (mu:body msg) | ||
(string-join | ||
'("If, in some cataclysm, all scientific knowledge were to be destroyed," | ||
"and only one sentence passed on to the next generation of creatures," | ||
"what statement would contain the most information in the fewest words?" | ||
"I believe it is the atomic hypothesis (or atomic fact, or whatever you" | ||
"wish to call it) that all things are made of atoms — little particles" | ||
"that move around in perpetual motion, attracting each other when they" | ||
"are a little distance apart, but repelling upon being squeezed into" | ||
"one another. In that one sentence you will see an enormous amount of" | ||
"information about the world, if just a little imagination and thinking" | ||
"are applied.\n") "\n")) | ||
(str-equal-or-exit (mu:body-txt msg) (mu:body msg)) | ||
(let ((got (mu:body-html msg))) | ||
(if got | ||
(error-exit "Expected #f, got ~a" got))) | ||
|
||
(if (not (equal? (mu:priority msg) mu:prio:high)) | ||
(error-exit "Expected ~a, got ~a" (mu:priority msg) mu:prio:high)))) | ||
|
@@ -97,7 +113,7 @@ exec guile -e main -s $0 $@ | |
(define (test-stats) | ||
"Test statistical functions." | ||
;; average | ||
(num-equal-or-exit (mu:average mu:size) 82601/14) | ||
(num-equal-or-exit (mu:average mu:size) 41299/7) | ||
(num-equal-or-exit (floor (mu:stddev mu:size)) 12637.0) | ||
(num-equal-or-exit (mu:max mu:size) 46308) | ||
(num-equal-or-exit (mu:min mu:size) 111)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ Subject: atoms | |
To: "Democritus" <[email protected]> | ||
Message-id: <[email protected]> | ||
MIME-version: 1.0 | ||
Content-type: text/plain; charset=us-ascii | ||
Content-transfer-encoding: 7BIT | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
Precedence: high | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this change needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, otherwise the
Is the charset wrong on purpose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't change this part in the new version. |
||
If, in some cataclysm, all scientific knowledge were to be destroyed, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the Mu Guile API is deprecated, people may depend on it, so wouldn't want to add backward-incompatibilities if it can be avoided.
So, it's okay to remove body-txt/body-html from the documentation, but keep the functions around; the former as a synonym for
body
and the latter always returning#f
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I'll send an updated version with that change.
Is it ok if I force-push to this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just force-pushed a version implementing the change.