MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

raise() built-in...



I finally remembered the reason that I would prefer a 4th argument to
raise() over a reraise; statement.  A lot of times I've had a loop where I
wanted to call a series of verbs and still let them trace back, but not have
them interfere with the normal operation of the verb.  Right now, that's
usually done by putting a fork() around the verb call but that has a number
of drawbacks and can't be used if you want a return value or if you need the
verbs to run before the next segment of code.  If there was a 4th argument
to raise(), something like this could be done:

  count = 0;
  for x in (calls)
    {obj, vrb, arg} = x;
      try
        count = count + obj:(vrb)(@arg);
      except e (ANY)
        fork (0)
          raise(@e);
        endfork
      endtry
    endfor

This wouldn't work with a reraise (or bounce) statement because it would
have to be outside of the fork.
                                                --Dark_Owl



Home | Subject Index | Thread Index