unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: raeburn@raeburn.org, emacs-devel@gnu.org
Subject: Re: emacs and guile (Re: ehelp woes, or why I hate a module that I love so much)
Date: 19 Jul 2002 20:25:20 +0200	[thread overview]
Message-ID: <87d6tjshgv.fsf@zagadka.ping.de> (raw)
In-Reply-To: <200207191654.g6JGsfu27015@aztec.santafe.edu>

Richard Stallman <rms@gnu.org> writes:

>     Some involve changing Guile's symbol representation to have the extra
>     fields.
> 
> If that gives good and clean results, we should use that method, for
> efficiency's sake.

We already have two extra fields on symbols, one for a function and
one for a plist.  Access to these slots is very fast since they are in
symbol header itself.

For additional fields, there is 'make-object-property'.  This function
returns a procedure-with-setter so that can you do, for example,

    (define symbol-foo (make-object-property))

    (symbol-foo 'x)
    => #f
    (set! (symbol-foo 'x) 123)
    (symbol-foo 'x)
    => 123

make-object-property is implemented with a hash table of alists.  If
that is too slow, we could try to speed it up.  For example, the
getter of a property might secretly use the plist of a symbol instead
of the hash table.


But note that in Guile, a symbol does not really have a value.
Symbols are used to name variables relative to some module, and these
variables have values.  We could extend this by having more than one
symbol->variable mapping per module.  For Elisp, there could be two:
one for 'variable values' and one for 'function values'.  We could
then add some primitive syntax to Guile to select a particular
mapping, for example

    Elisp: (foo foo)

could be translated into

    Guile: ((#:func foo) foo)

The form (#:func foo) would use the function mapping when looking up
the variable for foo, while the argument position will use the default
mapping.

The lookup will be done when the code is executed for the first time
(or when it is loaded, should we have a compiler) and subsequent
executions will use the variable directly.

This scheme would allow us to have function values that are also
subject to the module system, just like the normal variable values.

(I have not thought about how well this all fits with dynamic scoping,
tho...)

You might also want to talk to Neil Jerram <neil@ossau.uklinux.net>,
his work on Elisp support has progressed quite far already.

  parent reply	other threads:[~2002-07-19 18:25 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-25 14:50 ehelp woes, or why I hate a module that I love so much Juanma Barranquero
2002-06-25 15:06 ` D. Goel
2002-06-25 15:41   ` Juanma Barranquero
2002-06-26 22:24 ` Richard Stallman
2002-06-27 17:11   ` Juanma Barranquero
2002-06-27 19:57     ` Stefan Monnier
2002-07-02 15:02       ` Juanma Barranquero
2002-07-02 15:18         ` Stefan Monnier
2002-07-02 15:50           ` Juanma Barranquero
2002-06-29  8:41     ` Richard Stallman
2002-07-02 15:15       ` Juanma Barranquero
2002-07-02 15:49         ` Eli Zaretskii
2002-07-03 11:16           ` Juanma Barranquero
2002-07-03 20:57         ` Richard Stallman
2002-07-03 21:32           ` Simon Josefsson
2002-07-04  5:09             ` Eli Zaretskii
2002-07-04  7:58           ` Juanma Barranquero
2002-07-04 10:13             ` Eli Zaretskii
2002-07-04 11:52               ` Juanma Barranquero
2002-07-06 10:38                 ` Eli Zaretskii
2002-07-04 11:02             ` Simon Josefsson
2002-07-04 12:08               ` Juanma Barranquero
2002-07-04 12:19                 ` Miles Bader
2002-07-04 13:31                   ` Juanma Barranquero
2002-07-04 14:02                   ` Simon Josefsson
2002-07-04 14:00                 ` Simon Josefsson
2002-07-04 15:20                   ` Juanma Barranquero
2002-07-17  2:58                     ` emacs and guile (Re: ehelp woes, or why I hate a module that I love so much) Ken Raeburn
2002-07-17  7:13                       ` Juanma Barranquero
2002-07-17  9:11                       ` Kai Großjohann
2002-07-18 14:54                         ` Richard Stallman
2002-07-18 21:45                         ` Ken Raeburn
2002-07-18 14:55                       ` Richard Stallman
2002-07-18 20:13                         ` Ken Raeburn
2002-07-19 13:03                           ` Andreas Schwab
2002-07-19 16:24                             ` Ken Raeburn
2002-07-19 16:54                           ` Richard Stallman
2002-07-19 17:51                             ` Ken Raeburn
2002-07-18 14:56                       ` Richard Stallman
2002-07-18 19:54                         ` Ken Raeburn
2002-07-19  4:23                           ` Stefan Monnier
2002-07-19 12:56                             ` Ken Raeburn
2002-07-19 13:34                               ` Stefan Monnier
2002-07-19 14:16                                 ` Andreas Schwab
2002-07-19 15:04                                   ` Stefan Monnier
2002-07-19 16:54                           ` Richard Stallman
2002-07-19 17:48                             ` Ken Raeburn
2002-07-19 18:25                             ` Marius Vollmer [this message]
2002-07-20  0:35                               ` Richard Stallman
2002-07-20 12:00                                 ` Marius Vollmer
2002-07-21 20:14                                   ` Richard Stallman
2002-07-19 16:54                           ` Richard Stallman
2002-07-04 19:07             ` ehelp woes, or why I hate a module that I love so much Henrik Enberg
2002-07-05  0:49               ` Juanma Barranquero
2002-07-05 11:15                 ` Per Abrahamsen
2002-07-05 10:48             ` Richard Stallman

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/emacs/

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

  git send-email \
    --in-reply-to=87d6tjshgv.fsf@zagadka.ping.de \
    --to=mvo@zagadka.ping.de \
    --cc=emacs-devel@gnu.org \
    --cc=raeburn@raeburn.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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