Hi

> The anti-autobox folks (myself among them) are trying to push you into defending the position that everything should be objects, when you've not stated that this should be the case.

Thx finally my message got thru. :)

To be clear: After use autobox you are still free to write push @fruits, 'kiwi', that's perfect TIMTOWTDI! (UPDATE: And it's not turning the primitives into objects!)

> what would read most naturally to me would be "push 'kiwi', @fruits", to mirror English "push kiwi onto fruits"

Thx again, you brought an example I had in mind about how absurd this argument about Perl reflecting natural language is.

For technical reasons the direct object is NOT in first position in Perl's push()¹

BUT with method chaining  $fruits_ref->push('kiwi')->push('banana') reflects naturally:

"Take fruitbasket! Push kiwi! Push banana! ..."

In natural grammar: The indirect object becomes a matter of context!

(Nota bene: I'm not saying this example is better than  push @fruits,'kiwi','banana', it's just a fucking example about the analogies of natural and computer languages)

> I don't see it as a strong benefit in general,

  • One of my vision is to code in Perl and to run it on JS Engines. Contrary to other languages Perl has the flexibility to allow this. And JS is very flexible in extending the core functionality.

    (My example should show a way to achieve this.)

    And JS Engines are universally available in Browsers , in Flash (Action Script) in .NET and Java (Rhino) and the JIT compiler of Chrome and and ...

    OTOH Perl has nothing to cope with IronPython or JRuby, which ARE important in marketing these languages. Code-reuse is alway an issue!

    "Then there's JavaScript, a nice clean design. It has some issues, but in the long run JavaScript might actually turn out to be a decent platform for running Perl 6 on." -- Larry Wall

  • Another vision is to show to the hype folks running to Ruby that all there OO concepts from Smalltalk can be easily backported one-by-one to Perl.

    Cheers Rolf

    ¹) you can't turn the prototype push(\@;@) around, without limiting the list of pushed elements!

    UPDATE: added links.


    In reply to Re^6: What are the drawbacks of autobox? by LanX
    in thread What are the drawbacks of autobox? by LanX

    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.