From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: #:printer filed in language specification. Date: Sun, 19 Sep 2021 12:11:49 +0000 Message-ID: References: <66ede8b9-6e56-cb7a-28d2-825dc93ef8cd@cock.li> 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="37595"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Guile User To: Maxime Devos Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Sep 19 14:12: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 1mRvgM-0009cY-Ke for guile-user@m.gmane-mx.org; Sun, 19 Sep 2021 14:12:30 +0200 Original-Received: from localhost ([::1]:49134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRvgL-0002tW-2N for guile-user@m.gmane-mx.org; Sun, 19 Sep 2021 08:12:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRvfp-0002tI-4l for guile-user@gnu.org; Sun, 19 Sep 2021 08:11:57 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:58153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRvfn-0002UQ-4G for guile-user@gnu.org; Sun, 19 Sep 2021 08:11:56 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id DB313240104 for ; Sun, 19 Sep 2021 14:11:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1632053510; bh=OBuEGQTrk9gSJ6JrBNTxlJq9g9+0Mog/Xais1fmrk9c=; h=Subject:To:Cc:From:Date:From; b=Tfuv8vndZQcsKWHfne0kdNj8xe5m5+CbdeYJmGeZsqnl1vJWeBHc/ivluXxtlKIBE znzXlIJB1xaiQoaGwiPTy7fdEFSzpeB+2n/FRCHbOr8cMxkbZkgyDjOwJwD6ltOzEI RdnBwVnnh6ntOp1DXo3h8EnCC4AfPwznsIoLdqaU2y+a29CKLangG8zVvxhWtW+vcb rqf47AmBoFaqGccjSy6YYjQbHBC22AftQOfdlBbcnVSYt7owsFFlOZ4mGQNGVwtz0y CAx9dWzD+v13iQK53qav/WArgCnVQ+zDVtxaK+OsgeEfs0CcPlrbxgMXaBgWeIuvlQ LaNhOLSLGQtOA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HC64Q0MZRz9rxf; Sun, 19 Sep 2021 14:11:49 +0200 (CEST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=zelphirkaltstahl@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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:17755 Archived-At: Hi Maxim! Do you know of any simple example anywhere for applicable structs? I might have another use for them. Regards, Zelphir On 9/18/21 4:47 PM, Maxime Devos wrote: > 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 >> readable version of the procedures created. (It is hard to tell whether >> # is a correct church encoding of the number 3) >> With a lot of fiddling, I managed to write a function that turns a >> procedure into an S-expression. > The #:printer is only used by things like "guild compile -o ..." I think. > > One option is to create ‘applicable structs’ (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 -- repositories: https://notabug.org/ZelphirKaltstahl