From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.user Subject: Re: #:printer filed in language specification. Date: Sat, 18 Sep 2021 16:47:56 +0200 Message-ID: References: <66ede8b9-6e56-cb7a-28d2-825dc93ef8cd@cock.li> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-TdytjTKJ7Sw+gBpgf4hU" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19839"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 To: Justin Veilleux , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Sep 18 16:48:30 2021 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 1mRbdl-0004yq-VE for guile-user@m.gmane-mx.org; Sat, 18 Sep 2021 16:48:30 +0200 Original-Received: from localhost ([::1]:46746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRbdk-0007ta-MV for guile-user@m.gmane-mx.org; Sat, 18 Sep 2021 10:48:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRbdM-0007tD-DY for guile-user@gnu.org; Sat, 18 Sep 2021 10:48:04 -0400 Original-Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:56562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRbdK-0006fE-MV for guile-user@gnu.org; Sat, 18 Sep 2021 10:48:04 -0400 Original-Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id vSnw2500W0mfAB401SnxGw; Sat, 18 Sep 2021 16:47:59 +0200 In-Reply-To: <66ede8b9-6e56-cb7a-28d2-825dc93ef8cd@cock.li> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1631976479; bh=BmYryMOrlnSMS5fgceREw/zf8hy0QAKMddyDdlHIMwE=; h=Subject:From:To:Date:In-Reply-To:References; b=uIMWVNgdKpdzfCkSlsdzHwae8LXhgLn8652Fj7Fnxt23Mil9K+gdpYf3aWsMQNsGJ 2YrqLu0pw+UMkeYRga96xeniy0PzaydW6XY6F8lB3ycIn/il7bHrc2/Bq18hrpOITD 7VbIrKuEIFkxblgZ1UFil/H2uwLe5Osm2wxZ6Vw+3+fOFBI3DHKMomkCFkV8RsiIDx xaeqss7u34q1Miu1JTKWMO9h6FxB2PjtspRvsAExWUtes3bO3LQ9+KfiXF4scSeIfg YaZ7bufhoOkBejowVzoDBfc6yIxlK4m9tgeSX9sST3niQ3V8eNi7lXxwi1hzRledMb NS3Uw5vBKXMPg== Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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:17747 Archived-At: --=-TdytjTKJ7Sw+gBpgf4hU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Justin Veilleux schreef op vr 17-09-2021 om 18:50 [-0400]: > It works relatively well. However, I also wanted it to print a human=20 > readable version of the procedures created. (It is hard to tell whether= =20 > # is a correct church encoding of the number 3)= =20 > With a lot of fiddling, I managed to write a function that turns a=20 > procedure into an S-expression. The #:printer is only used by things like "guild compile -o ..." I think. One option is to create =E2=80=98applicable structs=E2=80=99 (unfortunately= they aren't documented), setting the procedure to the actual procedure, and the record printer (set-record-type-printer!) to something printing the S-exp of the applicable struct. Greetings, Maxime --=-TdytjTKJ7Sw+gBpgf4hU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYUX8HBccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mn/AP0RZOU94hVum0Qg2j+sKFbBP5Re evr7SwqmMS77XRyLWwD/etY3ACHy0M1PYkKBbKacfCHa6E3guHhdtEtLdU6h5AM= =N2eI -----END PGP SIGNATURE----- --=-TdytjTKJ7Sw+gBpgf4hU--