unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andreas Rottmann <a.rottmann@gmx.at>
To: Guile Development <guile-devel@gnu.org>
Subject: Fix for the ,show REPL meta-command
Date: Sun, 30 Jan 2011 17:14:58 +0100	[thread overview]
Message-ID: <87pqrexta5.fsf@rotty.yi.org> (raw)

[-- 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/>

             reply	other threads:[~2011-01-30 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30 16:14 Andreas Rottmann [this message]
2011-02-01 22:50 ` Fix for the ,show REPL meta-command Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqrexta5.fsf@rotty.yi.org \
    --to=a.rottmann@gmx.at \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).