On calling ^DIM, while it would protect most types of errors if used properly (unless the indirected statement had indirection in it ;-), would be really slow for any significant volume of calls. It is a MUMPS syntax parser written in MUMPS.

This is the danger of dynamic, late binding unless you want to go to compile or on-the-fly compiling.  But hey, along with the danger comes the great flexibility.  Do you want to have your cake and eat it to?  ;-)   ;-)

Kevin Toppenberg wrote:
See below

On 2/11/06, Jim Self <[EMAIL PROTECTED]> wrote:
  
Kevin,
What do you want to happen when the error is detected?
    

I would want the function to have a chance to return a 'failure' value.


  
Your third example would give a syntax error. I would expect this to be a programming
error.
    

Not really.  In my debugger program, I have the ability, while
stepping through the program, to dump out arrays.  My array-display
function takes a variable name (similar to the pRef in my example).

It has been working well, until I accidentally passed it an invalid reference.


In my work, it seems that the standard error response of logging the error and
  
halting (or dropping back to the MUMPS shell) is generally the best way to handle these
kinds of errors, unless you can catch them much earlier (composition rather than use of
the construct).

If pRef is expected to be a literal global reference then a function to check its syntax
would be pretty easy to write.

    

In my case, it is supposed to be anything the user wants it to be, and
it is the job of the function to screen out erroneous input.

Thanks
Kevin


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

  

Reply via email to