From: Nils Gillmann <ng0@n0.is>
To: Chris Marusich <cmmarusich@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: a GUIX_PACKAGE_PATH / modules puzzle
Date: Thu, 3 May 2018 08:30:33 +0000 [thread overview]
Message-ID: <20180503083033.457tdfmh5qmauqb4@abyayala> (raw)
In-Reply-To: <87a7thxkw2.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]
Chris Marusich transcribed 2.3K bytes:
> Nils Gillmann <ng0@n0.is> 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.
Okay, thanks.
> Here are some simple
> examples of how to use it:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (pk "hello")
>
> ;;; ("hello")
> $1 = "hello"
> scheme@(guile-user)> (pk (list 1 2 3))
>
> ;;; ((1 2 3))
> $2 = (1 2 3)
> scheme@(guile-user)> (define (1+ n) (+ 1 (pk n)))
> scheme@(guile-user)> (1+ 2)
>
> ;;; (2)
> $3 = 3
> scheme@(guile-user)> pk
> $4 = #<procedure peek stuff>
> --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:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (pk (values 1 2))
>
> ;;; (1)
> $5 = 1
> --8<---------------cut here---------------end--------------->8---
>
> I hope that helps!
Seems like in the case of using (system) it doesn't do anything, I'll
try guile interaction with Guix tonight.
> 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
>
> --
> Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-05-03 8:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-01 22:39 a GUIX_PACKAGE_PATH / modules puzzle Nils Gillmann
2018-05-03 5:16 ` Chris Marusich
2018-05-03 5:36 ` Nils Gillmann
2018-05-03 7:23 ` Chris Marusich
2018-05-03 8:30 ` Nils Gillmann [this message]
2018-05-10 22:27 ` Nils Gillmann
2018-05-10 23:26 ` Nils Gillmann
2018-05-11 7:00 ` Nils Gillmann
2018-05-11 7:19 ` Nils Gillmann
2018-05-12 13:43 ` Ricardo Wurmus
2018-05-12 19:45 ` Nils Gillmann
2018-05-13 5:15 ` Ricardo Wurmus
2018-05-11 7:36 ` Nils Gillmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180503083033.457tdfmh5qmauqb4@abyayala \
--to=ng0@n0.is \
--cc=cmmarusich@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).