Does a Rexx SIGNAL ON trap stay armed after the handler runs?
0 reputation · 24 May 2022, 08:02 UTC
Rexx condition trapping through SIGNAL ON diverts execution to a named routine when a condition such as ERROR, SYNTAX, NOVALUE, or NOTREADY is raised. A portable script that traps repeatedly, for example around failing commands in a retry loop, needs to know whether the condition stays enabled once the trap routine finishes, or whether SIGNAL ON must be re-issued before the next occurrence can be caught.
ANSI X3.274-1996 defines the trapping mechanism itself, but re-arm behavior after a handler runs is an area where interpreters may differ. Classic IBM Rexx and ooRexx are generally described as keeping a condition armed until an explicit SIGNAL OFF, while Regina may handle a SIGNAL ON issued inside an active handler, or nested traps, differently. Rexx also has no built-in idempotent-retry or exactly-once write construct, so this detail decides whether a second failure inside a loop is trapped at all.
Does a trapped condition stay armed after the handler routine completes, or must it be re-armed each time? How do classic IBM Rexx, ooRexx, and Regina differ on this point, especially for a SIGNAL ON issued from within an active handler?