Ticket #483 (closed todo: wontfix)

Opened 5 years ago

Last modified 4 years ago

:invocant flag

Reported by: coke Owned by: whiteknight
Priority: minor Milestone:
Component: core Version: master
Severity: low Keywords: pcc
Cc: Language:
Patch status: Platform: all

Description (last modified by whiteknight) (diff)

Implement the :invocant flag

Change History

Changed 5 years ago by coke

docs/book/ch04_pir_subroutines.pod refers to this ticket to skip the parsing of the sample PIR until we have a decision.

Changed 5 years ago by whiteknight

  • keywords pcc added
  • status changed from new to assigned
  • component changed from none to core
  • type changed from bug to feature
  • owner set to whiteknight

It's been my understanding that :invocant is still on the roadmap of things to add. I would like confirmation about that from Allison to double-check though.

Changed 5 years ago by whiteknight

  • milestone set to 2.0
  • type changed from feature to todo
  • description modified (diff)
  • summary changed from Status of :invocant? to :invocant flag

:invocant is listed in the docs, imcc, and some example PIR (found due to TT #482), but doesn't seem to work, nor is it tested in t/ Is this a leftover that wasn't fully removed?

I confirmed with Allison yesterday that this item is still on the roadmap and is intended to be added to the PCC system sometime in the coming refactors. I'm updating this ticket to be more of a TODO then an RFC.

This item requires some of the upcoming PCC refactors that are being worked on, and likely will want to target PIRC instead of IMCC, depending on how that project progresses during that time.

Changed 5 years ago by chromatic

  • milestone changed from 2.0 to 2.1

Changed 4 years ago by allison

  • milestone changed from 2.2 to 2.5

Changed 4 years ago by jkeenan

Can we get an update on the status of this ticket?

Thank you very much.

kid51

Changed 4 years ago by whiteknight

  • status changed from assigned to new

There hasn't been any movement on this ticket since the PCC refactors. I believe it is still a feature that we want to have, however.

Changed 4 years ago by whiteknight

  • status changed from new to assigned
  • severity changed from medium to low
  • priority changed from normal to minor
  • platform set to all
  • version set to master
  • milestone 2.5 deleted

Changed 4 years ago by whiteknight

  • status changed from assigned to closed
  • resolution set to wontfix

I've been looking at this ticket and am coming to a few conclusions: 1) It doesn't make any sense to jam this logic into fill_params. That function is already too large without adding a bunch of additional special cases. 2) IMCC or another PIR compiler already prepends the invocant to the list of passed arguments, so this part of the logic already exists. The only thing :invocant will allow us to change is the *human readable* name of the variable that the invocant is stored in. This is strictly in the purview of the compiler, not libparrot or PCC. 3) A lot of logic in IMCC relies on the fact that the invocant is named "self". Changing this to be a variable is going to introduce a lot of pain that we don't really want to deal with.

I don't think we want to implement :invocant in the current system now.

That said, there are still use-cases where we would like to obtain a reference to the current invocant object without relying on the "self" keyword in PIR or any particular behavior in IMCC. For that, I think we can do this little sequence:

.param pmc signature :call_sig
.local pmc me
me = getattribute signature, "current_object"

I don't see any value for doing this on the caller-side, since we could easily replace this:

$P0($P1 :invocant)

with this:

$P1.$P0()

I am going to remove references to :invocant from the docs and examples, and then close this ticket. If we decide that we really want to implement this feature, we can re-open this ticket or (preferrably) open a new ticket with specific details about how it should be done.

Note: See TracTickets for help on using tickets.