#1234 No syntax condition raised when using a monitor set to .nil and sending it a message

None
invalid
nobody
None
none
1
2014-01-02
2013-12-31
No

The following programm will cause the .traceOutput monitor to be set to .nil. Sending the .traceOutput monitor a message will not cause a condition, but ends the program in that line:

  -- signal on any  /* uncomment to see a SIGNAL-condition is caused in line # 2 */
  say ".traceOutput~current:" .traceOutput~current
  .traceOutput~say("hi")
  say "---"
  say "about '.traceOutput~destination' ..."
  .traceOutput~destination
  say ".traceOutput~current:" .traceOutput~current
  say "now sending message 'NIXINOXI' to .traceOutput monitor ..."
  .traceOutput~nixiNoxi
  say "now sending message 'SAY' to .traceOutput monitor ..."
  .traceOutput~say("hi")
  say "the end."
  exit

  any:
    say "in ANY, sigl="sigl "condition():" condition() "["sourceline(sigl)"]"

Removing the line comment in the first line will cause a signal condition in line # 2.

Discussion

  • Rick McGuire

    Rick McGuire - 2013-12-31

    Nothing displays because you have disabled the .traceoutput monitor that is used for displaying the error output.

     
  • Rick McGuire

    Rick McGuire - 2013-12-31
    • status: open --> invalid
     
  • Rony G. Flatscher

    Just a question for clarification after sleeping over the documentation of .traceOutput, .debugInput, .error and .input.

    The reason for asking this is as follows: I have been thinking that ooRexx will use the .error monitor in case it has to report a runtime error (e.g. division by 0 as "say 3/0").

    Thinking, that the new monitor objects .debugInput and .traceOutput are intended for allowing trace debug input and trace debug output to be distinguishible/redirectable by changing the destination object (from .input and .error respectively). This also will allow - by changing their destination objects - to distinguish between trace debug input and regular input, as well as trace output and error output.

    As such I would have expected that (runtime) error messages from ooRexx are always sent to the .error monitor directly.

    Currently, I cannot understand, why the following program seems to exit quietly (even if called from another Rexx program that has a SIGNAL ON SYNTAX to intercept a syntax condition):

      .traceOutput~destination   -- remove current destination
      say ".traceOutput~current:" .traceOutput~current
      call abc
      say "---"
      call xyz
      say "--- The end."
    
      ::routine abc  -- cause a syntax error, intercept and return
        signal on syntax
        say "in routine ABC()"
        say 1/0      -- cause a syntax error
        return
        syntax:      -- label for interception
           say "routine ABC(), intercepted:" condition("C") "condition"
    
      ::routine xyz  -- cause a syntax error
        say "in routine XYZ()"
        say 1/0      -- cause a syntax error
        return
    

    Its output is (ooRexx 4.20, rev 9793):

      F:\test\orx\420> testMonitor4.rex
      .traceOutput~current: The NIL object
      in routine ABC()
      routine ABC(), intercepted: SYNTAX condition
      ---
      in routine XYZ()
    

    Currently the documentation seems to not explain this (for me surprising, because unexpected) behaviour when removing the destination object from .traceOutput.

    It seems that the Rexx program above gets stopped without further notice in a way, that is not even interceptable from another Rexx program that calls that program above, with "signal on syntax" active.

    From rexxref.pdf:

    • .traceOutput:

      "This monitor object (see Section 5.4.14, “The Monitor Class”) holds the trace output target object. You can redirect the trace output in the same way as with the output object in the Monitor class example."

    • .error:

      "This monitor object (see Section 5.4.14, “The Monitor Class”) holds the error stream object. You can redirect the trace output in the same way as with the output object in the Monitor class example."

    Comment: it seems to me that the last sentence above was true for ooRexx versions prior to 4.2, which had no explicit .traceOutput monitor object.

    The input monitor objects are documented as:

    • .input:

      "This monitor object (see Section 5.4.14, “The Monitor Class”) holds the default input stream object (see Chapter 14, Input and Output Streams). This input stream is the source for the PARSE LINEIN instruction, the LINEIN method of the Stream class, and, if you specify no stream name, the LINEIN built-in function. It is also the source for the PULL and PARSE PULL instructions if the external data queue is empty."

    • .debugInput:

      "This monitor object (see Section 5.4.14, “The Monitor Class”) holds the default interactive debug input stream object (see Chapter 14, Input and Output Streams). This input stream is the source for all input for interactive debug mode."

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks