unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Arne Babenhauserheide <arne_bab@web.de>
To: tomas@tuxteam.de
Cc: guile-user@gnu.org
Subject: Re: GOOPS functional setter
Date: Sat, 14 Jan 2017 18:25:22 +0100	[thread overview]
Message-ID: <87r345mu4d.fsf@web.de> (raw)
In-Reply-To: <20170114100839.GA3366@tuxteam.de>

[-- Attachment #1: Type: text/plain, Size: 1720 bytes --]


tomas@tuxteam.de writes:
> [fset vs clone]
>
>> I think cloning isn't as clear; what we want is something that's the
>> same as the previous instance of the object, but with one field changed.

> Yes, and after having read your post I understood where you came from.
> The naming wouldn't have been discovrable for me right off.
> Now I'm not trying to imply that "clone" is "more right"; actually
> I believe that there are two "modes" at work here. Let me speculate
> a bit:
>
> Perhaps from the more "strictly functional" point of view, the clone
> operation is less important, because, whether the thing is cloned
> behind the scenes or things are arranged by deep compiler magic and
> the clone doesn't happen after all is none of our business. Not the
> cloning is important, but the changed fields. In this world, the
> mutating counterpart (set) doesn't even exists. Clone wouldn't be
> an appropriate name here.
>
> - From the more "naive", "imperative" point of view, it's the clone
> operation what keeps us awake: allocating memory and things. Here
> "clone" is the right word, it seems.
>
> Perhaps what irritates me most is that "fset" is named  after
> an imperative operation (set) and lives in a functional world.
> Or something.

If I did not need a short name, I’d use something like
slot-copy-with-changed. I had an immutable datatype in Python where I
used something equivalent to

(changed event
  #:<slot-to-change> new-value
  #:<other-slot-to-change> other-new-value)

I know that this does not provide a better name by itself, but I hope it
helps finding one.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

  reply	other threads:[~2017-01-14 17:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 19:09 GOOPS functional setter Christopher Allan Webber
2017-01-13 20:56 ` tomas
2017-01-14  2:11   ` Christopher Allan Webber
2017-01-14 10:08     ` tomas
2017-01-14 17:25       ` Arne Babenhauserheide [this message]
2017-01-14 21:16       ` Christopher Allan Webber
2017-01-15  9:31         ` tomas
2017-01-13 21:33 ` Jan Nieuwenhuizen

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=87r345mu4d.fsf@web.de \
    --to=arne_bab@web.de \
    --cc=guile-user@gnu.org \
    --cc=tomas@tuxteam.de \
    /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).