From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: adriano Newsgroups: gmane.lisp.guile.user Subject: Re: Pretty Printing values from a hashmap Date: Thu, 21 Jul 2022 13:28:43 +0200 Message-ID: <482add0a4e3068b351c48e0e8875bf28741f1d92.camel@riseup.net> References: <86sfmuvne7.fsf@bonfacemunyoki.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20468"; mail-complaints-to="usenet@ciao.gmane.io" To: Munyoki Kilyungi , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Jul 21 13:29:19 2022 Return-path: Envelope-to: guile-user@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 1oEUMo-00055K-OH for guile-user@m.gmane-mx.org; Thu, 21 Jul 2022 13:29:18 +0200 Original-Received: from localhost ([::1]:45306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEUMn-0008Ix-EK for guile-user@m.gmane-mx.org; Thu, 21 Jul 2022 07:29:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEUM0-0008I5-2X for guile-user@gnu.org; Thu, 21 Jul 2022 07:28:28 -0400 Original-Received: from mx0.riseup.net ([198.252.153.6]:46590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oEULx-0002aV-Tx for guile-user@gnu.org; Thu, 21 Jul 2022 07:28:27 -0400 Original-Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4LpVgV4C0cz9sQp; Thu, 21 Jul 2022 11:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1658402902; bh=a7Rjd5yhON5xMUQ2ZMbEv96b+AhJtM1yu5ZHIXirb00=; h=Subject:From:To:Date:In-Reply-To:References:From; b=BcphYWPk1dOb2LTXRF1yb2njRdmOC87crxt2QFiEY2Ku7wX27oaiugXMyZPyhcPbj ZenpQAOH/82JiVbjTz65lbiGq4BHHPZnrxvqzsU6n6oB7eQIiCfqC5u53OMKWRnEGW qqkGB4LaE/RzUvkBLt4EYsNTqfajOkBbCXvaH5/s= X-Riseup-User-ID: C42038B4EA090208C36D039CACC63648B7516EB44BFA5E662A8BAB22FB01F008 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4LpVgS6ChBz5vTc; Thu, 21 Jul 2022 11:28:20 +0000 (UTC) In-Reply-To: <86sfmuvne7.fsf@bonfacemunyoki.com> Received-SPF: pass client-ip=198.252.153.6; envelope-from=randomlooser@riseup.net; helo=mx0.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18443 Archived-At: Il giorno gio, 21/07/2022 alle 12.13 +0300, Munyoki Kilyungi ha scritto: > > Hi!  Say I have a hashmap that has nested hashmaps > that I want to inspect.  Is there a way to just > printing it out on my display in a > straight-forward way without having to loop inside > the key-value pairs?  Printing a hashmap outputs > something like this: > > --8<---------------cut here---------------start------------->8--- > # > --8<---------------cut here---------------end--------------->8--- > The Guile pretty printer doesn't support hashmaps I see 2 options 1) you convert your hashmap into an alist and print that 2) you extend the pretty printer to support hashmaps too and send a patch as for the 2nd option, I was suggested to do so myself, not so long ago but I couldn't bring myself to do that