guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Colorized REPL


From: Daniel Hartwig
Subject: Re: [PATCH] Colorized REPL
Date: Wed, 5 Dec 2012 16:23:02 +0800

On 5 December 2012 15:21, Nala Ginrut <address@hidden> wrote:
> Hi folks!
> Here's a patch to add colorized-REPL.

Some comments :-)

diff --git a/module/ice-9/colorized.scm b/module/ice-9/colorized.scm
new file mode 100644
index 0000000..fe42a9a
--- /dev/null
+++ b/module/ice-9/colorized.scm
@@ -0,0 +1,290 @@
+;;  Copyright (C) 2012
+;;      "Mu Lei" known as "NalaGinrut" <address@hidden>
+;;  Ragnarok is free software: you can redistribute it and/or modify
+;;  it under the terms of the GNU General Public License as published by
+;;  the Free Software Foundation, either version 3 of the License, or
+;;  (at your option) any later version.

Contributions to GNU must have the copyright assigned to FSF, no?


+  #:use-module (oop goops)

This module seems only used to determine the type of each datum for
assigning a colour:

+(define *colorize-list*
+  `((,<integer> ,color-integer light-blue)
+    (,<char> ,color-char brown)

The datums tested for are all primitives.  For reference, the
“class-of” operator is more-or-less equivalent to:

 (cond
  ((integer? x) <interge>)
  ((char? x) <char>)
  …

Is there some advantage to using the GOOPS classes rather than
equivalent predicates, which are more universal?  Of course, the order
of the tests matters highly in both cases.


There is already a guile-lib module (ansi term-color) that has a
particular syntax and defines the codes.  It would be excellent to
make use of it here, or at least share the syntax and avoid some
duplication.


Regards



reply via email to

[Prev in Thread] Current Thread [Next in Thread]