unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: emacs-devel@gnu.org
Subject: Re: master baf1a7a4a0: Turn gv-synthetic-place into a function
Date: Wed, 21 Sep 2022 15:52:42 +0200	[thread overview]
Message-ID: <87edw4bzrp.fsf@web.de> (raw)
In-Reply-To: 87sfklgmba.fsf@dataswamp.org

Emanuel Berg <incal@dataswamp.org> writes:

> Michael Heerdegen wrote:
>
> > A generalized variable is a place (form). You use a function
> > in a place form like you use it in any (normal) form.
> > Just the semantics are different. Like in
> >
> >   (car (gv-synthetic-place ...))
>
> OK, so we have symbols that have one slot for a/the function
> and another for the variable and this is some third
> thing then?

Not really.  Note that `gv-synthetic-place' is a corner case
construct that is useful mostly as a helper or to implement support for
more common generalized variables.  There are currently 0 uses in Emacs.

For place forms in general: the idea is that the language allows you to wrap
a normal form that describes the place of a value - like e.g.
(car (alist-get ...))) - into `setf' (or any other place macro) and that
magically allows you to modify or bind that value.  With other words: you
abstract over the concepts "getter" and "setter" functions, since they
are mirror images in a larger concept, and get something _simpler_: you
then need to remember less function names and are allowed to write
simpler code.

Place forms are like normal forms, but only forms that describe the
place of a value and have support as generalized variables are valid as
place forms.  The semantics are different of course since they are not
exactly evaluated like normal Lisp.  They are transformed before
evaluation happens, but that is something very common in Lisp.  Lisp
programmers are used to the fact that not every list in a Lisp program
is evaluated in the standard way.  Think of arguments macros and special
forms.  Not everything is an expression. (1 2) in '(1 2) is not an
expression meant for evaluation, for example.

For place forms you even don't have to learn new syntax.  There is no
additional third thing where stuff is stored...so I would say my
answer to your question is "no".

Please don't get distracted by the discussion of this internal corner
case thing.

Michael.




  reply	other threads:[~2022-09-21 13:52 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-18 16:13 master baf1a7a4a0: Turn gv-synthetic-place into a function Eli Zaretskii
2022-09-19  6:16 ` Michael Heerdegen
2022-09-19 11:38   ` Eli Zaretskii
2022-09-20  7:28     ` Michael Heerdegen
2022-09-20  7:50       ` Emanuel Berg
2022-09-20 11:19       ` Eli Zaretskii
2022-09-20 14:36         ` Michael Heerdegen
2022-09-20 16:27           ` Eli Zaretskii
2022-09-21  5:40             ` Michael Heerdegen
2022-09-21 14:19               ` Eli Zaretskii
2022-09-21  8:35             ` Emanuel Berg
2022-09-21  8:32           ` Emanuel Berg
2022-09-21 13:52             ` Michael Heerdegen [this message]
2022-09-21 14:20               ` Stefan Monnier
2022-09-21 15:31                 ` Eli Zaretskii
2022-09-21 16:14                   ` Stefan Monnier
2022-09-22 10:47                     ` Lars Ingebrigtsen
2022-09-22 11:53                       ` Michael Heerdegen
2022-09-22 14:27                         ` Michael Heerdegen
2022-09-22 16:30                         ` Augusto Stoffel
2022-09-22 17:27                           ` [External] : " Drew Adams
2022-09-22 17:47                             ` Michael Heerdegen
2022-09-23 15:07                         ` Lars Ingebrigtsen
2022-09-22 12:26                       ` Yuri Khan
2022-09-22 14:11                       ` Howard Melman
2022-09-22 16:45                         ` Eli Zaretskii
2022-09-22 19:55                           ` Howard Melman
2022-09-23  6:19                             ` Eli Zaretskii
2022-09-23 13:42                               ` Howard Melman
2022-09-23 15:49                                 ` Stefan Monnier
2022-09-23 18:05                                   ` Howard Melman
2022-09-23 15:54                                 ` Eli Zaretskii
2022-09-23 18:11                                   ` Howard Melman
2022-09-23 19:00                                     ` Eli Zaretskii
2022-09-23  9:41                           ` Michael Heerdegen
2022-09-23 10:53                             ` Eli Zaretskii
2022-09-23 17:26                               ` Emanuel Berg
2022-09-22 10:56                     ` Michael Heerdegen
2022-09-30 23:18                     ` Emanuel Berg
2022-09-30 23:30                 ` Emanuel Berg
2022-09-19 12:06   ` Stefan Monnier
2022-09-20  7:22     ` Michael Heerdegen

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=87edw4bzrp.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-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.
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).