* Fix for the ,show REPL meta-command
@ 2011-01-30 16:14 Andreas Rottmann
2011-02-01 22:50 ` Andy Wingo
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Rottmann @ 2011-01-30 16:14 UTC (permalink / raw)
To: Guile Development
[-- Attachment #1: Type: text/plain, Size: 160 bytes --]
Hi!
As indicated by Mark Harig[0], the ,show REPL meta-command is broken (my
fault, oversight in 8fdd85f83..).
The attached patch should make it work again.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-show-meta-commands.diff --]
[-- Type: text/x-diff, Size: 1336 bytes --]
From: Andreas Rottmann <a.rottmann@gmx.at>
Subject: Fix `show' REPL meta-command
* module/system/repl/command.scm (warranty, copying, version): Use
`define-meta-command' to define these procedures, so they are entered
into the *command-infos* table.
---
module/system/repl/command.scm | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index 2897b9b..d4b3e4a 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -311,19 +311,23 @@ Without any argument, a list of topics is displayed."
(else
(format #t "Bad arguments: ~A~%" args))))
-(define (warranty repl)
+;;; `warranty', `copying' and `version' are "hidden" meta-commands, only
+;;; accessible via `show'. They have an entry in *command-infos* but not
+;;; in *command-table*.
+
+(define-meta-command (warranty repl)
"show warranty
Details on the lack of warranty."
(display *warranty*)
(newline))
-(define (copying repl)
+(define-meta-command (copying repl)
"show copying
Show the LGPLv3."
(display *copying*)
(newline))
-(define (version repl)
+(define-meta-command (version repl)
"show version
Version information."
(display *version*)
--
tg: (074c414..) t/fix-show-meta-commands (depends on: master)
[-- Attachment #3: Type: text/plain, Size: 1621 bytes --]
Regarding the other issues pointed out in Mark's mail, here's a quick
analysis:
- Error 2, ",statistics": This seems to be due to the ,statistics
meta-command expecting the result of invoking `repl-gc-stats' (which
is based on `gc-stats') to carry several fields that are not present
with current Guile. For example, the ,statistics code references
these fields in the gc-stats alist: `cells-allocated',
`cell-heap-size', `cells-marked', `cells-swept', etc. None of these
are present anymore:
scheme@(guile-user)> (gc-stats)
$1 = ((gc-time-taken . 0) (heap-size . 12034048) (heap-free-size . 167936) (heap-total-allocated . 12935072) (protected-objects . 95) (gc-times . 7))
So the solution would be to significantly cut down the implementation
of ,statistics, to make use only of the fields that are currently
present. I assume that none of the now-missing fields can be
reinstated, since BDW-GC doesn't provide that information, right? If
this is correct, I can give this bug a whirl, hopefully providing a
fix by Wednesday.
- Errors 3-11: These are not really "errors" in my view, but rather
suboptimal presentation of the doc-strings associated with the
meta-commands by ,help. Probably the docstrings should be changed not
to duplicate the summary (which is the first line) in the rest of the
docstring; another possible way to fix this would be to not show theq
summary if there's more documentation after the first line. Thoughts?
[0] http://lists.gnu.org/archive/html/bug-guile/2011-01/msg00070.html
Regards, Rotty
--
Andreas Rottmann -- <http://rotty.yi.org/>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-01 22:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-30 16:14 Fix for the ,show REPL meta-command Andreas Rottmann
2011-02-01 22:50 ` Andy Wingo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).