unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Göran Weinholt" <goran@weinholt.se>
To: Mikael Djurfeldt <mikael@djurfeldt.com>
Cc: Mark H Weaver <mhw@netris.org>, guile-devel <guile-devel@gnu.org>
Subject: Re: REPL and load deifferences (was Re: Proposal for a new (ice-9 history))
Date: Tue, 30 Oct 2018 19:01:58 +0100	[thread overview]
Message-ID: <87y3af71pl.fsf@teapot.weinholt.se> (raw)
In-Reply-To: <CAA2XvwLYWc=r7fry_1Ve9bEsiUtOPrpBgcMpAAVmhwY3=LYqzw@mail.gmail.com> (Mikael Djurfeldt's message of "Tue, 30 Oct 2018 13:20:54 +0100")

Mikael Djurfeldt <mikael@djurfeldt.com> writes:

> And, the attachments...
>
> On Tue, Oct 30, 2018 at 11:21 AM Mikael Djurfeldt <mikael@djurfeldt.com> wrote:
>
>  On Tue, Oct 30, 2018 at 1:55 AM Mikael Djurfeldt <mikael@djurfeldt.com> wrote:
>
>  On Tue, Oct 30, 2018 at 12:55 AM Mark H Weaver <mhw@netris.org> wrote: 
>
>> More precisely, it is a literal
>> identifier recognized by 'match' and related macros, in the same sense
>> that 'else' and '=>' are literal identifiers recognized by the 'cond'
>> macro.

>> R5RS section 4.3.2 (Pattern language) specifies how these literal
>> identifiers are to be compared with identifiers found in each macro use:

>> Identifiers that appear in <literals> are interpreted as literal
>> identifiers to be matched against corresponding subforms of the
>> input. A subform in the input matches a literal identifier if and
>> only if it is an identifier and either both its occurrence in the
>> macro expression and its occurrence in the macro definition have
>> the same lexical binding, or the two identifiers are equal and both
>> have no lexical binding.

Guile's documentation says something else: "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)." What happened to the case
where they have the same binding?

> [...]
> Incidentally, this does *not* throw an error in master (unless I made
> some mistake in this late hour), which then is a bug!

There is a catch for R6RS users of Guile with the standard literals
'else', '=>', etc. They are not bound in Guile's standard library, so if
a library exports 'else' then the built-in 'cond' no longer recognizes
'else' for users of that library.

This is not how other R6RS implementations behave, but IIRC it is
somehow expected that Guile behaves this way. It leads to annoying and
hard to find bugs.

-- 
Göran Weinholt
Debian developer
73 de SA6CJK



  reply	other threads:[~2018-10-30 18:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 14:13 Proposal for a new (ice-9 history) Mikael Djurfeldt
2018-10-29 23:54 ` Mark H Weaver
2018-10-30  0:55   ` Mikael Djurfeldt
2018-10-30 10:21     ` REPL and load deifferences (was Re: Proposal for a new (ice-9 history)) Mikael Djurfeldt
2018-10-30 12:20       ` Mikael Djurfeldt
2018-10-30 18:01         ` Göran Weinholt [this message]
2018-10-30  0:25 ` Proposal for a new (ice-9 history) Mark H Weaver
2018-10-30  1:08   ` Mikael Djurfeldt
2018-10-30  6:20     ` Mark H Weaver
2018-10-30 13:59       ` Mikael Djurfeldt
2018-10-31 16:49         ` Mikael Djurfeldt
2018-11-02 13:35           ` Mikael Djurfeldt
2018-11-02 14:02             ` Mikael Djurfeldt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y3af71pl.fsf@teapot.weinholt.se \
    --to=goran@weinholt.se \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.org \
    --cc=mikael@djurfeldt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).