Go to the first, previous, next, last section, table of contents.


]warn

Function: ]warn { [event] -> }
file: 01-C-event.t
package: muf
status: alpha

This function is the standard way for the MUF application programmer to signal detection of an dangerous or dubious event which does not actually prevent computation from proceeding.

The argument should be a valid event block, containing at minimum a event, and normally also a :formatString describing the problem:

[   :event    .err.simpleError
    :formatString "The snarkle got frobulated."
|

The ]warn function first establishes a muffleWarning restart, then ]signals the event, then if ]signal returns (indicating no handler decided to suppress the warning by invoking the muffleWarning restart) issues a warning message and returns normally.

The ]warn function is currently implemented as:

: ]warn { [] -> }

    ( Establish a 'muffle tag that returns to caller: )
    withTag muffle do{

        ( Establish a 'muffleWarning restart jumping to 'muffle: )
        [   :function :: { -> ! } 'muffle goto ;
            :name     'muffleWarning
            :reportFunction "Continue from ]warn call."
        | ]withRestartDo{

            ( Issue the requested signal: )
            |dup[ ]signal

            ( Write warning to errorOutput: )
            @$s.errorOutput ]reportEvent
        }
        muffle
    }
;

As a convenience, an warn function is also available, accepting a single string. It is currently implemented as

: warn { $ -> } -> formatString

    [   :event .err.simpleError
        :formatString formatString
    | ]warn
;

See section ]cerror. See section ]error.


Go to the first, previous, next, last section, table of contents.