in reply to Re^5: Psychic Disconnect and Object Systems
in thread Psychic Disconnect and Object Systems

Djees, then don't use Moose. Claiming odometers need setters because otherwise it cannot be implemented in Moose is just a reason to not use Moose. The AM came with the example of the odometer as "real world example of a read-only variable that cannot be recalculated".

I don't think Detroit will start equiping odometers with knobs to set the value just because Moose cannot simulate it.

  • Comment on Re^6: Psychic Disconnect and Object Systems

Replies are listed 'Best First'.
Re^7: Psychic Disconnect and Object Systems
by ikegami (Patriarch) on Apr 19, 2011 at 04:04 UTC

    The "problem" isn't specific to Moose. Perl itself provides even less.

    Perl doesn't have an infatuation with enforced privacy. It would prefer that you stayed out of its living room because you weren't invited, not because it has a shotgun
    — Larry Wall

    Mind you, the internal setter in "conventional" objects is usually direct hash access rather than a method, but that's no more private that Moose's setters.

Re^7: Psychic Disconnect and Object Systems
by BrowserUk (Patriarch) on Apr 19, 2011 at 00:11 UTC
    I don't think Detroit will start equiping odometers with knobs to set the value just because Moose cannot simulate it.

    Do you anticipate that they will define a class that will be instantiated only once?

    Or manufacture different mechanical/electrical counting mechanisms for each combination of engine, gear-train, final drive and wheel size, just so that the Odometer class getter can read directly from the volatile hardware register that counts directly in miles? Which would mean they'd need to double the number of counting mechanisms so that the register counted directly in kilometres on export models.

    Because unless the miles/kilometres attribute was incremented directly by the hardware, something has to cause it to count.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.