Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Howdy!

If you "coerce" a value, you still have the same value, expressed in different units, if you will. For example, 1 (integer) can be coerced into 1.0 (float) without loss of information. However, when you write $a + @b, the operation being performed is not, in my mind, type coercion. There is an implicit operation being performed on @b, but you cannot say the @b is the same thing as the number of elements it contains. The two values are incommensurable.

I am reminded of an advertisement that has been on the air lately that speaks of "miles", "nautical miles" ("a wetter version of miles"), and "square miles" ("a squarier version of miles"), as if they expressed the same thing (before segueing to the point of the advertisement). It's inane to assert that you can somehow compare length with area, just as it does not make sense to think that @z in "$x = $y + @z" can mean "the collection of elements in the array z". Now, the hypothetically legal "@x = $y + @z" could cause @x to contain the elements of @z each with $y added to them, but that's a whole different kettle of fish.

Many of the alleged "type coercions" sleepingsquirrel presents are of this sort, where a variable or expression is being evaluated in an unusual context, causing implicit operations to be performed that extract attributes of the variable rather than its value. Perl does this a lot more than most languages.

Now, the lengthy dissertation I reply to dodges the fact that many of the examples adduced are obfuscated by the misleading comments appended thereto. Warnings are suppressed at key moments; strictures are misrepresented. It still comes across as trollish...

yours,
Michael

In reply to Re^3: strong typing by herveus
in thread (Completely OT) - Hero(i)n programming language on Slashdot by dragonchild

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-23 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found