From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Fwd: Re: Patch file for colorize module Date: Sat, 09 Jun 2018 02:57:40 +0200 Message-ID: <87bmck22uz.fsf@elephly.net> References: <8ea5d026-fab9-7b12-198e-610ad7743cb2@swecha.net> <3d5eca09-7730-bd38-265b-7942d0ea16ed@swecha.net> <878t864i59.fsf@elephly.net> <87o9gwpcmx.fsf@elephly.net> <2f71be8d-c672-c66a-0b16-bc3abc748754@swecha.net> <877enjpquf.fsf@elephly.net> <557b30de-5aa2-113f-7e90-a4a23e86bb07@swecha.net> <87602zbrcc.fsf@elephly.net> <328742c6-f96f-74b8-68ef-3b165a6199aa@swecha.net> <87zi0a3m3t.fsf@elephly.net> <07c93c07-2172-6bf1-6188-88830c1d8b4c@swecha.net> <87o9gpyq4t.fsf@elephly.net> <91773c8b-3072-2a82-dca3-cbeb5adf826d@swecha.net> <87fu1zznl3.fsf@elephly.net> <87bmcnzjsp.fsf@elephly.net> <18408eca-ad0b-111a-0ef6-ab452c9ca89c@swecha.net> <878t7ryxvf.fsf@elephly.net> <02e1a59a-ebc1-dfce-e1d6-22e97e742214@swecha.net> <874lifypeb.fsf@elephly.net> <648f81fc-0607-2c3b-f9a3-ca3b29cd637b@swecha.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRSDa-0004b6-LL for guix-devel@gnu.org; Fri, 08 Jun 2018 20:58:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRSDY-0002CV-Jz for guix-devel@gnu.org; Fri, 08 Jun 2018 20:58:58 -0400 Received: from sender-of-o51.zoho.com ([135.84.80.216]:21018) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRSDY-0002CH-Ai for guix-devel@gnu.org; Fri, 08 Jun 2018 20:58:56 -0400 In-reply-to: <648f81fc-0607-2c3b-f9a3-ca3b29cd637b@swecha.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Sahitihi Cc: guix-devel Hi Sahithi, > As per discussion in irc, I tried using "pk str" and "(pk > (string-append =E2=80=A6))" to show values. > > I dint find any differences with and without pk. That=E2=80=99s expected. =E2=80=9Cpk=E2=80=9D only peeks at the value =E2= =80=94 it does not modify it. The goal of using =E2=80=9Cpk=E2=80=9D was to help you figure out if the va= lues of any of the inner expressions really are what you want them to be. > I thought I overlooked, so I tried copying terminal lines to files and > compared. I couldn't find differences except that of timing. I found the error already, but I=E2=80=99m sure you can too. Here=E2=80=99= s a hint: play around with =E2=80=9C(colorize-string "hello" '(GREEN))=E2=80=9D. Doe= s this look right? If not, why is that? Look closely at the definition of =E2=80=9Ccolorize-string=E2=80=9D. What arguments does it expect? How are= arguments bound to variables? How many arguments does =E2=80=9Ccolorize-string=E2=80= =9D accept? Are you really sure about that=E2=80=A6? Please really do play with this in the REPL and remind yourself of what you expect to see. Let=E2=80=99s even ignore color. What should really ha= ppen to the first argument to =E2=80=9Ccolorize-string=E2=80=9D in terms of ANSI= codes? -- Ricardo