not-reached

action

Syntax
not-reached (message string-expression)?


Purpose

You can use the not-reached statement to verify that a position in your code that you do not expect to be reached is in fact not reached. OmniMark throws to #program-error (error code 6133) if a not-reached statement is executed. You can add a message to the throw by specifying a message parameter.

For example,not-reached can be useful in branching constructs where all the values used to select a particular action fall within a certain range:

  do scan command
     match "go" =|
         ;go
     match "pause" =|
        ;pause
     match "stop" =|
        ;pause
     else
        not-reached message 'Unknown command "' || command || '"'
  done

Note that not-reached is functionally equivalent to the expression assert false. You should choose whichever form is most expressive in the context you use it in.

Related Syntax