develooper Front page | perl.perl5.porters | Postings from August 2021

Re: Twigils

Thread Previous | Thread Next
From:
David Nicol
Date:
August 30, 2021 15:22
Subject:
Re: Twigils
Message ID:
CAFwScO-jeF_yFVdvMHn1RR22cmTrtF8p3KdPOadvJ3JAWJdcmg@mail.gmail.com
On Fri, Aug 20, 2021 at 7:34 PM Darren Duncan <darren@darrenduncan.net>
wrote:

> On 2021-08-20 8:25 a.m., David Nicol wrote:
> > this would be a nice use case for a more robust macro language / source
> > rewriter. The twigils could get rewritten into valid miniperl. As well
> as a lot
> > of core features, for a general refactoring of the parsing steps.
> Leading to
> > "perl in perl" which AFAIK nobody has actually followed through with.
>
> The use of a source rewriter for this would imply that the proposed use of
> Twigils is a short-hand for something else.
>
> However, in this case the Twigils ARE the FUNDAMENTAL feature syntax, they
> are
> the ONLY way to express what they are intended for, which is direct access
> to
> slots, which are a new fundamental concept implemented in core and not
> implemented over something that already exists.
>

Except -- in the macro rewriting daydream, lots of other core syntax gets
rewritten too. Anyway, the suggested question appears to be, what would the
twigil expression get rewritten to?

Presuming every method starts by defining $context (whatever that is),
$.slot would get rewritten to something like

drumroll please

          CORE::Corinna::twigil_access($context,'slot');

see what I mean?

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