Ticket #1448 (assigned RFC)

Opened 12 years ago

Last modified 10 years ago

Modify `throw` opcode to pass through pre-configured resume continuation

Reported by: Austin_Hastings Owned by: whiteknight
Priority: minor Milestone:
Component: core Version: master
Severity: low Keywords: throw, exception, pmc, continuation
Cc: Language:
Patch status: Platform: all

Description

Presently, the throw opcode creates and sets a resume continuation on the exception being thrown.

Since 'resume' is an attribute of the Exception, throw should check first for a preconfigured continuation, and if one exists should preserve it.

(Of course, if unset it should continue to do what it does.)

Change History

Changed 12 years ago by pmichaud

On Tue, Feb 16, 2010 at 01:10:16AM -0000, Parrot wrote:
>  Presently, the throw opcode creates and sets a resume continuation on the
>  exception being thrown.
> 
>  Since 'resume' is an attribute of the Exception, throw should check first
>  for a preconfigured continuation, and if one exists should preserve it.

OOC, how does this differ from 'rethrow'?

Pm

Changed 11 years ago by jkeenan

  • cc jkeenan added
  • type changed from todo to RFC
  • component changed from none to core

Austin,

Can you respond to pmichaud's query or indicate whether this is still a concern?

Thank you very much.

kid51

Changed 11 years ago by whiteknight

  • status changed from new to assigned
  • severity changed from medium to low
  • cc jkeenan removed
  • priority changed from normal to minor
  • platform set to all
  • version changed from 2.0.0 to master
  • owner set to whiteknight
  • type changed from RFC to todo

Changed 10 years ago by whiteknight

  • type changed from todo to RFC

Just because rethrow happens to have a certain signature and semantic now doesn't mean that rethrow will always be usable as a "throw plus a new resume continuation" in the future. In fact, rethrow doesn't have exactly that semantic right now, though the differences are subtle.

I would much rather call a throw a throw, and call a rethrow a rethrow, and not rely on using one op to perform the other operation just because it happens to work that way in a particular revision of Parrot.

Adding a new variant of the throw op which takes a resume continuation would be a good experiment to run. I think the current throw op automatically sets the resume continuation in the exception, so we need to evaluate that behavior to see if it's what we really want. For instance, if an exception already has a resume continuation set, maybe we don't want to blindly overwrite that.

Note: See TracTickets for help on using tickets.