Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Modern Perl: The Book: The Draft

by jethro (Monsignor)
on Jul 06, 2010 at 14:36 UTC ( #848228=note: print w/ replies, xml ) Need Help??


in reply to Modern Perl: The Book: The Draft

Chapter 7, Encapsulation

The examples shown so far do not describe how to store those instances.

Either "instances" should be "attributes" or the sentence makes no sense to me

Chapter 7, Polymorphism

A Cheese object may have an age() method that lets you determine how long to stow $cheddar so that it becomes sharp

I'm not a native english speaker, but this only became clear after reading on, because 'determine' also has a meaning of ascertain, i.e. "I determined the length of a day to be 10 hours on this planet". Maybe 'decide' or 'define' are less ambiguous.

UPDATE: Chapter 7, Blessed References

An class representing basketball players


Comment on Re: Modern Perl: The Book: The Draft
Re^2: Modern Perl: The Book: The Draft
by ww (Bishop) on Jul 06, 2010 at 16:44 UTC
    At least one source, the free online dictionary (favored by Google when a search is bound to 'dict'), gives chromatic's use as the second choice for 'determine' when used transitively. Personally, I disagree, particularly in this context: 'determine' in the sense of 'ascertain' appears close to optimal.

    "stow" may be otherwise; perhaps "store"?

    But lest any take jethro's reference to his relationship with English as an adverse indicator, my view is that his use of the language puts to shame much of what we see here from individuals whose status as "native English speaker(s)" is self-evident.

      Could it be that you and Anonymous Monk made the same mistake as I did initially of reading the example as if age() was meant as a read-only function?

      As I understand the example, age() is a write-only(!) function, you set the time you want to stow away the cheese in a dark cellar (or you simply stow away the cheese a predetermined time). The following sentence in the book makes that quite clear I think. So 'ascertain' would be exactly the wrong meaning, suggesting reading of a stored value.

      If I'm right, you made my point ;-). And in any case thanks for the compliment.

      PS: If I'm right, the second age() call in the example following the cheese paragraph should have a parameter of "6", "6m" or "6 months"

        I made the mistake of not looking at the paragraph and associated code.
        Of course, the mere existence of a method called name() or age() does not by itself imply the behavior of that object. A Dog object may have an age() which is an accessor such that you can discover $rodney is 8 but $lucky is 3. A Cheese object may have an age() method that lets you determine how long to stow $cheddar so that it becomes sharp; in other words, age() may be an accessor in one class but not in another:
        # how old is the cat? my $years = $zeppie->age(); # store the cheese in the warehouse for six months $cheese->age();
        I would lose the code and change the sentence to
        A Cheese object may have an age() method that stores the cheese in the warehouse for six months; in other words, age() may be an accessor in one class but a mutator in another.
        /me headslaps self.

        In fact, jethro's take is far more plausible than the view behind my dissent.

        From the times of two postings on the topic by an Anonymonk, the content of the direct reply to jethro's node seems to be a retraction of Re^2: Modern Perl: The Book: The Draft... but the notion of age() as a mutator does fit the fact that aging cheese changes (mutates) its character. :-)

        Thus, a re-dissent on that tangential matter: IMO, 6 months is singularly inadequate for sharp! cheddar; far better 12 ...or even, as some of our Wisconsinites pride themselves on doing, for 12 years or more. But, that re-dissent is posited on the notion that the methods used by those in America's dairyland as determined by empirical testing.

        ++ again, jethro

Re^2: Modern Perl: The Book: The Draft
by Anonymous Monk on Jul 06, 2010 at 17:32 UTC
    Or like
    A Cheese object may have an age() method that tells you how long to keep $cheddar for a sharper flavor.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://848228]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-12-22 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (121 votes), past polls