From: Nala Ginrut <nalaginrut@gmail.com>
To: Daniel Hartwig <mandyke@gmail.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"Daniel Llorens" <daniel.llorens@bluewin.ch>,
guile-devel@gnu.org
Subject: Re: [PATCH] Colorized REPL
Date: Wed, 05 Dec 2012 18:27:35 +0800 [thread overview]
Message-ID: <1354703255.25329.107.camel@Renee-desktop.suse> (raw)
In-Reply-To: <CAN3veRfyhBMQn+GLe3+b8bW2PGBhXU1kDe5+riX7XbKXD3iDvQ@mail.gmail.com>
On Wed, 2012-12-05 at 17:45 +0800, Daniel Hartwig wrote:
> On 5 December 2012 16:48, Nala Ginrut <nalaginrut@gmail.com> wrote:
> >> 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.
> >>
> >
> > GOOPS classes covered all the possible types in Guile, and it's easy to
> > detect the type of a datum with class-of. I just choose the simplest way
> > which I can imagined.
>
> Predicates cover the same or a greater range of types, in more detail.
> Consider application-specific types:
> - a non-GOOPS extension will provide a predicate, but no specific GOOPS class;
> - a GOOPS extension will typically provide both.
>
> If the colouring is to be made extensible (as it should be), a system
> based on GOOPS class will be insufficient for these extra types.
> Further, suppose a user wants to colour the same type differently
> depending on it's content (such as short vs. long strings, or strings
> matching some pattern).
>
OK, I understand it now. And I'm going to write an more extensible
type-checker. Nevertheless, maybe I should do some work to give the
users chance to define his/her own color-scheme in '~/.guile'.
But it maybe not so easy, I've no idea about it yet. So I'll do the
type-checker first.
> >
> >>
> >> 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.
> >>
> >
> > The code segment of the color is not so big, so I write my own.
> > And it's not easy to do a quick hack with mixing other guy's code.
> > For a quick hack, and it's simple, so I have no time to care about
> > reusing other's work.
>
> Please consider to at least adjust your syntax to be compatible …
>
> > I don't think it's proper to use (ansi term-color)
> > purposely, since it's not in Guile.
>
> … or target this work at extending guile-lib; as a pure-scheme module,
> it certainly falls within the scope. I understand you are keen to
> have this integrated in to Guile proper.
>
I can understand this too. So your suggestion is to write a
(term ansi-color) compatible interface. I think it's easy to do.
But I'm afraid that Guile don't integrate (term ansi-color). Or I should
copy (term ansi-color) into colorized.scm? It's not a big one, but is it
proper?
Anyway, (ice-9 colorized) contains ansi-color procedures could be worthy
of the name.
What if I send three patches eventually?
1. optinal-repl-printer
2. colorized.scm
3. ansi-color.scm
I just want to make sure colorized-repl feature work successfully.
> > Wrong again. I forget add 'before-print-hook' and *unspecified*
> > situation.
>
> With the alternate (and preferred, IMO) patch I sent, the custom
> print procedure should not contain those parts anyway. You can
> presume that an the before-print-hook has been called, and
> unspecified value has already been ignored.
>
> Anyway, looks like a good start to such a feature, though I am
> surprised to see the structure is very different to pretty-print ! :-)
>
> Regards
>
next prev parent reply other threads:[~2012-12-05 10:27 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 7:21 [PATCH] Colorized REPL Nala Ginrut
2012-12-05 8:23 ` Daniel Hartwig
2012-12-05 8:48 ` Nala Ginrut
2012-12-05 9:02 ` Nala Ginrut
2012-12-05 9:45 ` Daniel Hartwig
2012-12-05 10:27 ` Nala Ginrut [this message]
2012-12-05 11:19 ` Daniel Hartwig
2012-12-06 2:43 ` Nala Ginrut
2012-12-06 3:09 ` Daniel Hartwig
2012-12-06 4:28 ` Nala Ginrut
2012-12-06 5:30 ` Daniel Hartwig
2012-12-09 23:29 ` Ludovic Courtès
2012-12-10 2:23 ` Nala Ginrut
2012-12-10 21:42 ` Ludovic Courtès
2012-12-11 2:31 ` Nala Ginrut
2012-12-11 14:13 ` Nala Ginrut
2012-12-31 8:29 ` Nala Ginrut
2013-01-04 14:06 ` Ludovic Courtès
2013-01-04 16:57 ` Mike Gran
2013-01-09 10:17 ` Nala Ginrut
[not found] ` <CAN3veRfF5muf+zrfdU7ZogDw=YboW=QRP08zTF6NUeKzDJ__uA@mail.gmail.com>
2013-01-10 8:20 ` Daniel Hartwig
2013-01-11 6:29 ` Nala Ginrut
2013-01-11 8:13 ` Daniel Hartwig
2013-01-11 10:40 ` Nala Ginrut
2013-01-12 1:01 ` Daniel Hartwig
2013-01-11 14:33 ` Ludovic Courtès
2013-01-11 17:20 ` Noah Lavine
2013-01-11 23:26 ` Ludovic Courtès
2013-01-12 15:35 ` Noah Lavine
2013-01-13 21:01 ` Ludovic Courtès
2013-01-12 0:26 ` Daniel Hartwig
2013-01-12 9:59 ` Nala Ginrut
2013-01-12 21:16 ` Ludovic Courtès
2013-01-26 10:15 ` Nala Ginrut
2013-01-27 10:06 ` Andy Wingo
2013-01-28 4:14 ` Nala Ginrut
2013-01-28 13:58 ` David Pirotte
2013-01-28 14:56 ` Nala Ginrut
2013-01-31 14:25 ` Nala Ginrut
2013-01-31 14:31 ` Nala Ginrut
2013-01-31 16:51 ` Nala Ginrut
2013-01-21 16:10 ` Nala Ginrut
2013-01-22 11:06 ` Nala Ginrut
[not found] <mailman.913570.1354697338.854.guile-devel@gnu.org>
2012-12-05 9:50 ` Daniel Llorens
2012-12-05 9:57 ` Nala Ginrut
2012-12-05 10:11 ` Daniel Hartwig
2012-12-08 21:35 ` Ian Price
2012-12-09 0:50 ` Daniel Hartwig
2012-12-09 10:44 ` Nala Ginrut
2012-12-17 6:04 ` Nala Ginrut
2013-01-21 20:18 ` Andy Wingo
2013-01-28 10:57 ` Nala Ginrut
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=1354703255.25329.107.camel@Renee-desktop.suse \
--to=nalaginrut@gmail.com \
--cc=daniel.llorens@bluewin.ch \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=mandyke@gmail.com \
/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).