Event and Exception Handling in ::SHE+ILA:: [$53]

Stylish Woman in Flowing Dress in Neon Alley
20
1
  • Squishy Plushie's avatar Artist
    Squishy Pl...
  • Prompt
    Read prompt
  • DDG Model
    Artflow
  • Access
    Public
  • Created
    1h ago
  • Try

More about Event and Exception Handling in ::SHE+ILA:: [$53]

For example, suppose we want to catch a divide exception, a terminated thread exception, and a "Sense Switch Interrupt" (Alt-SysRq) event.
{? DIV0 : &{ttyout ("Division by zero"); quit();};
BUFHUNG : &{ttyout("Buffer owner has exited, reader thread halted"); quit();};
ALTSYSRQ : &{ttyout("User pressed sense switch");} ?};
The "{? ... ?}" block serves the dual purpose of a catch() block and an event wait (WT$LAN, WT$LOR, WT$SIG) block. It calls a lambda asynchronously (an AST, asynchronous system trap) when an "expected" (as in Maximop) event occurs, and cascades to an outermost "catch all" handler when an "unexpected" event occurs.

Comments


Loading Dream Comments...

Discover more dreams from this artist