From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.bugs Subject: bug#71684: [PATCH v2] doc: Document the peek and pk procedures. Date: Wed, 10 Jul 2024 15:48:53 -0400 Message-ID: <877cdtuixm.fsf@gmail.com> References: <87jzi45tyn.fsf@gmail.com> <20240702164418.11886-1-juli@incana.org> <878qy9glbd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13715"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71684@debbugs.gnu.org, Juliana Sims To: Simon Tournier Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Jul 10 22:22:32 2024 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sRdpg-0003Ll-7z for guile-bugs@m.gmane-mx.org; Wed, 10 Jul 2024 22:22:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRdpH-0008NT-U6; Wed, 10 Jul 2024 16:22:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRdpF-0008N5-Pn for bug-guile@gnu.org; Wed, 10 Jul 2024 16:22:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRdpF-0002tW-Gk for bug-guile@gnu.org; Wed, 10 Jul 2024 16:22:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRdpC-0000fo-Hy for bug-guile@gnu.org; Wed, 10 Jul 2024 16:22:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 10 Jul 2024 20:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71684 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch Original-Received: via spool by 71684-submit@debbugs.gnu.org id=B71684.17206429152570 (code B ref 71684); Wed, 10 Jul 2024 20:22:02 +0000 Original-Received: (at 71684) by debbugs.gnu.org; 10 Jul 2024 20:21:55 +0000 Original-Received: from localhost ([127.0.0.1]:50384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRdp3-0000fN-6T for submit@debbugs.gnu.org; Wed, 10 Jul 2024 16:21:54 -0400 Original-Received: from mail-qt1-f173.google.com ([209.85.160.173]:56754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRdov-0000f5-45 for 71684@debbugs.gnu.org; Wed, 10 Jul 2024 16:21:48 -0400 Original-Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-449f23df593so815011cf.1 for <71684@debbugs.gnu.org>; Wed, 10 Jul 2024 13:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720642839; x=1721247639; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VQpEO1CjFBJKEqjvJAhEIn4V7ZpOjdKIkHieZyg+Br0=; b=Q0IShakeevJUE1ZY92Yy2Pz8y7sB4scxme+cgg8/YxCjRpIAC5oNf8TKmXoo5mHGkq jBtGOoUYUljQrvc3owzw/WzJPm9HBBX8XhSFi1VSAuSCZXzObAub9uOLsiGQqcbC4zkc J5d78HUKAPpJOaO27ltbYaosx04pPn8BonMO1NCv6cN/1x5oL9doMog5M+a444ImLyyc IXTlIySgDExjAFVni1XN0p1/7qI2ZuM2AvL89GXRE3/vqMuY9/V1zP5NeNp7DFtoEzFg ToQ8XE2ZMfmeTXxbDH5F5Fb5kXs7KLEIADXL9qYilRRU5xMXdO/zPVBZgpsa7+RSto3U bzOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720642839; x=1721247639; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VQpEO1CjFBJKEqjvJAhEIn4V7ZpOjdKIkHieZyg+Br0=; b=C30wFkbinYMPWMskAb4Hsi93XyfKxEuzuBoioR1mhCUdXn8XW2Tij/e9raWctoyX0w kPEz0E0CO7cn3rwjcXUY3HcYY8qmLPBg/c3//ywD4dcwwKQz3vwskrzf8ymhnxKN8Kmk h5ZQ/+z8K1AX9ESkUh/fa3WY+CtsqFN0lejE+1aqY+W94Pq3faFNs0vXI5i+q+HezSpz AuqOzM0m8ptaUCcvRvgcPg3Es3A2JqC3Ey79AXIIa0QoZLMa/8z0xncZ020bEUNlAhwV mibesKfr4Pclqu8t8LhSUTkmIAX10Ye7sAliLTBh0eY+C8YtVaIGnwrvnwXSW48g1vAJ nx0w== X-Forwarded-Encrypted: i=1; AJvYcCVu2rexir0uWmN4JtZ6+okhMSPYy1HxqBtEa7tN3IJaK+oJ/ZnkgWli5HQZjU4ubY5HWzg+/vA3n3sCrjH1u3snqnyj5fw= X-Gm-Message-State: AOJu0YyWdjjFEmpHEzFusUzJeSAjHwsIDzqmNlxczoEQA8eIM7qlh0oZ Ifce+tmzLFEQDsVP1dmq+VO7yAJ+skTGL/rgEIE0rXl2mfG3RP21sBEw6w== X-Google-Smtp-Source: AGHT+IFtsHTbQ5qdaRG3q9xtGh2+PxeKhDuwlt+ylylDupe5pZCi7z7iMIJnQuxCKynPsBxH+bTZOw== X-Received: by 2002:a9d:6a45:0:b0:703:6c93:ac2 with SMTP id 46e09a7af769-70375b40388mr6817183a34.27.1720640935084; Wed, 10 Jul 2024 12:48:55 -0700 (PDT) Original-Received: from hurd (dsl-205-236-230-213.b2b2c.ca. [205.236.230.213]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b61b9ebf36sm19715606d6.45.2024.07.10.12.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jul 2024 12:48:54 -0700 (PDT) In-Reply-To: <878qy9glbd.fsf@gmail.com> (Simon Tournier's message of "Wed, 10 Jul 2024 20:21:10 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10890 Archived-At: Hi Simon, Simon Tournier writes: [...] >> +@lisp >> +(map (lambda (v) >> + (if (number? v) >> + (number->string v) >> + (pk v))) >> + '(1 "2" "3" 4)) >> +@result{} >> + >> +;;; ("2") >> + >> +;;; ("3") >> +("1" "2" "3" "4") >> +@end > > For what it is worth, I would suggest something as: > > (map (lambda (v) > (if (number? v) > (number->string v) > (begin > (pk 'else v) > (pk (string-append "-" v "0"))))) > '(1 "2" "3" 4)) > > For two reasons: > > 1. =E2=80=99begin=E2=80=99 helps to mark a sequence of expressions; IMHO= , that=E2=80=99s a good > habit when playing with =E2=80=99pk=E2=80=99 for debugging purpose. > > 2. it exposes that =E2=80=99stuff=E2=80=99 above can be anything. > > > Well, my suggestion could be two other examples in addition to the > current one instead of the complexification. I think I'd prefer more simple examples than a single more complicated one, if we go that route. I think the text explained 'peek' clearly already, though, so I personally would opt to leave it as is, especially since adding a 'begin' block to showcase multiple 'pk' calls goes against the merit of peek of being least intrusive (it prints then returns the value, so the code structure needs not be changed). --=20 Thanks, Maxim