From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Colorized REPL Date: Wed, 5 Dec 2012 17:45:04 +0800 Message-ID: References: <1354692089.25329.71.camel@Renee-desktop.suse> <1354697316.25329.83.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1354700750 25882 80.91.229.3 (5 Dec 2012 09:45:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2012 09:45:50 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Dec 05 10:46:03 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TgBYF-00035e-AI for guile-devel@m.gmane.org; Wed, 05 Dec 2012 10:45:59 +0100 Original-Received: from localhost ([::1]:58676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgBY3-0000pc-9f for guile-devel@m.gmane.org; Wed, 05 Dec 2012 04:45:47 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgBXb-0000pD-VH for guile-devel@gnu.org; Wed, 05 Dec 2012 04:45:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgBXO-0001A5-46 for guile-devel@gnu.org; Wed, 05 Dec 2012 04:45:19 -0500 Original-Received: from mail-wi0-f179.google.com ([209.85.212.179]:44052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgBXN-00018L-Rk for guile-devel@gnu.org; Wed, 05 Dec 2012 04:45:05 -0500 Original-Received: by mail-wi0-f179.google.com with SMTP id o1so1075583wic.12 for ; Wed, 05 Dec 2012 01:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=HxUz3SwG57PYBQ75No7lY83odmt/z0ZeoZvbus2qa48=; b=AU23Qy8Ue1nNI3JA/FYkIjKUF7IpsKNb3lyN2W9rH2MrNtyTI05pQKSWFzpMFljZjs 33Xn9Wl7z1kssy03yFzg+DopKXmA7bF3r45ymSTLFgClFgzsyiNNTUVl6GyYygtGSTZu cHJ8PWmb1hPOlXi4lrk1ckk4d6wIix6Rdt8J5ZJymuUFg/WFyvI2NHnggoogOIo9YUjq HS0EDZDfuZ7AuWBVKHPxhgYVDApL2uTkZstZLoioIPnUkYx/ywLBHUb5khtdlZbTK825 HNnq9EOaQorOlUuEEGgzQog/9JGkYXlItiqfEMHsRKOoslZBmDr9VxVUJqofhLQV5//W ydlg== Original-Received: by 10.216.209.77 with SMTP id r55mr5954915weo.81.1354700704223; Wed, 05 Dec 2012 01:45:04 -0800 (PST) Original-Received: by 10.216.125.68 with HTTP; Wed, 5 Dec 2012 01:45:04 -0800 (PST) In-Reply-To: <1354697316.25329.83.camel@Renee-desktop.suse> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.212.179 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15305 Archived-At: On 5 December 2012 16:48, Nala Ginrut 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 cla= ss; - 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). > >> >> 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 =E2=80=A6 > I don't think it's proper to use (ansi term-color) > purposely, since it's not in Guile. =E2=80=A6 or target this work at extending guile-lib; as a pure-scheme modu= le, it certainly falls within the scope. I understand you are keen to have this integrated in to Guile proper. > 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