From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: a GUIX_PACKAGE_PATH / modules puzzle Date: Thu, 03 May 2018 00:23:41 -0700 Message-ID: <87a7thxkw2.fsf@gmail.com> References: <20180501223951.whoj67yv2h3t6wyl@abyayala> <87bmdxwc6y.fsf@gmail.com> <20180503053613.dffmd6ag57x26fdt@abyayala> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE8ak-0005o7-E0 for guix-devel@gnu.org; Thu, 03 May 2018 03:23:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE8ai-0007jU-Vl for guix-devel@gnu.org; Thu, 03 May 2018 03:23:50 -0400 Received: from mail-pg0-x22e.google.com ([2607:f8b0:400e:c05::22e]:35123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fE8ai-0007jB-Ow for guix-devel@gnu.org; Thu, 03 May 2018 03:23:48 -0400 Received: by mail-pg0-x22e.google.com with SMTP id j11-v6so12491443pgf.2 for ; Thu, 03 May 2018 00:23:48 -0700 (PDT) Received: from garuda.local ([2601:602:9d02:4725:6495:ba21:1ebe:620a]) by smtp.gmail.com with ESMTPSA id e190sm25174667pfe.171.2018.05.03.00.23.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 00:23:46 -0700 (PDT) In-Reply-To: <20180503053613.dffmd6ag57x26fdt@abyayala> (Nils Gillmann's message of "Thu, 3 May 2018 05:36:13 +0000") 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: guix-devel@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Nils Gillmann writes: > Anyways, in which section of the guile Manual would I find "pk"? I've > done surprisingly little debugging with Guile itself so far. Unfortunately, pk isn't (yet?) documented. It apparently stands for "peek stuff". It prints and returns the value passed to it. It's a useful little shortcut for printing values. Here are some simple examples of how to use it: =2D-8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (pk "hello") ;;; ("hello") $1 =3D "hello" scheme@(guile-user)> (pk (list 1 2 3)) ;;; ((1 2 3)) $2 =3D (1 2 3) scheme@(guile-user)> (define (1+ n) (+ 1 (pk n))) scheme@(guile-user)> (1+ 2) ;;; (2) $3 =3D 3 scheme@(guile-user)> pk $4 =3D # =2D-8<---------------cut here---------------end--------------->8--- Note that pk does not print out all values when a procedure returns multiple values, but it is still quite handy: =2D-8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (pk (values 1 2)) ;;; (1) $5 =3D 1 =2D-8<---------------cut here---------------end--------------->8--- I hope that helps! By the way, if you feel like taking a trip down the rabbit hole, here is the answer to the somewhat unrelated question of "why did pk only print the first value?" https://lists.gnu.org/archive/html/guile-user/2017-06/msg00043.html =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlrquP0ACgkQ3UCaFdgi Rp2lyg/7BHU2nlUT9H5cbfTwpidzjCUWffVubnm2QG7oPssSzWrgaK7er0DJAdBo 1z9lMHm/62usjQ079a+u7imNbTxqr5f78lJGgQBQJYDVPvef7iQmsjXlFRoP0HN7 Z4+mOv3BybGzgbJXoJdeVTzZfySv/cKiahbVPTBN4/FThCihTPhL/XUZJ9Zt4u4N L30aXsmQi00SXylhLmdMIcTm25XQ0pBF/ELoO9LPUDw6rzTx7RSEBsZQu68sOCHq uUHUMowX44I2lZAwY9uvqnTbjp/T1NsGWtGNaH5mKftALxdNHlgS65k8TeKmwJ5t DqqFbEs0NTO27Pzq/KycGH4PtyPDHrzFgPjR8zlfOVQvgAuQZCXopP5mVVdnj5rj 3PCikIKllvnO5DqXPT1leudICVSvR9HdI+6AR1Re/BszG3Ayux7z0AMTncc+u0HX qQWOGuiA0r1w8NeV01nryUSG7Z1Nye6uSe2j64VD0SEoMC8yYBNGupPgqualDI8D 6e8SfnffLJM0RS174s92feSJpwit/dkTrswoSLDrZnF52RPi//r50uKnSWD69KGp TcLlHGUsfVGO2KKlujytcixFgK5/XLn/ki9KGa9eCavPz04tRyJ9rSeW/N2cdly4 NJlLTSPNVJOYGI/5lfrrf6Ozzl5KPaCMlEIWziR2kWe7q/25CT8= =OK9d -----END PGP SIGNATURE----- --=-=-=--