Ticket #1066 (closed todo: invalid)

Opened 5 years ago

Last modified 4 years ago

Add %(...) expression to NQP

Reported by: Austin_Hastings Owned by: pmichaud
Priority: minor Milestone:
Component: PCT Version: 1.6.0
Severity: low Keywords:
Cc: Language:
Patch status: Platform:

Description

Presently, NQP supports circumfix operators:

$(...) - which requests the .ast of an expression

@(...) - which requests the .list of an expression

Since Captures have both a hash part and a list part, please add

%(...) - which requests the .hash of an expression

Change History

Changed 5 years ago by bacek

JFYI, circumfix $(...) is deprecated.

Changed 5 years ago by Austin_Hastings

Yes, but $(...) is the one that calls a magic built-in instead of doing something Perl-ish. I suspect the replacement will be for $(...) to invoke EXPR.'scalar' and then have the PAST nodes equate .ast with .scalar.

Changed 5 years ago by pmichaud@…

On Sat, Sep 26, 2009 at 07:31:46AM -0000, Parrot wrote:
>  Presently, NQP supports circumfix operators:
> 
>  $(...) - which requests the .ast of an expression

This is deprecated -- see TT #459.

>  @(...) - which requests the .list of an expression
> 
>  Since Captures have both a hash part and a list part, please add
> 
>  %(...) - which requests the .hash of an expression

Will do.

Pm

Changed 5 years ago by pmichaud@…

On Sat, Sep 26, 2009 at 12:12:07PM -0000, Parrot wrote:
>  Yes, but $(...) is the one that calls a magic built-in instead of doing
>  something Perl-ish. I suspect the replacement will be for $(...) to invoke
>  EXPR.'scalar' and then have the PAST nodes equate .ast with .scalar.

The correct replacement is to change occurrences of "$($foo)" to "$foo.ast" .

If/when we retain the $(...) syntax, it will undoubtedly invoke ".item".  

However, invoking .item on Match objects will return the Match object
itself and not any component of the Match object.  The true and
correct way to get at the ast object is to use ".ast".  (At least that's
correct for this year -- can't make any promises about 2010.  :-)

Pm

Changed 4 years ago by jimmy

  • status changed from new to closed
  • resolution set to invalid

compilers/nqp is no longer around. Please use NQP-rx instead, and all the request had been migrated to  http://wiki.github.com/perl6/nqp-rx/requests.

Note: See TracTickets for help on using tickets.