From: tomas@fabula.de
Cc: guile-devel@gnu.org
Subject: Re: Smart variables, dumb variables
Date: Wed, 14 Aug 2002 10:07:15 +0200 [thread overview]
Message-ID: <20020814080715.GA6068@www> (raw)
In-Reply-To: <87y9bajzfp.fsf@zagadka.ping.de>
On Tue, Aug 13, 2002 at 10:06:50PM +0200, Marius Vollmer wrote:
> Hi,
>
> currently, our global variables are strictly passive containers.
[...]
> I would add a 'flags' field to variable smob (there is room for it),
> with the following flags defined initially:
>
> - SCM_F_VARIABLE_DUMB
>
> When set, the variable is 'dumb' and can be referened and set
> with SCM_DUMB_VARIABLE_REF and SCM_DUMB_VARIABLE_SET,
> respectively. When it is not set, you need to call
> scm_variable_ref and scm_variable_set_x.
>
> - SCM_F_VARIABLE_READONLY
>
> When set, the variable can not be set. You are not allowed to
> use SCM_DUMB_VARIABLE_SET and scm_variable_set_x will result in
> an error.
An attractive idea, indeed. Let's see whether there are objections
from the `language theorists' out there.
I'd propose a slight modification, though: use one flag for the setter,
one for the getter, like so:
- SCM_F_VARIABLE_DUMB_GETTER
When set, the variable has a `dumb' getter and can be
referenced with SCM_DUMB_VARIABLE_REF. Otherwise you
need to reference it with scm_variable_ref.
- SCM_F_VARIABLE_DUMB_SETTER
When set, the variable has a `dumb' setter and can be
referenced with SCM_DUMB_VARIABLE_SET. Otherwise you
need to set it with scm_variable_set_x.
It looks more symmetric ;-) and it's still possible to implement `unsettable'
variables (by appropriately implementing a setter function which does nothing,
complains, whatever seems appropriate). I think it's even more flexible.
Regards
-- tomas
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-08-14 8:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-13 20:06 Smart variables, dumb variables Marius Vollmer
2002-08-14 8:07 ` tomas [this message]
2002-08-14 19:35 ` Marius Vollmer
2002-08-14 20:28 ` tomas
2002-08-14 20:48 ` Marius Vollmer
2002-08-14 21:06 ` rm
2002-08-14 21:09 ` Marius Vollmer
2002-08-15 8:06 ` rm
2002-08-15 8:01 ` Lynn Winebarger
2002-08-15 9:51 ` rm
2002-08-15 14:44 ` Rob Browning
2002-08-15 16:34 ` Marius Vollmer
2002-08-15 17:27 ` rm
2002-08-15 19:43 ` Marius Vollmer
2002-08-15 20:02 ` rm
2002-08-15 20:02 ` Marius Vollmer
2002-08-15 20:25 ` rm
2002-08-17 11:59 ` Neil Jerram
2002-08-19 23:29 ` Marius Vollmer
2002-08-20 12:01 ` rm
2002-08-26 22:06 ` Marius Vollmer
2002-08-15 10:52 ` tomas
2002-08-15 16:36 ` Marius Vollmer
2002-08-14 21:31 ` Rob Browning
2002-08-14 21:45 ` Marius Vollmer
2002-08-15 2:43 ` Rob Browning
2002-08-15 6:29 ` Marius Vollmer
2002-08-15 14:38 ` Rob Browning
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=20020814080715.GA6068@www \
--to=tomas@fabula.de \
--cc=guile-devel@gnu.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).