In Perl5 today, scalars are values and objects are references, but we deal with the reference somewhat explicitly, so this is not confusing.
If Perl6 says "everything is an object" and blurs the distinction between int and INTEGER, provides transparent promotion to bignums and bigrats, etc., then where are we?
Consider today, if you have $a=$b; if $b holds an integer, than that's a scalar in Perl5 and this makes a new copy; subsequent changes to $b will not affect $a. But if $b holds a bignum class object, then the assignment makes a shared reference to the real object. Some handwaving in overloading mitigates this. But I see the issues getting worse in Perl6.
So, what's the current reasoning? Larry wrote about more transparent promotion of primitive to object than the boxing/unboxing of dotnet, but is that only leading us down the road to Java style value/reference inconsistancy?
—John
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.