GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Helge Heß (helge@mastodon.social)'s status on Friday, 20-Sep-2024 07:19:47 JST Helge Heß Helge Heß
    • Paul Cantrell

    @inthehands I think the bigger issue/question is that properties are supposed to be idempotent. That's what makes it a property to me.

    In conversation about 10 months ago from mastodon.social permalink
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Friday, 20-Sep-2024 07:19:46 JST Paul Cantrell Paul Cantrell
      in reply to

      @helge
      Wow, that’s an interpretation of the word that’s new to me!

      In conversation about 10 months ago permalink
    • Embed this notice
      Helge Heß (helge@mastodon.social)'s status on Friday, 20-Sep-2024 07:28:51 JST Helge Heß Helge Heß
      in reply to
      • Paul Cantrell

      @inthehands Interesting. A property to me should have no meaningful side effects. I've seen people doing KVC properties and wondering when they run into issues because a property setter also set like 10 other unrelated things.

      In conversation about 10 months ago permalink
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Friday, 20-Sep-2024 07:28:51 JST Paul Cantrell Paul Cantrell
      in reply to

      @helge
      Does this mean that “to change a property” or “set a property” is ill-defined in your lexicon?

      In conversation about 10 months ago permalink
    • Embed this notice
      Helge Heß (helge@mastodon.social)'s status on Friday, 20-Sep-2024 07:36:18 JST Helge Heß Helge Heß
      in reply to
      • Paul Cantrell

      @inthehands No, the operation should just be idempotent, i.e. have no side effects. Like this:
      ```
      final class Mehr {
      var _x = 0
      var y = 0

      var x: Int {
      set {
      _x = newValue
      y += 1
      }
      get { _x }
      }
      }
      ```
      I wouldn't consider `x` a "property" here because calling it 10 times will have side effects unrelated to it. This would be fine:
      ```
      final class Meer {
      var _x = 0

      var x: Int {
      set { _x = newValue * 2 }
      get { _x / 2 }
      }
      }
      ```

      In conversation about 10 months ago permalink
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Friday, 20-Sep-2024 07:36:18 JST Paul Cantrell Paul Cantrell
      in reply to

      @helge
      Ah, no side effects •other than the property state itself• — yes, agreed!

      In conversation about 10 months ago permalink
    • Embed this notice
      Helge Heß (helge@mastodon.social)'s status on Friday, 20-Sep-2024 07:39:49 JST Helge Heß Helge Heß
      in reply to
      • Paul Cantrell

      @inthehands Essentially this:
      ```
      thing.a = 5
      thing.a = 5
      thing.a = 5
      ```
      should modify nothing but `a`. But those could also be composed values, the key thing is that you can assign as often as you want w/o side effects.
      That's what makes a property to me, not whether it is computed or stored.

      In conversation about 10 months ago permalink
    • Embed this notice
      Paul Cantrell (inthehands@hachyderm.io)'s status on Friday, 20-Sep-2024 07:39:49 JST Paul Cantrell Paul Cantrell
      in reply to

      @helge
      Yeah, then in that case, I think our personal definitions are very close.

      In conversation about 10 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.