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 16:23:02 +0800 Message-ID: References: <1354692089.25329.71.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 1354695793 17182 80.91.229.3 (5 Dec 2012 08:23:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2012 08:23:13 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Dec 05 09:23:26 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 1TgAGM-0003r4-67 for guile-devel@m.gmane.org; Wed, 05 Dec 2012 09:23:26 +0100 Original-Received: from localhost ([::1]:33384 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgAGA-0006BO-AM for guile-devel@m.gmane.org; Wed, 05 Dec 2012 03:23:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:46506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgAG6-0006B8-D2 for guile-devel@gnu.org; Wed, 05 Dec 2012 03:23:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgAG0-00070B-AK for guile-devel@gnu.org; Wed, 05 Dec 2012 03:23:10 -0500 Original-Received: from mail-wi0-f179.google.com ([209.85.212.179]:50316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgAG0-000707-38 for guile-devel@gnu.org; Wed, 05 Dec 2012 03:23:04 -0500 Original-Received: by mail-wi0-f179.google.com with SMTP id o1so1033483wic.12 for ; Wed, 05 Dec 2012 00:23:02 -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=emfE/TBEi5PRTRKtpUEGMWd36sUHLOrQmM6ApSlMWhg=; b=oLSYWFemDal9D2AUSZXoUEY/SXRSUDfQLRvliRsuJ+E9EdozFwlPHG8gp18uPvpvBY 5zeLLXRIJOHixs9xmxzsjeXoDAzVz56PBQRaHhFCdyC3XJ8OvfF0Kx/3ifeGr+iBRex9 YRMFGZ7jyRrYFK1+JYdL0IUcxrsXF9Klf2v3JJ8PBlZJC0xSFTmgQ+GhFjCcLj9c9AeY vkkVYKtV+JfQrh/1FK06j9f/yF7RtK1ldGP9O2C8ld4WQhv57ODDMt+pvNWWDSYQ37wx hSy2ktgjeASxZYb7OfFLiIkVKI6nx+ffWTFmceMCYxsqTnAaVpK6q385nvYrmcGKjBco xkIg== Original-Received: by 10.216.90.73 with SMTP id d51mr6027867wef.188.1354695782692; Wed, 05 Dec 2012 00:23:02 -0800 (PST) Original-Received: by 10.216.125.68 with HTTP; Wed, 5 Dec 2012 00:23:02 -0800 (PST) In-Reply-To: <1354692089.25329.71.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:15301 Archived-At: On 5 December 2012 15:21, Nala Ginrut 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" +;; 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* + `((, ,color-integer light-blue) + (, ,color-char brown) The datums tested for are all primitives. For reference, the =E2=80=9Cclass-of=E2=80=9D operator is more-or-less equivalent to: (cond ((integer? x) ) ((char? x) ) =E2=80=A6 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