It's in the caller in your code too, it's just all stuffed into an effect object . . .

No, my code just provided the data for the Effect object to do its job. Your code put actual code (subroutine refs) to do the job. I want all of this information hidden away by the object.

It's domain is already completely covered by Perl

That gets down to a Turing completeness argument. Sure it's already covered. But I want to make a better one.

Your language has to be typed in as a structure that represents a parsed syntax tree which is not so convient

In your opinion. I rather like it.

The example replacement ([ salary => 1.02, '*' ] with $effect->salary *= 1.02), is a matter of syntax. It's not a fundamentally different design.

Your using your own definition of encapsulation to to justify itself.

Hardly mine alone. From the OODBM Manifesto:

We believe that proper encapsulation is obtained when only the operations are visible and the data and the implementation of the operations are hidden in the objects.

This is the standard definition (with some variation) of encapsulation I've allways heard. OO provides one way of doing encapsulation (though it hardly has a monopoly on it).

It's hardly circular. Encapsulation hides, trivial mutators expose. These are mutually exclusive concepts.

You keep talking about trivial mutators. Are non-trivial ones OK? If so what should I do if I change my implementation so that a non-trivial mutator is now trivial?

Any method that modifies the internal state of the object is a mutator. A trivial mutator passes the input to the method directly into the internal state. Doing verification on the value first is an improvement, but can often be replaced with a more rigid design (like giveRaise() and givePromotion()).

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.


In reply to Re^19: Assignable Subroutines by hardburn
in thread Assignable Subroutines by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.