[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Meaning of <=> in the context of procedures

From: Ludovic Courtès
Subject: Re: Meaning of <=> in the context of procedures
Date: Wed, 04 Aug 2021 13:55:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

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

“Good practice” these days is that syntactic keywords should be bound.
This ‘define’ does just that: binding ‘<=>’.  Its actual value doesn’t

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 ()))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]