Here are the relevant parts of S12 regarding automatic generation of accessors:

Attributes

Attributes are stored an an opaque datatype, not in a hash. Not even the class has to care how they're stored, since they're declared much like ordinary variables. Instead of my, use has:

class Dog is Mammal { has $.tail is rw; has @.legs; has $:brain; ... }
Public attributes have a secondary sigil of dot, indicating the automatic generation of an accessor method of the same name. Private attributes use a colon to indicate that no public accessor is generated. Some traits are copied to the accessor method. The rw trait causes the generated accessor to be declared rw, making it an lvalue method. The default is a read-only accessor.
and the class openness stuff:
Classes are open and non-final by default, but may easily be closed or finalized by an application if nobody issued an explicit compile-time request that the class stay open or non-final.

Regarding "Passing code blocks around as macros", you have no better choice than to read S4, which pretty much answers your question, though, I am not sure the exact syntax to mimic the behavior you refer to. In my understanding, Perl 6 blocks and subs are just continuations, which opens up some neat generalizations here.

Regarding your comments on Python, I can not really help you here: I pretty much like Python, but every time I decide to use it for some specific tasks, I always end up with a nice Perl script...:-)

rg0now


In reply to Re: Perl 6 and Ruby on Rails by rg0now
in thread Perl 6 and Ruby on Rails by mattr

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.