unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: Mark H Weaver <mhw@netris.org>
Cc: "Ludovic Courtès" <ludo@gnu.org>, 17474@debbugs.gnu.org
Subject: bug#17474: Making *unspecified* equivalent to (values) would seem convenient
Date: Sun, 22 Jun 2014 08:09:14 +0200	[thread overview]
Message-ID: <87zjh5cw6t.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87iontwm5m.fsf@yeeloong.lan> (Mark H. Weaver's message of "Sun,  22 Jun 2014 01:25:41 -0400")

Mark H Weaver <mhw@netris.org> writes:

> ludo@gnu.org (Ludovic Courtès) writes:
>> I’m not completely convinced it makes sense to “specify” the zero values
>> case in this way, but I’d like to hear what others think.
>
> I'm strongly opposed to having core Guile mechanisms automatically
> convert between SCM_UNSPECIFIED and zero values, which is part of what
> David's patch set does.  I'd be glad to explain the reasons for my
> position in a later message, but I don't have time right now.
>
> However, I'm (cautiously) open to the idea of changing (if #f x) and
> some other things to return (values) instead of *unspecified*.  I agree
> that it would be cleaner, though I worry about backward compatibility
> issues.

The C API recommends using SCM_UNSPECIFIED here.  That was never
different.  Consolidating this will not really work without declaring
SCM_UNSPECIFIED and consequently *unspecified* the same as (values).
This strategy is also sketched in a comment by Andy where *unspecified*
is defined.

What this patch does for backward compatibility reasons is treating
*unspecified* as an immediate value in single-value contexts.

This will likely always be the case in the C API where all calls of
"values" are sort of half-transparent anyway.

It is conceivable to eventually deprecate this use in Scheme proper.
This won't be doable without a migration strategy.  The conversions this
patch uses in the Scheme/VM layer are such a migration strategy.  Step 1
would be this patch.  Step 2 would be putting out deprecation warnings.
Step 3 would be removing the automatic conversions.

Compatibility considerations will make the last two steps a large
hurdle.  I don't see a better step 1 towards the goal of letting
(if #f x) return (values).

I readily agree that this is a mess.  Where we disagree is in the
culprit.  You consider this patch the cause of the mess, I consider this
patch consolidation of the SCM_UNSPECIFIED/*unspecified* mess already
designed into GUILE.

> It would have to be done between major releases.

In the current form of the patch, it's surprisingly backwards compatible
but of course one would not call it a mere bug fix.

It will take a number of major releases to get more than step 1 done.
But every journey starts with the first step.

-- 
David Kastrup





  reply	other threads:[~2014-06-22  6:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 11:40 bug#17474: Making *unspecified* equivalent to (values) would seem convenient David Kastrup
2014-05-12 15:53 ` Ludovic Courtès
     [not found] ` <8738gfyoxm.fsf@gnu.org>
2014-05-12 16:58   ` David Kastrup
2014-05-12 19:21     ` Ludovic Courtès
2014-05-12 19:49       ` David Kastrup
2014-06-22  5:25       ` Mark H Weaver
2014-06-22  6:09         ` David Kastrup [this message]
2014-06-21 21:30 ` bug#17474: Another point David Kastrup
2014-06-22  5:17   ` Mark H Weaver
2014-06-22  5:45     ` David Kastrup
2014-08-09  9:17 ` bug#17474: Ping? David Kastrup
2014-08-10 19:12   ` Mark H Weaver
2014-08-10 20:26     ` David Kastrup
2014-08-10 21:48       ` Mark H Weaver
2014-08-10 22:00       ` Mark H Weaver
2015-06-01 14:04         ` David Kastrup

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=87zjh5cw6t.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=17474@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=mhw@netris.org \
    /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).