From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.user Subject: Re: Meaning of <=> in the context of procedures Date: Wed, 04 Aug 2021 13:55:42 +0200 Message-ID: <87bl6dqv9d.fsf@gnu.org> References: 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="32449"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) To: guile-user@gnu.org Cancel-Lock: sha1:1u99huJR8KKEtC0mDSgstKdwNbM= Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Aug 04 13:57:34 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 1mBFWg-0008Lj-A1 for guile-user@m.gmane-mx.org; Wed, 04 Aug 2021 13:57:34 +0200 Original-Received: from localhost ([::1]:45046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBFWf-00005D-51 for guile-user@m.gmane-mx.org; Wed, 04 Aug 2021 07:57:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBFV2-0004NL-DS for guile-user@gnu.org; Wed, 04 Aug 2021 07:55:52 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:38000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBFV0-0002K9-Ut for guile-user@gnu.org; Wed, 04 Aug 2021 07:55:52 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1mBFUx-00063d-Ki for guile-user@gnu.org; Wed, 04 Aug 2021 13:55:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 Thermidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Received-SPF: pass client-ip=116.202.254.214; envelope-from=guile-user@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_C=-1, 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:17667 Archived-At: Hi Mortimer, Mortimer Cladwell skribis: > What does <=> mean/do? > It can be found in guile-json in the (json record) module, line 33: > > 33 #:export (<=> define-json-mapping define-json-type)) > > Not mentioned in the entire Guile manual. Happens to be defined on line 36 > of the module: > > 36 (define <=> '<=>) I’m very late, but in short, ‘<=>’ is used a “syntactic keyword” in the ‘define-json-type’ macro (IOW, it’s among the “literals” of ‘syntax-rules’). “Good practice” these days is that syntactic keywords should be bound. This ‘define’ does just that: binding ‘<=>’. Its actual value doesn’t matter. The advantage of that is that you can renaming bindings (with #:prefix for instance), you can see when two syntactic bindings clash, and so on. Quoth the manual (info "(guile) Syntax Rules"): A literal matches an input expression if the input expression is an identifier with the same name as the literal, and both are unbound(1). Although literals can be unbound, usually they are bound to allow them to be imported, exported, and renamed. *Note Modules::, for more information on imports and exports. In Guile there are a few standard auxiliary syntax definitions, as specified by R6RS and R7RS: -- Scheme Syntax: => -- Scheme Syntax: _ -- Scheme Syntax: ... Auxiliary syntax definitions. These are defined as if with a macro that never matches, e.g.: (define-syntax else (syntax-rules ())) HTH! Ludo’.