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

Re: Twigils

Thread Previous | Thread Next
David Nicol
August 30, 2021 15:22
Re: Twigils
Message ID:
On Fri, Aug 20, 2021 at 7:34 PM Darren Duncan <>

> 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


see what I mean?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About