From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 03 22:49:39 2012 Received: (at submit) by debbugs.gnu.org; 4 Dec 2012 03:49:40 +0000 Received: from localhost ([127.0.0.1]:52288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TfjVr-0003jk-An for submit@debbugs.gnu.org; Mon, 03 Dec 2012 22:49:39 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33892) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TfjVp-0003jd-Mz for submit@debbugs.gnu.org; Mon, 03 Dec 2012 22:49:38 -0500 Received: by mail-pa0-f44.google.com with SMTP id hz11so2272102pad.3 for ; Mon, 03 Dec 2012 19:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=pekVStJZGAr8avkbE0QW2kettPcm1hlcIfBHPKhmz4U=; b=JaDTT7+1SeXCFY2vxFpZkSVO8BzZfsXNUfuIZg/l3Sh77Ze0yM4MifMI5Eevoht2C1 4xwrn6I+sX1sy1fhFsLd7dbivdp9n3y69aLtSR1lGXhiBIVCfoZpvfgpbnjjmi4Yg9yo 3dwwKdHoFCfIwDYA/uuceP94xH9q0Fb24rY9uop8G9yz9YNbxJ+XzNENprwGuZfO0vKZ kRXbHAo5VpoSmqCs/xkOCySFu9eqdI+pq+TOtgT2IsUPL7sCiIHt3zkv9596v9TdCkNO MztALLSH5vYha88PbIPZaWMK6cg6TnOjTWPLau6G9FiIlmfKVF241VOM/6I+5bv0nf/Q 1sbw== Received: by 10.66.80.194 with SMTP id t2mr31450608pax.43.1354592830181; Mon, 03 Dec 2012 19:47:10 -0800 (PST) Received: from io ([101.119.31.219]) by mx.google.com with ESMTPS id ju7sm207199pbb.60.2012.12.03.19.47.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Dec 2012 19:47:09 -0800 (PST) From: Daniel Hartwig To: submit@debbugs.gnu.org Subject: guile: add repl-option for customized print Date: Tue, 04 Dec 2012 11:46:53 +0800 Message-ID: <87hao21nte.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Package: guile Severity: wishlist Tags: patch X-Debbugs-CC: nalaginrut Dear maintainer The attached patch adds a new repl-option to set a custom print procedure. -- scheme@(guile-user)> (use-modules (srfi srfi-1)) scheme@(guile-user)> (iota 20) $1 =3D (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) scheme@(guile-user)> (define (repl-print* repl val) (if (not (eq? val *unspecified*)) (begin (run-hook before-print-hook val) (format #t "~20@y" val) (newline)))) scheme@(guile-user)> (use-modules (system repl common)) scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) 'prin= t repl-print*) scheme@(guile-user)> (iota 20) $2 =3D (0 1 2 3 4 5 6 7 =E2=80=A6) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-repl-add-repl-option-for-customized-print.patch >From b0cadcb69a12a4ed2a205f4854af41bf926da20b Mon Sep 17 00:00:00 2001 From: Daniel Hartwig Date: Tue, 4 Dec 2012 11:41:35 +0800 Subject: [PATCH] repl: add repl-option for customized print * module/system/repl/common.scm (repl-default-options) (repl-print): Add option to use customized print procedure. * doc/ref/scheme-using.texi (REPL Commands): Update. --- doc/ref/scheme-using.texi | 4 ++++ module/system/repl/common.scm | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/doc/ref/scheme-using.texi b/doc/ref/scheme-using.texi index 7eb84de..4f9e6db 100644 --- a/doc/ref/scheme-using.texi +++ b/doc/ref/scheme-using.texi @@ -445,6 +445,10 @@ choice is available. Off by default (indicating compilation). @item prompt A customized REPL prompt. @code{#f} by default, indicating the default prompt. +@item print +A procedure of two arguments used to print the result of evaluating each +expression. The arguments are the current REPL and the value to print. +By default, @code{#f}, to use the default procedure. @item value-history Whether value history is on or not. @xref{Value History}. @item on-error diff --git a/module/system/repl/common.scm b/module/system/repl/common.scm index 346ba99..fd41b09 100644 --- a/module/system/repl/common.scm +++ b/module/system/repl/common.scm @@ -119,6 +119,11 @@ See , for more details.") ((thunk? prompt) (lambda (repl) (prompt))) ((procedure? prompt) prompt) (else (error "Invalid prompt" prompt))))) + (print #f ,(lambda (print) + (cond + ((not print) #f) + ((procedure? print) print) + (else (error "Invalid print procedure" print))))) (value-history ,(value-history-enabled?) ,(lambda (x) @@ -206,15 +211,18 @@ See , for more details.") (% (thunk)))) (define (repl-print repl val) - (if (not (eq? val *unspecified*)) - (begin - (run-hook before-print-hook val) - ;; The result of an evaluation is representable in scheme, and - ;; should be printed with the generic printer, `write'. The - ;; language-printer is something else: it prints expressions of - ;; a given language, not the result of evaluation. - (write val) - (newline)))) + (cond + ((repl-option-ref repl 'print) + => (lambda (print) (print repl val))) + ((not (eq? val *unspecified*)) + (begin + (run-hook before-print-hook val) + ;; The result of an evaluation is representable in scheme, and + ;; should be printed with the generic printer, `write'. The + ;; language-printer is something else: it prints expressions of + ;; a given language, not the result of evaluation. + (write val) + (newline))))) (define (repl-option-ref repl key) (cadr (or (assq key (repl-options repl)) -- 1.7.10.4 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 04 00:21:55 2012 Received: (at 13077) by debbugs.gnu.org; 4 Dec 2012 05:21:55 +0000 Received: from localhost ([127.0.0.1]:52342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfkx8-0005oE-8t for submit@debbugs.gnu.org; Tue, 04 Dec 2012 00:21:55 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:59819) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfkx5-0005o3-Su for 13077@debbugs.gnu.org; Tue, 04 Dec 2012 00:21:53 -0500 Received: by mail-ie0-f174.google.com with SMTP id c11so5551139ieb.19 for <13077@debbugs.gnu.org>; Mon, 03 Dec 2012 21:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:content-type:x-mailer:mime-version :content-transfer-encoding; bh=wmEFGCKBaHuUPE1yWb+vMkpNJZLf7I+ZdTZ98chmH+k=; b=ChnNgo/0b9og1uisybYbWjP0/Bzwi2Wo+McvdmGrvooSB5lB1Zgz37fiLrPGI61PwJ Fl0ffrCYmITS60mS+cpLnNPh9Ry5z+YP4S1lvbghTYUxQ0mzTDAxzRhQYKx/3lQg7kGL N7oEbCdVZ9O72HyD7TGhm8JpuDbvK2xBv911vaDcEubwtXXIN6fvG0wCMIGO4n5hn/x6 uQI7TCe7fr7Ptv821zWMUUFrCXiESmC9fMpaHlIvWOZMMju2wjy+L/tcLvlPcRxDUB5o 84ag2vM9EFC5wgbqnyzXgCD6bRR050aoTwCyTPfGkVXaEVfmp5d4bHWy0WEnSzz7UaJs TCmQ== Received: by 10.50.208.41 with SMTP id mb9mr1487216igc.42.1354598363805; Mon, 03 Dec 2012 21:19:23 -0800 (PST) Received: from [147.2.147.112] ([61.14.130.226]) by mx.google.com with ESMTPS id ff4sm9032215igc.13.2012.12.03.21.19.20 (version=SSLv3 cipher=OTHER); Mon, 03 Dec 2012 21:19:22 -0800 (PST) Message-ID: <1354598358.25329.4.camel@Renee-desktop.suse> Subject: Re: bug#13077: guile: add repl-option for customized print From: nalaginrut To: Daniel Hartwig , guile-devel@gnu.org Date: Tue, 04 Dec 2012 13:19:18 +0800 In-Reply-To: <87hao21nte.fsf@gmail.com> References: <87hao21nte.fsf@gmail.com> Organization: HFG Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13077 Cc: 13077@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.7 (/) Hi Daniel! I believe this patch simplified my work, and 'colorized' module has been finished, I'm testing and debugging. I'll post it when it's all done. Thanks! On Tue, 2012-12-04 at 11:46 +0800, Daniel Hartwig wrote: > Package: guile > Severity: wishlist > Tags: patch > X-Debbugs-CC: nalaginrut > > Dear maintainer > > The attached patch adds a new repl-option to set a custom print > procedure. > > -- > scheme@(guile-user)> (use-modules (srfi srfi-1)) > scheme@(guile-user)> (iota 20) > $1 = (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) > scheme@(guile-user)> (define (repl-print* repl val) > (if (not (eq? val *unspecified*)) > (begin > (run-hook before-print-hook val) > (format #t "~20@y" val) > (newline)))) > scheme@(guile-user)> (use-modules (system repl common)) > scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) 'print repl-print*) > scheme@(guile-user)> (iota 20) > $2 = (0 1 2 3 4 5 6 7 …) > differences between files attachment > (0001-repl-add-repl-option-for-customized-print.patch) > From b0cadcb69a12a4ed2a205f4854af41bf926da20b Mon Sep 17 00:00:00 2001 > From: Daniel Hartwig > Date: Tue, 4 Dec 2012 11:41:35 +0800 > Subject: [PATCH] repl: add repl-option for customized print > > * module/system/repl/common.scm (repl-default-options) > (repl-print): Add option to use customized print procedure. > * doc/ref/scheme-using.texi (REPL Commands): Update. > --- > doc/ref/scheme-using.texi | 4 ++++ > module/system/repl/common.scm | 26 +++++++++++++++++--------- > 2 files changed, 21 insertions(+), 9 deletions(-) > > diff --git a/doc/ref/scheme-using.texi b/doc/ref/scheme-using.texi > index 7eb84de..4f9e6db 100644 > --- a/doc/ref/scheme-using.texi > +++ b/doc/ref/scheme-using.texi > @@ -445,6 +445,10 @@ choice is available. Off by default (indicating compilation). > @item prompt > A customized REPL prompt. @code{#f} by default, indicating the default > prompt. > +@item print > +A procedure of two arguments used to print the result of evaluating each > +expression. The arguments are the current REPL and the value to print. > +By default, @code{#f}, to use the default procedure. > @item value-history > Whether value history is on or not. @xref{Value History}. > @item on-error > diff --git a/module/system/repl/common.scm b/module/system/repl/common.scm > index 346ba99..fd41b09 100644 > --- a/module/system/repl/common.scm > +++ b/module/system/repl/common.scm > @@ -119,6 +119,11 @@ See , for more details.") > ((thunk? prompt) (lambda (repl) (prompt))) > ((procedure? prompt) prompt) > (else (error "Invalid prompt" prompt))))) > + (print #f ,(lambda (print) > + (cond > + ((not print) #f) > + ((procedure? print) print) > + (else (error "Invalid print procedure" print))))) > (value-history > ,(value-history-enabled?) > ,(lambda (x) > @@ -206,15 +211,18 @@ See , for more details.") > (% (thunk)))) > > (define (repl-print repl val) > - (if (not (eq? val *unspecified*)) > - (begin > - (run-hook before-print-hook val) > - ;; The result of an evaluation is representable in scheme, and > - ;; should be printed with the generic printer, `write'. The > - ;; language-printer is something else: it prints expressions of > - ;; a given language, not the result of evaluation. > - (write val) > - (newline)))) > + (cond > + ((repl-option-ref repl 'print) > + => (lambda (print) (print repl val))) > + ((not (eq? val *unspecified*)) > + (begin > + (run-hook before-print-hook val) > + ;; The result of an evaluation is representable in scheme, and > + ;; should be printed with the generic printer, `write'. The > + ;; language-printer is something else: it prints expressions of > + ;; a given language, not the result of evaluation. > + (write val) > + (newline))))) > > (define (repl-option-ref repl key) > (cadr (or (assq key (repl-options repl)) From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 04 00:37:21 2012 Received: (at 13077) by debbugs.gnu.org; 4 Dec 2012 05:37:21 +0000 Received: from localhost ([127.0.0.1]:52349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TflC5-00069c-JZ for submit@debbugs.gnu.org; Tue, 04 Dec 2012 00:37:21 -0500 Received: from mail-wg0-f48.google.com ([74.125.82.48]:35834) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TflC3-00069U-MT for 13077@debbugs.gnu.org; Tue, 04 Dec 2012 00:37:20 -0500 Received: by mail-wg0-f48.google.com with SMTP id dt10so1890971wgb.15 for <13077@debbugs.gnu.org>; Mon, 03 Dec 2012 21:34:52 -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 :cc:content-type; bh=tBDUFFpH9zV62GdtHrBxiofYd79u4yr/T4dehAzS6dE=; b=kT6w/myOPRfL3LXdC5uy/o7pMf58CldwZhOY4qfZ2XpGNVpkeKTfsHeV3PuVBM04TA /ZvaGlfJJVJkCa7R0D7YexS17KH/KaqQvpW7gIn1QWE+vyMaeLhA+8M1sa5BD9/C29Ov HYw6VucsF4UG8syvBjTFK81QHMAcOMZKO2YDQ4KQXFdsWnO/C2DVLb4jwpUmaJo+VwOR 2UAD1rmX+Q76uEHkaN2mYTx9LfEUKhOBwv3mJQwTOhOXKfw4ee0SZwIK57d8e0Nj6n3U NFzIE3aBjZMQ0ZtiE3M56MTrtYRsz6DfYuVn6GZ6UMQ38nIom02qZGpMxfcfipmK54f4 fZJQ== MIME-Version: 1.0 Received: by 10.180.81.39 with SMTP id w7mr2116984wix.15.1354599292830; Mon, 03 Dec 2012 21:34:52 -0800 (PST) Received: by 10.216.125.68 with HTTP; Mon, 3 Dec 2012 21:34:52 -0800 (PST) In-Reply-To: <1354598358.25329.4.camel@Renee-desktop.suse> References: <87hao21nte.fsf@gmail.com> <1354598358.25329.4.camel@Renee-desktop.suse> Date: Tue, 4 Dec 2012 13:34:52 +0800 Message-ID: Subject: Re: bug#13077: guile: add repl-option for customized print From: Daniel Hartwig To: nalaginrut Content-Type: multipart/mixed; boundary=bcaec5555034a9848604d0003908 X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13077 Cc: 13077@debbugs.gnu.org, guile-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) --bcaec5555034a9848604d0003908 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 4 December 2012 13:19, nalaginrut wrote: > Hi Daniel! > I believe this patch simplified my work, and 'colorized' module has been > finished, I'm testing and debugging. > I'll post it when it's all done. Glad to hear it. Attached is an alternate patch that handles before-print-hook and *unspecified* outside of the custom print procedure, to avoid the need for boilerplate there. -- scheme@(guile-user)> (define (repl-print* repl val) (format #t "~20@y" val) (newline)) scheme@(guile-user)> (use-modules (system repl common)) scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) 'print repl-print*) scheme@(guile-user)> (use-modules (srfi srfi-1)) scheme@(guile-user)> (iota 20) $1 =3D (0 1 2 3 4 5 6 7 =E2=80=A6) --bcaec5555034a9848604d0003908 Content-Type: application/octet-stream; name="0001-repl-add-repl-option-for-customized-print.alt.patch" Content-Disposition: attachment; filename="0001-repl-add-repl-option-for-customized-print.alt.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_haaler930 RnJvbSAyMjUxYTI1OTA1ODUyNGZiZTYzMWZkMjg3Yzk1YjQzODgyMjI3Zjc5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYW5pZWwgSGFydHdpZyA8bWFuZHlrZUBnbWFpbC5jb20+CkRh dGU6IFR1ZSwgNCBEZWMgMjAxMi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bmQKKyAgICAgICAgICA7OyBzaG91bGQgYmUgcHJp bnRlZCB3aXRoIHRoZSBnZW5lcmljIHByaW50ZXIsIGB3cml0ZScuIFRoZQorICAgICAgICAgIDs7 IGxhbmd1YWdlLXByaW50ZXIgaXMgc29tZXRoaW5nIGVsc2U6IGl0IHByaW50cyBleHByZXNzaW9u cyBvZgorICAgICAgICAgIDs7IGEgZ2l2ZW4gbGFuZ3VhZ2UsIG5vdCB0aGUgcmVzdWx0IG9mIGV2 YWx1YXRpb24uCisgICAgICAgICAgKHdyaXRlIHZhbCkKKyAgICAgICAgICAobmV3bGluZSkpKSkp KQogCiAoZGVmaW5lIChyZXBsLW9wdGlvbi1yZWYgcmVwbCBrZXkpCiAgIChjYWRyIChvciAoYXNz cSBrZXkgKHJlcGwtb3B0aW9ucyByZXBsKSkKLS0gCjEuNy4xMC40Cgo= --bcaec5555034a9848604d0003908-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 04 01:33:15 2012 Received: (at 13077) by debbugs.gnu.org; 4 Dec 2012 06:33:15 +0000 Received: from localhost ([127.0.0.1]:52379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfm48-0007Wi-RG for submit@debbugs.gnu.org; Tue, 04 Dec 2012 01:33:15 -0500 Received: from mail-ia0-f180.google.com ([209.85.210.180]:43004) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfm45-0007WX-Qn for 13077@debbugs.gnu.org; Tue, 04 Dec 2012 01:33:11 -0500 Received: by mail-ia0-f180.google.com with SMTP id t4so3538237iag.39 for <13077@debbugs.gnu.org>; Mon, 03 Dec 2012 22:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:content-type:x-mailer:mime-version :content-transfer-encoding; bh=6ageSXSjsJotTMigMso9KfxAbXj8e3CetMMseRkyHuA=; b=Fdo/CXmU8UcmEMNW4GGEx+mkNqOkRkICvAqGYQW+WOKQBr/8Q3xe6gZHjPB5jNqos7 DTk6PXZaqMeNI0+l+0I0eNHWrwcjPYjvLqcr1BsPNQelbiAWGcaZBRnYk+CzMDNNi79g tP+PloSRprdodqymG4+OVQ8OWptgObjcEm6Wb4HgaisAK8VXrYpQv0CLpCDz3KoAUzdw uAAlgNcp8iVF/BfGHT+XeKYhKBUz6vesdn0C0gTLnf1n9mkm40swzYuJ3t18uxY/WDYO 7pqqykU5GwanvWcGdFq3nKCL7XdYhNS+mg9KQ3Rf9JIfkWYb84HaOvgk+o8yqAVXYITV bvuw== Received: by 10.50.170.66 with SMTP id ak2mr1644204igc.38.1354602641812; Mon, 03 Dec 2012 22:30:41 -0800 (PST) Received: from [147.2.147.112] ([61.14.130.226]) by mx.google.com with ESMTPS id vq4sm9169401igb.10.2012.12.03.22.30.38 (version=SSLv3 cipher=OTHER); Mon, 03 Dec 2012 22:30:40 -0800 (PST) Message-ID: <1354602636.25329.9.camel@Renee-desktop.suse> Subject: Re: bug#13077: guile: add repl-option for customized print From: nalaginrut To: Daniel Hartwig Date: Tue, 04 Dec 2012 14:30:36 +0800 In-Reply-To: References: <87hao21nte.fsf@gmail.com> <1354598358.25329.4.camel@Renee-desktop.suse> Organization: HFG Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13077 Cc: 13077@debbugs.gnu.org, guile-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) I'll post my original guile-colorized which uses 'before-print-hook' to guile-dev. Though I've already tested it, I wish all folks test it for me. And I'll update it to repl-option version after ludo/andy accepts your patch. Or I should post it include your patch altogether? ;-) On Tue, 2012-12-04 at 13:34 +0800, Daniel Hartwig wrote: > On 4 December 2012 13:19, nalaginrut wrote: > > Hi Daniel! > > I believe this patch simplified my work, and 'colorized' module has been > > finished, I'm testing and debugging. > > I'll post it when it's all done. > > Glad to hear it. > > Attached is an alternate patch that handles before-print-hook and > *unspecified* outside of the custom print procedure, to avoid the need > for boilerplate there. > > -- > scheme@(guile-user)> (define (repl-print* repl val) > (format #t "~20@y" val) > (newline)) > scheme@(guile-user)> (use-modules (system repl common)) > scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) > 'print repl-print*) > scheme@(guile-user)> (use-modules (srfi srfi-1)) > scheme@(guile-user)> (iota 20) > $1 = (0 1 2 3 4 5 6 7 …) From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 04 02:38:50 2012 Received: (at 13077) by debbugs.gnu.org; 4 Dec 2012 07:38:50 +0000 Received: from localhost ([127.0.0.1]:52430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfn5c-0000Y2-DY for submit@debbugs.gnu.org; Tue, 04 Dec 2012 02:38:49 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:51008) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tfn5Z-0000Xt-Ge for 13077@debbugs.gnu.org; Tue, 04 Dec 2012 02:38:47 -0500 Received: by mail-we0-f172.google.com with SMTP id r3so1404810wey.3 for <13077@debbugs.gnu.org>; Mon, 03 Dec 2012 23:36:18 -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 :cc:content-type:content-transfer-encoding; bh=AsIgRmar500tfsN+LYah9JOivGHs0sMB69P0f5rACBI=; b=hTk+jwPd2PVQslCGo64RIvTVEzAv/LxGp5zd2CqAcW3dBW7jUeFFipr47EisWvpvXL YJsrouxSOUOPMrFwcAY8l/SBsyGemW1kL2wQH8VQCMFYA+9pwWJsl+0jygR/5TtzzpFr 6nW0DqVbhthNSGjUgQ77d3/q5aYZ/V2F28rBfVVDOqVnaFcZv/CuDwR7QOS6DmMQ3Rp1 3deqKAoRmRUWdeEFqdK+17wtkeE9LIcQf254oSwv9m+8lka6XCa+5+KYAkPbqNB1R1le lSb/SVARjQuCfChtS3UHa0Mh9slEc4C++0khvgvIDn2LBS99fEg9OQscFSZ2jVbmwXSv pfnA== MIME-Version: 1.0 Received: by 10.216.90.73 with SMTP id d51mr4429475wef.188.1354606577860; Mon, 03 Dec 2012 23:36:17 -0800 (PST) Received: by 10.216.125.68 with HTTP; Mon, 3 Dec 2012 23:36:17 -0800 (PST) In-Reply-To: <87lides4mq.fsf@zigzag.favinet> References: <87hao21nte.fsf@gmail.com> <1354598358.25329.4.camel@Renee-desktop.suse> <87lides4mq.fsf@zigzag.favinet> Date: Tue, 4 Dec 2012 15:36:17 +0800 Message-ID: Subject: Re: bug#13077: guile: add repl-option for customized print From: Daniel Hartwig To: Thien-Thi Nguyen Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13077 Cc: guile-devel@gnu.org, 13077@debbugs.gnu.org, nalaginrut X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) On 4 December 2012 14:39, Thien-Thi Nguyen wrote: > () Daniel Hartwig > () Tue, 4 Dec 2012 13:34:52 +0800 > > patch that handles [...] *unspecified* > > Can =E2=80=98unspecified?=E2=80=99 (the procedure) be used? I seem to re= call people > wanting to avoid using =E2=80=98*unspecified*=E2=80=99 (the unique object= ) a while back. Could do. Though the existing code uses *unspecified*, and changing would be unrelated to the purpose of this patch. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 10 17:26:19 2012 Received: (at submit) by debbugs.gnu.org; 10 Dec 2012 22:26:19 +0000 Received: from localhost ([127.0.0.1]:35965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TiBnm-0007hx-DF for submit@debbugs.gnu.org; Mon, 10 Dec 2012 17:26:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38138) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TiBnk-0007hq-9I for submit@debbugs.gnu.org; Mon, 10 Dec 2012 17:26:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiBn7-0006Rz-9L for submit@debbugs.gnu.org; Mon, 10 Dec 2012 17:25:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD,USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiBn7-0006Rt-6B for submit@debbugs.gnu.org; Mon, 10 Dec 2012 17:25:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiBn6-0000T6-9g for bug-guile@gnu.org; Mon, 10 Dec 2012 17:25:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiBn2-0006Qz-AA for bug-guile@gnu.org; Mon, 10 Dec 2012 17:25:36 -0500 Received: from plane.gmane.org ([80.91.229.3]:38208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiBn2-0006Qo-3S for bug-guile@gnu.org; Mon, 10 Dec 2012 17:25:32 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TiBnB-0007ua-TQ for bug-guile@gnu.org; Mon, 10 Dec 2012 23:25:41 +0100 Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Dec 2012 23:25:41 +0100 Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Dec 2012 23:25:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: bug-guile@gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#13077: guile: add repl-option for customized print Date: Mon, 10 Dec 2012 23:25:20 +0100 Lines: 28 Message-ID: <87ehix1r5b.fsf@gnu.org> References: <87hao21nte.fsf@gmail.com> <1354598358.25329.4.camel@Renee-desktop.suse> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Frimaire an 221 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:fOjKUPEhV1lIUhG52Iv1SEzOMo0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Hi Daniel, Daniel Hartwig skribis: > scheme@(guile-user)> (define (repl-print* repl val) > (format #t "~20@y" val) > (newline)) > scheme@(guile-user)> (use-modules (system repl common)) > scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) > 'print repl-print*) > scheme@(guile-user)> (use-modules (srfi srfi-1)) > scheme@(guile-user)> (iota 20) > $1 = (0 1 2 3 4 5 6 7 …) Nice. > From 2251a259058524fbe631fd287c95b43882227f79 Mon Sep 17 00:00:00 2001 > From: Daniel Hartwig > Date: Tue, 4 Dec 2012 11:41:35 +0800 > Subject: [PATCH] repl: add repl-option for customized print > > * module/system/repl/common.scm (repl-default-options) > (repl-print): Add option to use customized print procedure. > * doc/ref/scheme-using.texi (REPL Commands): Update. Applied, thanks! Ludo’. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 10 17:26:55 2012 Received: (at 13077-done) by debbugs.gnu.org; 10 Dec 2012 22:26:55 +0000 Received: from localhost ([127.0.0.1]:35968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TiBoN-0007im-6l for submit@debbugs.gnu.org; Mon, 10 Dec 2012 17:26:55 -0500 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:51668) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TiBoK-0007id-8F for 13077-done@debbugs.gnu.org; Mon, 10 Dec 2012 17:26:53 -0500 X-IronPort-AV: E=Sophos;i="4.84,254,1355094000"; d="scan'208";a="185497387" Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 10 Dec 2012 23:26:13 +0100 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 13077-done@debbugs.gnu.org Subject: Re: bug#13077: guile: add repl-option for customized print References: <87hao21nte.fsf@gmail.com> <1354598358.25329.4.camel@Renee-desktop.suse> User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Frimaire an 221 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Cancel-Lock: sha1:fOjKUPEhV1lIUhG52Iv1SEzOMo0= Date: Mon, 10 Dec 2012 23:26:12 +0100 In-Reply-To: (Daniel Hartwig's message of "Tue, 4 Dec 2012 13:34:52 +0800") Message-ID: <87a9tl1r3v.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: 13077-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Hi Daniel, Daniel Hartwig skribis: > scheme@(guile-user)> (define (repl-print* repl val) > (format #t "~20@y" val) > (newline)) > scheme@(guile-user)> (use-modules (system repl common)) > scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) > 'print repl-print*) > scheme@(guile-user)> (use-modules (srfi srfi-1)) > scheme@(guile-user)> (iota 20) > $1 =3D (0 1 2 3 4 5 6 7 =E2=80=A6) Nice. > From 2251a259058524fbe631fd287c95b43882227f79 Mon Sep 17 00:00:00 2001 > From: Daniel Hartwig > Date: Tue, 4 Dec 2012 11:41:35 +0800 > Subject: [PATCH] repl: add repl-option for customized print > > * module/system/repl/common.scm (repl-default-options) > (repl-print): Add option to use customized print procedure. > * doc/ref/scheme-using.texi (REPL Commands): Update. Applied, thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 11 23:04:34 2012 Received: (at 13077) by debbugs.gnu.org; 12 Dec 2012 04:04:34 +0000 Received: from localhost ([127.0.0.1]:37949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TidYf-0003cz-Ro for submit@debbugs.gnu.org; Tue, 11 Dec 2012 23:04:34 -0500 Received: from mail-qc0-f177.google.com ([209.85.216.177]:62018) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TidYP-0003cb-3i for 13077@debbugs.gnu.org; Tue, 11 Dec 2012 23:04:32 -0500 Received: by mail-qc0-f177.google.com with SMTP id u28so108743qcs.22 for <13077@debbugs.gnu.org>; Tue, 11 Dec 2012 20:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:cc:date:in-reply-to:references :organization:content-type:x-mailer:mime-version :content-transfer-encoding; bh=R7S3kV7Si5w9vtDrigyotpKeIsZkb71iMB9qZyPjmP4=; b=vymf3gTF26ufvDIJRSXoDfyooy5am2Tvv/ESeYOmxqoz2YFL++Z5SC+6dTIj4ImPnU +SX2PGuq7BEy7patALAl76DFCnLfu7A7fI39Pem+kcLPpDxSRbUCncMtZp1DoSDY7cjq bePRfF9zF78QOPQBF4Q9/ii8FJmbzfYozE3cN00RoaklK2O/RIp6Eee+IC1qBjAmeHo/ 4qO4sCRhg6QpC7Mq1Fgn5FKvulOLnvaRIjqkk4YU/t9eJZzrl4aTfPJaLXe+Wa2PH7aG 4/2sdW9XC2hzgH+TGnCq683CfoNPIx2RBJPxPkC1rA+zQN4hMobwanQyMRi9EB41x1lx MHhA== Received: by 10.224.35.137 with SMTP id p9mr911217qad.85.1355285012182; Tue, 11 Dec 2012 20:03:32 -0800 (PST) Received: from [147.2.147.112] ([61.14.130.226]) by mx.google.com with ESMTPS id eg9sm19035181qab.13.2012.12.11.20.03.29 (version=SSLv3 cipher=OTHER); Tue, 11 Dec 2012 20:03:31 -0800 (PST) Message-ID: <1355285005.2835.14.camel@Renee-desktop.suse> Subject: Re: bug#13077: guile: add repl-option for customized print From: Nala Ginrut To: Daniel Hartwig Date: Wed, 12 Dec 2012 12:03:25 +0800 In-Reply-To: References: <87hao21nte.fsf@gmail.com> <1354598358.25329.4.camel@Renee-desktop.suse> Organization: HFG Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13077 Cc: 13077@debbugs.gnu.org, guile-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) hi Daniel! Custom color-scheme is done now! ;-D But we have a problem... :-( It's OK to test this code in the REPL: --------------------cut------------------- (use-modules (ice-9 colorized)) (add-color-scheme! `((,(lambda (data) (and (number? data) (> data 10000))) MY-LONG-NUM ,color-it (RED)))) (activate-colorized) --------------------end------------------- But when I put these lines into our ~/.guile, it throw error: ----------------err msg---------------- In /usr/local/share/guile/2.0/ice-9/colorized.scm: 31: 0 [activate-colorized] /usr/local/share/guile/2.0/ice-9/colorized.scm:31:20: In procedure activate-colorized: /usr/local/share/guile/2.0/ice-9/colorized.scm:31:20: In procedure car: Wrong type argument in position 1 (expecting pair): () ------------------end------------------ Seems (fluid-ref *repl-stack*) is not a pair/list when REPL is just started? Please checkout here: https://github.com/NalaGinrut/guile-colorized/blob/upstream/ice-9/colorized.scm#L31 Thanks! On Tue, 2012-12-04 at 13:34 +0800, Daniel Hartwig wrote: > On 4 December 2012 13:19, nalaginrut wrote: > > Hi Daniel! > > I believe this patch simplified my work, and 'colorized' module has been > > finished, I'm testing and debugging. > > I'll post it when it's all done. > > Glad to hear it. > > Attached is an alternate patch that handles before-print-hook and > *unspecified* outside of the custom print procedure, to avoid the need > for boilerplate there. > > -- > scheme@(guile-user)> (define (repl-print* repl val) > (format #t "~20@y" val) > (newline)) > scheme@(guile-user)> (use-modules (system repl common)) > scheme@(guile-user)> (repl-option-set! (car (fluid-ref *repl-stack*)) > 'print repl-print*) > scheme@(guile-user)> (use-modules (srfi srfi-1)) > scheme@(guile-user)> (iota 20) > $1 = (0 1 2 3 4 5 6 7 …) From unknown Mon Aug 18 21:50:51 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 09 Jan 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator