unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.de>
Cc: Paul Jarc <prj@po.cwru.edu>, guile-devel@gnu.org
Subject: Re: The relationship between SCM and scm_t_bits.
Date: Mon, 09 Aug 2004 23:09:01 +0200	[thread overview]
Message-ID: <87zn54yq6q.fsf@zagadka.ping.de> (raw)
In-Reply-To: <40AEF7B3.2020707@dirk-herrmanns-seiten.de> (Dirk Herrmann's message of "Sat, 22 May 2004 08:48:19 +0200")

Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> writes:

> Certainly, the way we convert between scm_t_bits and SCM is
> implementation dependent. However, the definitions for scm_t_bits
> and SCM are IMO a very good way to provide an abstraction of some of
> this uncleanlyness. And, with today's definitions of scm_t_bits and
> SCM, the heap _must_ hold scm_t_bits variables.  Please explain, why
> you think that it is cleaner to say it only holds scheme objects if
> in fact it does not.

The reason is that there exits code that does essentially this:

    scm_t_bits heap_field;

    SCM value = whatever ();
    SCM *ptr = (SCM *)&heap_field;
    *ptr = value;

This is quite unclean.  This variant is cleaner and standards
conformant:

    SCM heap_field;
    
    SCM value = whatever ();
    SCM *ptr = &heap_field;
    *ptr = value;

> What is the reason to change a paradigm, which has for several years
> worked quite nicely, is easily understood, and has helped to find
> and probably also to avoid a bunch of errors?

I don't think that the paradigm has changed fundamentally.  It has
been strengthened, if you will.  The distinction between scm_t_bits
and SCM is still there.

We don't just cast between SCM and scm_t_bits, we use SCM_PACK and
SCM_UNPACK.  Except sometimes a scm_t_bits variable is stored into via
a SCM* pointer, totally ruining the care PACk/UNPACK abstraction.
That exception has now been removed.  I see that as an unconditional
improvement, don't you?

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  parent reply	other threads:[~2004-08-09 21:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-03 15:06 The relationship between SCM and scm_t_bits Marius Vollmer
2004-05-03 16:10 ` Marius Vollmer
2004-05-03 16:21 ` Paul Jarc
2004-05-04 13:53 ` Marius Vollmer
2004-05-04 17:16   ` Paul Jarc
2004-05-04 17:49     ` Marius Vollmer
2004-05-04 18:35       ` Paul Jarc
2004-05-05 10:00         ` Marius Vollmer
2004-05-05 14:58           ` Paul Jarc
2004-05-10 13:42 ` Marius Vollmer
2004-05-15  7:31 ` Dirk Herrmann
2004-05-17 18:09   ` Marius Vollmer
2004-05-15 15:00 ` Dirk Herrmann
2004-05-15 16:42   ` Dirk Herrmann
2004-05-17 19:22   ` Marius Vollmer
2004-05-17 20:17     ` Paul Jarc
2004-05-21 19:37     ` Dirk Herrmann
2004-05-21 20:30       ` Paul Jarc
2004-05-22  6:48         ` Dirk Herrmann
2004-05-23 15:03           ` Paul Jarc
2004-08-09 21:09           ` Marius Vollmer [this message]
2004-08-20 19:17             ` Dirk Herrmann
2004-08-21 16:16               ` Marius Vollmer
2004-10-03  9:09                 ` Dirk Herrmann
2004-10-04 14:12                   ` Marius Vollmer

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=87zn54yq6q.fsf@zagadka.ping.de \
    --to=mvo@zagadka.de \
    --cc=guile-devel@gnu.org \
    --cc=prj@po.cwru.edu \
    /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).