develooper Front page | perl.perl6.users | Postings from June 2018

Re: mixin syntax: does vs but

Thread Previous | Thread Next
From:
JJ Merelo
Date:
June 12, 2018 19:15
Subject:
Re: mixin syntax: does vs but
Message ID:
CAJoLtgdNMuo9yS=_3bq-qHZ8bXEFC1AJ9b0vNNEnb4D-n0xRcQ@mail.gmail.com
El mar., 12 jun. 2018 a las 21:11, Brandon Allbery (<allbery.b@gmail.com>)
escribió:

> I should clarify this, but I'm not recalling full details at the moment
> which is why I didn't originally.
>
> Perl uses a metaobject protocol (MOP, which you'll see in various places
> in the docs). The "macro" to access the metaobject is the .HOW
> pseudo-method. If you do this for a normal class or object of that class,
> you get Perl6::Metamodel::ClassHOW back. This is what the .^method syntax
> is accessing; it's short for (thing).HOW.method((thing), ...). The
> metaclass doesn't magically know its children, so the object has to be used
> once to get at its metaclass and a second time to tell the metaclass what
> it is to introspect.
>
> I'm not seeing documentation for what .WHAT actually does; it (correctly)
> notes that it's implemented specially within the compiler (hence "macro")
> but not how you achieve it otherwise. Then again, .HOW has the same issue;
> there's a bit of a bootstrapping issue with getting at the metamodel, you
> need to have it first. Which is why it's wired into the compiler and gets
> those uppercase pseudo-method names.
>

All the metamodel is not exactly part of the language; it's part of the
compiler. So it's in the gray NOT-SPECCED zone regarding documentation of
"Perl 6" the language, as oposed to "Perl 6, the implementation by Rakudo".
But it's a gray zone and sometimes you fall short of documenting things
like WHAT. I'll see what we can in that area.

JJ

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About